TP_JO2024/PROJET.md
2024-03-27 14:17:05 +01:00

54 lines
1.3 KiB
Markdown

# API JO 2024
Todo :
- API Athletes (in progress), API Medaille, API Discipline
- Simple FrontEnd
- Dockerize
- Data generation script for testing purpose
Done :
- Swagger definitions
- Base model (on Athletes) with unitests (pytest)
## Architecture
3 uServices in their respective subfolders:
- ``/athlete``: Athletes API
- ``/medaille``: Medals API
- ``/discipline``: Disciplines API
A ``swagger.yaml`` definition is available in each uService definition in the api folder.
The ``data`` folder contains the data used by the API in dev. It is a shared folder in the dev environement.
The ``sample`` folder for default values inside the containers. It should be mounted in the docker container in seperated volumes as they shouldn't talk to each other.
## How to run (dev)
Go in the right API folder. Start the flask application
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd athlete/
python app.py
```
## How to test
```bash
pytest -vvv .
```
## How to build the docker images
You can build using the rootfolder context and the Dockerfile in the subfolder.
```bash
docker build . -f athlete/Dockerfile
docker build . -f discipline/Dockerfile
docker build . -f medaille/Dockerfile
```
However, the compose file is already set up to build the images for you.
```bash
docker compose up -d
```