diff options
-rw-r--r-- | readme.md | 50 |
1 files changed, 37 insertions, 13 deletions
@@ -28,26 +28,22 @@ - [socket.io](https://socket.io/) voor de communicatie tussen de clients en de server tijdens een potje - [SQLite](https://sqlite.org/index.html) voor de database -Een voorbeeld van de database is te vinden op [Google Docs](https://docs.google.com/spreadsheets/d/1mDN9IUqRIMjr_9RmLxKybjIgVuaUadalmPEFnG-XeJg/edit?usp=sharing), en een voorbeeld van de website is te vinden op [Figma](https://www.figma.com/file/rTciVQApAe6cwrH1Prl5Wn/4-op-een-rij?node-id=0%3A1) +Een voorbeeld van de database is te vinden op [Google Docs](https://docs.google.com/spreadsheets/d/1mDN9IUqRIMjr_9RmLxKybjIgVuaUadalmPEFnG-XeJg/edit?usp=sharing) samen met de api endpoints, en een voorbeeld van de website is te vinden op [Figma](https://www.figma.com/file/rTciVQApAe6cwrH1Prl5Wn/4-op-een-rij?node-id=0%3A1) ## Hoe 'installeren' 0. `git clone https://github.com/lonkaars/po-4-op-een-rij` 1. Zorg dat je [python](https://python.org/downloads) hebt geïnstalleerd. 2. Zorg dat je [nodejs](https://nodejs.org/en/download) hebt geïnstalleerd. -3. Installeer typescript en yarn: +3. Installeer typescript, react-scripts en yarn: ```sh - npm i -g typescript yarn + npm i -g typescript yarn react-scripts ``` 4. Maak een python virtual environment en installeer pip modules: ```sh python -m venv venv - # windows / powershell - .\venv\Scripts\Activate.ps1 - - # linux / posix - source venv/bin/activate + # activeer virtual environment (zie volgende alinea) pip install -r requirements.txt ``` @@ -56,6 +52,34 @@ Een voorbeeld van de database is te vinden op [Google Docs](https://docs.google. yarn ``` +## Hoe python virtual environment activeren + +### Windows (cmd) + +``` +.\venv\Scripts\activate.bat +``` + +### Windows (powershell) + +``` +.\venv\Scripts\Activate.ps1 +``` + +### Windows (git bash) + +``` +./venv/Scripts/activate +``` + +### Linux (bash/zsh/sh) + +``` +./venv/bin/activate +``` + +Als je het goed gedaan hebt krijg je een nieuwe prompt te zien met `(venv)` er voor. + ## Hoe starten Om dit project te starten moet je 2 terminals gebruiken die afzonderlijk de flask server en de react server starten: @@ -63,11 +87,7 @@ Om dit project te starten moet je 2 terminals gebruiken die afzonderlijk de flas ```sh # term 1 -# windows / powershell -.\venv\Scripts\Activate.ps1 - -# linux / posix -source venv/bin/activate +# activeer virtual environment flask run @@ -78,6 +98,10 @@ yarn start # dit opent automatisch de website in je browser ## Hoe API endpoints testen ```sh +# Als je alleen de flask server draait: +curl http://localhost:5000/api/<endpoint> + +# Als de react server draait: curl http://localhost:3000/api/<endpoint> ``` |