API du projet MemoryMap
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.
 
 
Alix JEUDI--LEMOINE 8552669e36
continuous-integration/drone/push Build is passing Details
♻ Changed format of the class to match the Pydantic v3 conventions
4 months ago
app ♻ Changed format of the class to match the Pydantic v3 conventions 4 months ago
docker 🐛 Fix Dockerfile 5 months ago
tests ⬆️ Upgraded pydantic to latest version & migrated python-jose to joserfc - from authlib, a more secure lib 4 months ago
.coveragerc 👷 Added .coveragerc file to use relative paths in coverage.xml 4 months ago
.drone.yml 🚨 Fixed code-analysis argument to use python coverage report instead of generic report 4 months ago
.gitignore Initial commit 7 months ago
DockerCommand.txt 📝 Add command to launch MongoDB container w/ Docker 5 months ago
README.md 📝 Updated README 4 months ago
pytest.ini 🚧 Changed pytest report type to XML + coverage file taken into account (test) 4 months ago
requirements.txt ⬆️ Upgraded pydantic to latest version & migrated python-jose to joserfc - from authlib, a more secure lib 4 months ago

README.md

REST API - MemoryMap

Build Status

Quality Gate Status Bugs Code Smells Coverage
Duplicated Lines (%) Lines of Code Maintainability Rating Reliability Rating
Security Rating Technical Debt Vulnerabilities

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

  1. Clone the repository:

    git clone https://codefirst.iut.uca.fr/git/SAE3A_MemoryMap/api.git
    cd api
    
  2. 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
    
  3. Build the docker image for the API:

    docker build -t memorymap_api -f docker/Dockerfile .
    
  4. 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
    
  5. Run the API container:

    docker run -d -p 8000:8000 --name memorymap_api --env-file .env memorymap_api
    
  6. Access the API: The API will be available at http://localhost:8000 and the documentation at http://localhost:8000/docs (or http://localhost:8000/redoc)

Running Tests

  1. Install test dependencies:

    pip install -r tests/requirements.txt
    
  2. 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
    
  3. Run the tests:

    pytest