Skip to content

AffanKhan007/ProjectHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProjectHub

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.

Stack

  • 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

Run locally with Docker

  1. Copy .env.example to .env.

  2. Start the stack:

    docker compose up --build
  3. Open http://localhost:8000/login.

  4. Bootstrap the first admin:

    docker compose exec app projecthub-bootstrap-admin --organization "Demo Org" --email admin@example.com --password change-me-now

Useful commands

Run migrations manually:

docker compose exec app alembic upgrade head

Run tests:

docker compose exec app pytest

Core routes

  • GET /healthz
  • GET /readyz
  • POST /auth/login
  • POST /auth/logout
  • GET /auth/me
  • POST /organizations
  • GET /organizations/{id}
  • POST /users
  • GET /users
  • GET /users/{id}
  • POST /projects
  • GET /projects
  • GET /projects/{id}
  • PATCH /projects/{id}
  • POST /tasks
  • GET /tasks
  • GET /tasks/{id}
  • PATCH /tasks/{id}
  • PATCH /tasks/{id}/status

Browser pages

  • GET /login
  • GET /dashboard
  • GET /admin/users
  • GET /projects
  • GET /tasks

Roles

  • admin: creates organizations and users
  • manager: creates projects and tasks, assigns tasks
  • member: views and updates assigned task status

Security notes

  • 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.

Project structure

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

About

ProjectHub is a Dockerized FastAPI + PostgreSQL project/task management app with JWT authentication, role-based access, Alembic migrations, and a responsive Jinja2 frontend for Admin, Manager, and Member workflows.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors