5 |
5 |
- [**MongoDB**](https://www.mongodb.com/) - Database
|
6 |
6 |
|
7 |
7 |
## 🔩 Development env
|
|
8 |
### SW needed for development
|
|
9 |
* **[🐳 docker](https://docs.docker.com/engine/install)**
|
|
10 |
* **[🐳 docker-compose](https://docs.docker.com/compose/install/)**
|
|
11 |
* **[📝 Visual Studio Code](https://code.visualstudio.com/Download)**
|
|
12 |
### Development setup
|
|
13 |
* First you need to **build** and **run** all needed containers
|
|
14 |
* run either of these scripts inside the **root of the project**:
|
|
15 |
* Linux: `./scripts/dev/build.sh`
|
|
16 |
* Windows: `scripts/dev/build.bat`
|
|
17 |
* check if all containers are running by `docker ps -a`
|
|
18 |
* now if you open **[localhost](https://localhost:80)** you should see working website
|
|
19 |
* Install needed extensions inside vscode
|
|
20 |
* open the project folder with vscode
|
|
21 |
* if you are prompt to install recommended extensions in the right bottom corner click on it (wait for installation to complete)
|
|
22 |
* if **there is no popup for installation** do this: click <img src="./doc/images/extension.png" height="40px" width="40px"/>, <img src="./doc/images/more.png" height="40px" width="40px"/> and choose `Show Recommended extensions` and install extension which is in section **WORKSPACE RECOMMENDATIONS** (`ms-vscode-remote.remote-containers`)
|
|
23 |
* You may be asked to **reload vscode** (blue label inside extension with text)
|
|
24 |
### Symfony (`./website`)
|
|
25 |
* To make changes inside symfony module click on file `symfony.code-workspace` which is in `website` folder
|
|
26 |
* Click on <kbd>Open Workspace</kbd> at the bottom of the screen, wait
|
|
27 |
* Click on <kbd>Reopen in Container</kbd>
|
|
28 |
* Now you are inside the **docker container**. You should see something like this in the bottom left corner
|
|
29 |
</br>
|
|
30 |
</br>
|
|
31 |
<img src="./doc/images/dev-container.png">
|
|
32 |
* To **close attach or reopen project in container** use these arrows
|
|
33 |
* Now **install recommended extension.**
|
|
34 |
* If you need to run `compose` commands simply open vscode terminal and run your commands there.
|
|
35 |
* If you want to format all your code inside `src` <kbd>F1 >> Tasks: Run Task >> Format</kbd>
|
|
36 |
* Your code should be formated while you are writing
|
|
37 |
* Everything is set 🏆🎉
|
|
38 |
### Crawler (`./modules/crawler`)
|
|
39 |
To make changes inside crawler module click on file `python.code-workspace` which is in `./modules/crawler` folder
|
|
40 |
* Click on <kbd>Open Workspace</kbd> at the bottom of the screen, wait
|
|
41 |
* Click on <kbd>Reopen in Container</kbd>
|
|
42 |
* Now you are inside the **docker container**. You should see something like this in the bottom left corner
|
|
43 |
</br>
|
|
44 |
</br>
|
|
45 |
<img src="./doc/images/dev-container.png">
|
|
46 |
* To **close attach or reopen project in container** use these arrows
|
|
47 |
* Now **install recommended extension.**
|
|
48 |
* If you need to run `pip` or `python` commands simply open vscode terminal and run your commands there.
|
|
49 |
* Everything is set 🏆🎉
|
8 |
50 |
|
9 |
|
* Install **latest php**, **[🐳 docker](https://www.docker.com/)**, **[📝 vscode](https://code.visualstudio.com/)** and **[🐍PyCharm](https://www.jetbrains.com/pycharm/)**
|
10 |
|
* Then run `./scripts/dev/build.sh` or `scripts/dev/build.bat` in the root of the project
|
11 |
|
* When you run `docker ps` you should see these containers: **heatmap_nginx**, **heatmap_php-fpm** and **heatmap_mongodb**
|
12 |
|
* Symfony project should be available on http://localhost:80
|
13 |
|
* ❗IMPORTANT❗make sure you are developing in vscode workspace for symfony
|
14 |
|
* To get into workspace click on `symfony.code-workspace` and on bottom right <kbd>Open Workspace</kbd>
|
15 |
|
### PHP Composer
|
16 |
|
* For composer commands `./scripts/composer.sh` and provide args
|
17 |
|
* install `./scripts/composer.sh install`
|
18 |
|
* require `./scripts/composer.sh require package_name`
|
19 |
|
### PHP Linter in vscode
|
20 |
|
* If you want check your code style is in the right format press <kbd>F1</kbd> choose `Tasks: Run Task` and `PHP Linter`
|
21 |
|
* If you want to format the current file just press <kbd>F1</kbd> choose
|
22 |
|
`Tasks: Run Task` and `Format`
|
23 |
|
### PyCharm
|
24 |
|
* First you need to set python interpeter to the containers by **following these steps**
|
25 |
|
<div style="display: flex; flex-direction: row; justify-content: space-around;flex-wrap: wrap">
|
26 |
|
<div style="height: 450px; display: flex; justify-content: space-between;flex-direction: column;">
|
27 |
|
<img src="./doc/images/1.png" width="500px" style="display: block"/>
|
28 |
|
<p style="background: red">A. Enter Settings (File/Preferences/Settings)</p>
|
29 |
|
</div>
|
30 |
|
<div style="height: 450px; display: flex; justify-content: space-between; flex-direction: column;">
|
31 |
|
<img src="./doc/images/2.png" width="500px" height="360px" style="display: block"/>
|
32 |
|
<p style="background: red">B. In the left panel choose <b>Docker</b> and in <b>Image Name</b> choose <b>heatmap_py-charm</b></p>
|
33 |
|
</div>
|
34 |
|
<div style="height: 450px; display: flex; justify-content: space-between;flex-direction: column;">
|
35 |
|
<img src="./doc/images/3.png" width="500px" style="display: block"/>
|
36 |
|
<p style="background: red">C. When setup is ok you will see all packages from requirements on this screen</b></p>
|
37 |
|
</div>
|
38 |
|
</div>
|
39 |
|
|
40 |
|
* New dependencies put in **requirements.txt** and then run build `./scripts/dev/build.sh`
|
41 |
|
|
|
51 |
### Debuging
|
|
52 |
* Set your breakpoints and hit <kbd>F5</kbd> or goto <kbd>Run >> Start debugging</kbd>
|
|
53 |
* Working in both modules
|
42 |
54 |
## 🚀 Production env
|
43 |
55 |
* To run production env on your local machine execute this `./scripts/build.sh`
|
readme update + hotfix php linter