ProjectHub is a small Dockerized FastAPI + PostgreSQL task management app built for internship demos. It uses JWT auth, server-rendered Jinja2 pages, SQLAlchemy, and Alembic without splitting the scope into microservices.
- FastAPI backend
- PostgreSQL database
- SQLAlchemy ORM with request-scoped sessions
- Alembic migrations
- JWT access tokens with refresh-token persistence for logout revocation
- Argon2id password hashing
- Responsive Jinja2 + CSS frontend
- Pytest test suite
-
Copy
.env.exampleto.env. -
Start the stack:
docker compose up --build
-
Open
http://localhost:8000/login. -
Bootstrap the first admin:
docker compose exec app projecthub-bootstrap-admin --organization "Demo Org" --email admin@example.com --password change-me-now
Run migrations manually:
docker compose exec app alembic upgrade headRun tests:
docker compose exec app pytestGET /healthzGET /readyzPOST /auth/loginPOST /auth/logoutGET /auth/mePOST /organizationsGET /organizations/{id}POST /usersGET /usersGET /users/{id}POST /projectsGET /projectsGET /projects/{id}PATCH /projects/{id}POST /tasksGET /tasksGET /tasks/{id}PATCH /tasks/{id}PATCH /tasks/{id}/status
GET /loginGET /dashboardGET /admin/usersGET /projectsGET /tasks
admin: creates organizations and usersmanager: creates projects and tasks, assigns tasksmember: views and updates assigned task status
- Passwords are hashed with Argon2id.
- Login responses use generic failure messages.
- Login attempts are rate limited in-memory per client IP.
- Refresh tokens are stored as hashes.
- Audit logs capture login activity, user creation, project creation, task assignment, and task status updates.
- Secrets are loaded from environment variables.
projecthub/
app/
main.py
core/
db/
schemas/
services/
api/routes/
templates/
static/
scripts/
alembic/
tests/
Dockerfile
docker-compose.yml
.env.example
pyproject.toml
README.md