Skip to content

About

TaskForge is a multi-tenant SaaS project management platform built with Django, DRF, PostgreSQL, Redis, Celery, and Channels. It features JWT auth, real-time task updates, Stripe billing, role-based access, async notifications, Dockerized deployment, CI/CD, and production-grade security/testing.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

TaskForge logo

TaskForge Backend

Python Django Django REST Framework PostgreSQL Redis Docker pytest GPLv3 license GitHub stars

⭐ Enjoying TaskForge Backend? If it's useful to you, please star it on GitHub. It's free and it helps other developers find it.


Table of Contents


About

TaskForge is a multi‑tenant project‑management SaaS backend built with Django 5, Django REST Framework, PostgreSQL, and Redis. The service handles role-based access control (RBAC), custom JWT authentication, and tenant isolation using row-level permissions.


Architecture Overview

The repository contains a single Django project that is deliberately split into reusable apps. Key architectural decisions include:

  • Row-level multi-tenancy: a single database schema with tenant identifiers (Organization, Membership). This keeps migrations and analytics simple while still isolating tenants.
  • Custom JWT workflow: thin wrappers around simplejwt for full control over token payloads and blacklisting on logout.
  • Dual organization resolution: tenant can be supplied via URL slug or the X-Organization-Slug header, so front-end clients can pick whichever fits.
  • Security hardening: django-axes protects against brute-force attacks.
  • Dockerized development: multi-stage Dockerfile and docker-compose.yml for reproducible local environments.

Features Implemented (Phase 1)

Feature Status Description
Custom User model ✅ Email‑based login, UUID primary key, extensible fields
Settings split ✅ Environment‑specific settings (base.py, dev.py, prod.py)
Custom JWT auth ✅ SimpleJWT with token blacklisting
Google OAuth2 ✅ Social login via django‑allauth & dj‑rest‑auth
Multi‑tenancy ✅ Row‑level tenant isolation via Organization & Membership
RBAC permissions ✅ DRF permission classes (IsOrgAdmin, IsOrgMember, IsOrgViewer)
CurrentOrg middleware ✅ Auto‑detect tenant from slug or header
Brute‑force protection ✅ django‑axes integration
Health check endpoint ✅ /api/v1/health/ liveness; ?deep=1 validates DB & Redis
OpenAPI documentation ✅ Swagger UI (/api/v1/docs/) and Redoc (/api/v1/redoc/)
Test suite ✅ pytest with factory_boy; >80 % coverage
Docker development ✅ Multi‑stage Dockerfile + Compose
CI workflow ✅ GitHub Actions for linting, security scans, tests
Demo data seeding ✅ python manage.py seed creates reproducible demo data

Quick Start (Docker)

# 1. Copy the example environment file and adjust values as needed
cp .env.example .env

# 2. Build and start the services
docker compose up --build -d

# 3. Run migrations and seed demo data (handled automatically on first start, but can be run manually)
# docker compose exec web python manage.py migrate
# docker compose exec web python manage.py seed

The API documentation will be available at:


Local Development

If you prefer a non‑Docker workflow:

# 1. Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows use `.venv\Scripts\activate`

# 2. Install development dependencies
pip install -r requirements/dev.txt

# 3. Set up a PostgreSQL database and Redis instance (default ports are 5432 and 6379)
#    Configure connection details in a `.env` file based on `.env.example`

# 4. Apply migrations and load seed data
python manage.py migrate
python manage.py seed

# 5. Start the development server
python manage.py runserver

Demo / Screenshot Data

seed creates the org and users; seed_demo_project fills it with a large, realistic showcase board called "Platform Relaunch Q1", built to fully populate the project dashboard (Kanban columns, timeline, velocity chart, priority distribution and activity feed):

python manage.py seed_demo_project --large-project --reset

What it seeds:

  • 8 demo team members with stable avatar URLs (deterministic per email)
  • 5 columns (Backlog, To-Do, In Progress, In Review, Done). Done is terminal.
  • 7 colored labels and ~150 tasks with 1–3 assignees, labels, priorities, start/due dates spread over the next 8 months, and progress on in-progress cards
  • ~200 backfilled activity-log entries across the past weeks, so the activity feed and velocity chart have data immediately

Flags: --large-project seeds the full ~150-task board (default ~50); --reset deletes and recreates just this demo project, leaving all other orgs/projects untouched. Log in as [email protected] and open the project board to see the populated dashboard.


Testing

# Using the Docker environment (recommended for CI consistency)
docker compose exec web pytest

# Or locally (ensure the test database is configured)
pytest

The test suite includes unit, integration, and API tests with a target of 80 %+ coverage.


API Documentation

Interactive documentation is generated automatically via drf‑spectacular:

All endpoints are versioned under the /api/v1/ prefix.


Demo Credentials

Role Email Password
Admin [email protected] TaskForge2024!
Member [email protected] TaskForge2024!
Viewer [email protected] TaskForge2024!

Demo organization slug: taskforge-demo


Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository and clone your fork.
  2. Create a feature branch (git checkout -b feature/your-feature).
  3. Write tests for any new functionality.
  4. Ensure the full test suite passes (pytest).
  5. Open a Pull Request with a clear description of the changes.

Please adhere to the existing code style (PEP 8) and run the linters (flake8 and black) before submitting.


License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

About

TaskForge is a multi-tenant SaaS project management platform built with Django, DRF, PostgreSQL, Redis, Celery, and Channels. It features JWT auth, real-time task updates, Stripe billing, role-based access, async notifications, Dockerized deployment, CI/CD, and production-grade security/testing.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages