A FastAPI application used to triage incoming emails.
- Python 3.8 or higher
- pip (Python package installer)
-
Create a virtual environment:
python -m venv .venv
-
Activate the virtual environment:
On macOS/Linux:
source .venv/bin/activateOn Windows:
.venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
Run the server with auto-reload enabled for development:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000For production, run without the --reload flag:
uvicorn app.main:app --host 0.0.0.0 --port 8000The server will be available at:
- Local: http://localhost:8000
- Network: http://0.0.0.0:8000
Once the server is running, you can access:
- Interactive API docs (Swagger UI): http://localhost:8000/docs
- Alternative API docs (ReDoc): http://localhost:8000/redoc
- OpenAPI JSON: http://localhost:8000/openapi.json
GET /- Root endpoint with welcome messageGET /health- Health check endpoint
Run the test suite using pytest:
pytestFor verbose output:
pytest -vFor coverage report:
pytest --cov=appThe application uses Pydantic Settings for configuration management. You can configure the application using:
- Default values in
app/core/config.py
Key configuration options:
PROJECT_NAME: Application nameVERSION: Application versionDEBUG: Enable debug modeHOST: Server hostPORT: Server portALLOWED_HOSTS: CORS allowed hosts