1
|
# ZČU Heatmap
|
2
|
|
3
|
- [**Nginx**](https://www.nginx.com/) - Server
|
4
|
- [**Symfony**](https://symfony.com/) - PHP framework
|
5
|
- [**MongoDB**](https://www.mongodb.com/) - Database
|
6
|
|
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
|
|
30
|
</br>
|
31
|
</br>
|
32
|
<img src="./doc/images/dev-container.png">
|
33
|
|
34
|
* To **close attach or reopen project in container** use these arrows
|
35
|
* Now **install recommended extension.**
|
36
|
* If you need to run `compose` commands simply open vscode terminal and run your commands there.
|
37
|
* If you want to format all your code inside `src` <kbd>F1 >> Tasks: Run Task >> Format</kbd>
|
38
|
* Your code should be formated while you are writing
|
39
|
* Everything is set 🏆🎉
|
40
|
### Crawler (`./modules/crawler`)
|
41
|
To make changes inside crawler module click on file `python.code-workspace` which is in `./modules/crawler` folder
|
42
|
* Click on <kbd>Open Workspace</kbd> at the bottom of the screen, wait
|
43
|
* Click on <kbd>Reopen in Container</kbd>
|
44
|
* Now you are inside the **docker container**. You should see something like this in the bottom left corner
|
45
|
|
46
|
</br>
|
47
|
</br>
|
48
|
<img src="./doc/images/dev-container.png">
|
49
|
|
50
|
* To **close attach or reopen project in container** use these arrows
|
51
|
* Now **install recommended extension.**
|
52
|
* If you need to run `pip` or `python` commands simply open vscode terminal and run your commands there.
|
53
|
* Everything is set 🏆🎉
|
54
|
|
55
|
### Debuging
|
56
|
* Set your breakpoints and hit <kbd>F5</kbd> or goto <kbd>Run >> Start debugging</kbd>
|
57
|
* Working in both modules
|
58
|
## 🚀 Production env
|
59
|
* To run production env on your local machine execute this `./scripts/build.sh`
|