Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for local setup win #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

As a reaction to the Corona virus we have created a donations web for people in need in Slovakia

[Setup local environment](docs/setup-local-environment.md)

2 changes: 1 addition & 1 deletion docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN echo "xdebug.remote_host=docker.for.mac.host.internal" >> /etc/php/7.3/fpm/conf.d/20-xdebug.ini && \
RUN echo "xdebug.remote_host=host.docker.internal" >> /etc/php/7.3/fpm/conf.d/20-xdebug.ini && \
echo 'xdebug.file_link_format="phpstorm://open?url=file://%%f&line=%%l"' >> /etc/php/7.3/fpm/conf.d/20-xdebug.ini && \
echo "xdebug.remote_enable=1" >> /etc/php/7.3/fpm/conf.d/20-xdebug.ini && \
echo "xdebug.remote_autostart=1" >> /etc/php/7.3/fpm/conf.d/20-xdebug.ini && \
Expand Down
63 changes: 63 additions & 0 deletions docs/setup-local-environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Setup local environment

# Windows

## Prerequisites
Before setuping the project locally the following prerequisites will be needed. Please download and install them before continuing with Step 1.

1. Git for Windows ([Download](https://git-scm.com/download/win))
2. Docker Desktop for Windows ([Download](https://hub.docker.com/editions/community/docker-ce-desktop-windows/)). After installation enable File sharing by opening Docker -> Settings -> Resources -> File sharing -> check disk name which will contain cloned repository.
3. Code editor/IDE (Visual Studio Code, PhpStorm, ...)
4. Internet browser (Google Chrome, Firefox, Microsoft Edge, Safari, ...)

## Step 1 - Clone code repository
Navigate to the folder where you would like to clone the code from the github repository using your preferred command line tool (e.g. git bash) and run:

```
git clone https://github.com/Kto-pomoze-Slovensku/ktopomozeslovensku.git
```

## Step 2 - Create .env file with environment variables
Navigate to the root folder of your cloned repository and create and save .env file with following contents:
```
SYMFONY_DEPRECATIONS_HELPER=999999
DATABASE_URL="mysql://project:Password1@ktopomozeslovensku-mysql:3306/project?serverVersion=5.7"
ADMIN_PWD=''
SENTRY_DSN=''
```
## Step 3 - Build and run Docker containers
Navigate to the root folder of your cloned repository via preferred command line tool and run:
```
docker-compose up -d
```

If you encounter 'Drive has not been shared' error make sure that File sharing has been enabled in Docker, see Prerequisites.

## Step 4 - Install Symfony dependencies for the ktopomozeslovensku-php service
Navigate to the root folder of your cloned repository via preferred command line tool and run:
```
docker exec -it ktopomozeslovensku-php bash
```

This will open the bash command line interface for the ktopomozeslovensku-php service running in Docker. To install required dependencies run:
```
composer i
```

## Step 5 - Create database table structure using Doctrine migrations
From the ktopomozeslovensku-php command line still opened in Step 4 run:
```
php ./bin/console doctrine:migrations:migrate
```

## Step 6 - install front end dependencies
Navigate to the root folder of your cloned repository and run:
```
yarn
```

## Step 7 - Test local setup
Open your preferred browser and enter url:
```
localhost:8888
```