Skip to content

A production-grade, dockerized REST API designed for scalable issue tracking, built with best practices for deployment and maintainability.

License

Notifications You must be signed in to change notification settings

tsvlgd/issue-tracker-api

Repository files navigation

Issue Tracker API

Build Status License Python Dockerized Flask

A secure, production-ready, and Dockerized backend API to manage issue tickets. It supports JWT auth, RBAC, Alembic migrations, and is built with a focus on modularity and testability.


📑 Table of Contents


✅ Features

  • JWT authentication (access & refresh tokens)
  • Role-Based Access Control (Admin/User)
  • Issue ticket CRUD operations
  • Token revocation (logout functionality)
  • Alembic for DB migrations
  • Pytest test suite
  • Dockerized development & production setup
  • Pre-commit hooks (Black, isort, flake8)
  • Pydantic for request validation

Tech Stack

Category Tools & Libraries
Framework Flask
ORM SQLAlchemy
Auth JWT (with blacklist support)
Database PostgreSQL
Migrations Alembic
Testing Pytest
Dev Tools Docker, Docker Compose, uv, Black, isort, pre-commit

📐 Architecture

             ┌────────────┐
             │  Client    │
             └────┬───────┘
                  │
          HTTP API Requests
                  │
             ┌────▼──────┐
             │ Flask App │
             └────┬──────┘
      ┌────────────┴────────────┐
      │                         │
┌─────▼─────┐           ┌───────▼────────┐
│ Auth Layer│           │ Issue Routes   │
└─────┬─────┘           └────────┬───────┘
      │                          │
┌─────▼───────┐         ┌────────▼────────┐
│JWT & RBAC   │         │CRUD + Validation│
└─────┬───────┘         └────────┬────────┘
      │                          │
  ┌───▼────┐               ┌─────▼─────┐
  │Database│ ◄──────────── │ SQLAlchemy│
  └────────┘               └───────────┘

📂 Project Structure

issue-tracker-api/
├── app/
│   ├── core/           # Config & extensions
│   ├── models/         # SQLAlchemy models
│   ├── routes/         # Flask blueprints
│   └── __init__.py     # App factory
├── tests/              # Pytest test cases
├── migrations/         # Alembic migrations
├── Dockerfile
├── docker-compose.dev.yml
├── docker-compose.prod.yml
├── .pre-commit-config.yaml
├── .gitignore
├── pyproject.toml
├── run.py
└── README.md

⚙️ Setup

1. Clone the Repository

git clone https://github.com/Savvythelegend/issue-tracker-api.git
cd issue-tracker-api

2. Install Dependencies (Dev)

uv pip install .[dev]

Environment Variables

Create a .env file in the project root:

FLASK_CONFIG=development
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/issue_tracker
JWT_SECRET_KEY=your-secret-key

Running Locally (without Docker)

flask db upgrade
flask run

🐳 Running with Docker

docker compose -f docker-compose.dev.yml up --build

✅ Testing

pytest

🧹 Linting & Formatting

pre-commit run --all-files

Deployment

Use docker-compose.prod.yml or a PaaS provider like Render, Railway, or Northflank.

Ensure production environment variables are set:

FLASK_CONFIG=production
DATABASE_URL=<your-production-db-url>
JWT_SECRET_KEY=<your-secure-key>

📈 Project Status

Actively maintained with regular updates and improvements. Open to issues and contributions!

About

A production-grade, dockerized REST API designed for scalable issue tracking, built with best practices for deployment and maintainability.

Resources

License

Stars

Watchers

Forks