|
1 | | -- 👋 Hi, I’m @Qomserver |
2 | | -- 👀 I’m interested in ... |
3 | | -- 🌱 I’m currently learning ... |
4 | | -- 💞️ I’m looking to collaborate on ... |
5 | | -- 📫 How to reach me ... |
6 | | -- 😄 Pronouns: ... |
7 | | -- ⚡ Fun fact: ... |
8 | | - |
9 | | -<!--- |
10 | | -Qomserver/Qomserver is a ✨ special ✨ repository because its `README.md` (this file) appears on your GitHub profile. |
11 | | -You can click the Preview link to take a look at your changes. |
12 | | ----> |
| 1 | +## ProdReadyApp (FastAPI + Postgres) |
| 2 | + |
| 3 | +A production-ready web application with authentication and task management built with FastAPI, SQLAlchemy, Alembic, and PostgreSQL. Includes Docker, CI, tests, and secure defaults. |
| 4 | + |
| 5 | +### Features |
| 6 | +- JWT auth (access + refresh), password hashing |
| 7 | +- Users + Tasks CRUD with ownership and admin controls |
| 8 | +- SQLAlchemy 2.0 + Alembic migrations |
| 9 | +- Health checks and Prometheus metrics |
| 10 | +- Rate limiting, CORS, secure headers |
| 11 | +- Gunicorn + Uvicorn workers |
| 12 | +- Docker Compose for local/dev/prod |
| 13 | +- GitHub Actions CI (lint + tests) |
| 14 | + |
| 15 | +### Quickstart (Docker) |
| 16 | +1. Copy env file: |
| 17 | + ```bash |
| 18 | + cp .env.example .env |
| 19 | + ``` |
| 20 | +2. Start services: |
| 21 | + ```bash |
| 22 | + docker compose -f infra/docker-compose.yml up --build |
| 23 | + ``` |
| 24 | +3. App available at `http://localhost:8000` (API docs at `/docs`). |
| 25 | + |
| 26 | +### Local (no Docker) |
| 27 | +```bash |
| 28 | +python -m venv .venv && source .venv/bin/activate |
| 29 | +pip install -r app/requirements.txt |
| 30 | +export $(grep -v '^#' .env.example | xargs) # or create .env |
| 31 | +alembic -c app/alembic.ini upgrade head |
| 32 | +uvicorn src.main:create_app --factory --host 0.0.0.0 --port 8000 --app-dir app |
| 33 | +``` |
| 34 | + |
| 35 | +### Useful Make targets |
| 36 | +```bash |
| 37 | +make setup # install deps |
| 38 | +make run # run dev server |
| 39 | +make test # run tests |
| 40 | +make lint # run linters |
| 41 | +make format # format code |
| 42 | +make docker-up |
| 43 | +``` |
| 44 | + |
| 45 | +### Migrations |
| 46 | +```bash |
| 47 | +alembic -c app/alembic.ini revision -m "message" |
| 48 | +alembic -c app/alembic.ini upgrade head |
| 49 | +``` |
| 50 | + |
| 51 | +### Configuration |
| 52 | +Set environment variables (see `.env.example`). Defaults are safe for local dev. For production, always set `JWT_SECRET`, use strong DB credentials, and terminate TLS at a reverse proxy or load balancer. |
| 53 | + |
| 54 | +### Security Notes |
| 55 | +- Tokens are short-lived, refresh tokens persisted and revocable |
| 56 | +- Rate limits applied to auth routes |
| 57 | +- CORS is restricted via env |
| 58 | +- Non-root container user |
| 59 | + |
| 60 | +### License |
| 61 | +MIT |
0 commit comments