A simple FastAPI project for managing users in MongoDB with basic CRUD operations.
-
Clone and navite to directory
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # For Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt # For testing and linting
-
Set environment variables:
export MONGO_URI="your uri" export DATABASE_NAME="usersdb"
Start the server with:
uvicorn app.main:app --reload
Run the tests with:
pytest
Lint the code with:
pre-commit run --all-files