A containerized backend service for authenticated task management, built with Flask, PostgreSQL, Docker Compose, and GitHub Actions. The project is designed to show production-minded backend fundamentals: secure authentication, clean API boundaries, isolated infrastructure, automated checks, and a developer-friendly local setup.
- JWT-based authentication with Bcrypt password hashing
- User-scoped task CRUD endpoints with request validation
- PostgreSQL persistence with SQLAlchemy connection pooling
- Docker Compose orchestration for one-command local startup
- Pytest and Ruff wired into GitHub Actions CI
- Python 3.12
- Flask
- PostgreSQL
- SQLAlchemy
- Docker and Docker Compose
- Pytest
- Ruff
- GitHub Actions
Client
|
v
Flask API (`/api/v1`)
|-- Auth routes
|-- Task routes
|
v
SQLAlchemy ORM
|
v
PostgreSQL
The application layer is split into focused modules for config, extensions, auth, tasks, models, and payload validation. Docker Compose isolates the API and database services while keeping the developer workflow simple.
.
|-- app/
| |-- auth/
| |-- tasks/
| |-- config.py
| |-- extensions.py
| |-- models.py
| `-- schemas.py
|-- tests/
|-- .github/workflows/ci.yml
|-- docker-compose.yml
|-- Dockerfile
|-- requirements.txt
`-- run.py
- Copy
.env.exampleto.env. - Run
docker compose up --build. - Open
http://localhost:5000/health.
POST /api/v1/auth/registerPOST /api/v1/auth/login
GET /api/v1/tasksPOST /api/v1/tasksGET /api/v1/tasks/<task_id>PUT /api/v1/tasks/<task_id>DELETE /api/v1/tasks/<task_id>
Register a user:
curl -X POST http://localhost:5000/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "engineer@example.com",
"password": "password123",
"password_confirmation": "password123"
}'Create a task with the returned JWT:
curl -X POST http://localhost:5000/api/v1/tasks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{
"title": "Ship backend service",
"description": "Implement auth, CRUD, tests, and Docker support"
}'ruff check .
pytestThis repository is intentionally scoped like a strong portfolio backend project: it demonstrates API design, authentication, database integration, containerization, automated validation, and clean project organization without burying the core ideas under unnecessary complexity.