Made with FastAPI (Python)
You can find the official documentation for the project at https://api.memorymap.fr/docs (or https://api.memorymap.fr/redoc)
If you want to try the API on the production environment, please look at the documentation
- Docker
-
Clone the repository:
git clone https://codefirst.iut.uca.fr/git/SAE3A_MemoryMap/api.git cd api -
Create a
.envfile: Create a.envfile in the root directory of your project and add the following environment variables:MONGODB_URL=mongodb://localhost:27017/ MONGODB_USERNAME=mongoadmin MONGODB_PASSWORD=secret MONGODB_DATABASE=memorymap JWT_SECRET_KEY=your_jwt_secret_key JWT_ALGORITHM=HS256 JWT_ACCESS_TOKEN_EXPIRE_MINUTES=30
-
Build the docker image for the API:
docker build -t memorymap_api -f docker/Dockerfile . -
Run the MongoDB container:
docker run -d -p 27017:27017 --name mongodb -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=secret mongo:8.0.3-noble
-
Run the API container:
docker run -d -p 8000:8000 --name memorymap_api --env-file .env memorymap_api
-
Access the API: The API will be available at
http://localhost:8000and the documentation athttp://localhost:8000/docs(orhttp://localhost:8000/redoc)
-
Install test dependencies:
pip install -r tests/requirements.txt
-
Run the MongoDB container: ⚠ Do not change USERNAME / PASSWORD values
docker run -d -p 27017:27017 --name mongodb -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=secret mongo:8.0.3-noble
-
Run the tests:
pytest