You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FastAPI scaffold with health endpoint, structured logging, env-driven config, pytest suite, ruff/mypy, and GitHub Actions CI.
11
13
12
14
## Stack
@@ -49,6 +51,27 @@ python-backend/
49
51
└── SECURITY.md
50
52
```
51
53
54
+
## Development Workflow
55
+
56
+
For local development, it's recommended to use a virtual environment. The project uses `ruff` for linting and formatting, and `mypy` for type checking. `pre-commit` hooks are configured to ensure code quality before commits.
docker run --rm -p 8000:8000 --env-file .env python-backend:latest
76
99
```
77
100
101
+
## Production Deployment
102
+
103
+
For production deployments, it is recommended to use a production-ready ASGI server like Gunicorn with Uvicorn workers. Below are examples for running the application in a production environment.
This command starts Gunicorn with 4 Uvicorn worker processes, binding to all network interfaces on port 8000.
112
+
113
+
### Health Check Path
114
+
115
+
The application provides a health check endpoint at `/health` (or `/api/v1/health` for the versioned API) that can be used by load balancers or container orchestration systems to verify the application's status.
116
+
117
+
## Logging Configuration
118
+
119
+
The application uses structured logging, configured via `app/core/logging.py`. The log level can be controlled using the `APP_LOG_LEVEL` environment variable (e.g., `INFO`, `DEBUG`, `WARNING`, `ERROR`). Logs are typically output to `stdout` and `stderr`, making them suitable for containerized environments and centralized logging solutions.
120
+
78
121
## Configuration
79
122
80
123
Settings loaded from environment variables or `.env`. All have defaults.
@@ -103,6 +146,10 @@ CI runs all of the above on Python 3.11 and 3.12.
103
146
104
147
See [CONTRIBUTING.md](CONTRIBUTING.md). Fork, branch from `main`, open a PR.
105
148
149
+
## Release Process
150
+
151
+
Releases are managed via GitHub releases. A new release can be cut by creating a new tag (e.g., `v1.0.0`). The CI/CD pipeline is configured to automatically build and publish artifacts upon a new tag. Changelog conventions are maintained in `CHANGELOG.md`.
0 commit comments