A minimal FastAPI app demonstrating CRUD, Pydantic models, custom exceptions, and rate limiting. Includes optional JWT auth and Dockerfile.
python -m venv .venv
source .venv/bin/activate # or .\.venv\scripts\activate.ps1
pip install -r requirements.txt
uvicorn app.main:app --reload
Open -> http://127.0.0.1:8000/docs or http://127.0.0.1:8000/redoc
Global middleware: 5 requests / 60 seconds per IP. Exceeding returns 429 with { "detail": "Rate limit exceeded" }.
Run below commands
cd fastapi_application
$env:TESTING="1"
pytest -v
- Install API Dog -> https://apidog.com/download/.
- Import collection json present inside
apidog_collection
folder into the application. - Make sure to add the access token (after using register and login endpoints) into the Auth section in collection folder settings.
- Execute all the available test cases.
docker build -t fastapi_application .
docker run -p 8000:8000 fastapi_application