You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
continuous-integration/drone/push Build is passing
Details
|
3 months ago | |
---|---|---|
app | 3 months ago | |
docker | 5 months ago | |
tests | 4 months ago | |
.coveragerc | 4 months ago | |
.drone.yml | 4 months ago | |
.gitignore | 7 months ago | |
DockerCommand.txt | 5 months ago | |
README.md | 4 months ago | |
pytest.ini | 4 months ago | |
requirements.txt | 4 months ago |
README.md
REST API - MemoryMap
Made with FastAPI (Python)
Documentation
You can find the official documentation for the project at https://api.memorymap.fr/docs (or https://api.memorymap.fr/redoc)
How to run it
If you want to try the API on the production environment, please look at the documentation
Prerequisites
- Docker
Running the Application
-
Clone the repository:
git clone https://codefirst.iut.uca.fr/git/SAE3A_MemoryMap/api.git cd api
-
Create a
.env
file: Create a.env
file 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:8000
and the documentation athttp://localhost:8000/docs
(orhttp://localhost:8000/redoc
)
Running Tests
-
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