Skip to content

Amir-hash19/Final_Project.v2-DRF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

133 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Django REST API Platform

โค๏ธ For kelaasor platform

๐Ÿ“– Reference

A scalable and modular backend built with Django REST Framework, featuring JWT authentication, Redis caching, Celery background tasks, and multiple apps including User Account, Bootcamp, Ticket, Support, and Blog.

Demo

๐Ÿง  Django REST Backend System

A production-ready Django REST API project with:

  • ๐Ÿ” JWT authentication
  • โš™๏ธ Rate limiting
  • โšก Redis caching
  • ๐Ÿ” Celery background tasks
  • postgreSQL
  • ๐Ÿงฉ Modular apps: useraccount, bootcamp, ticket, support, and blog

๐Ÿงฐ Technologies Used

This project is built using modern and production-ready technologies to ensure performance, scalability, and clean architecture.

โš™๏ธ Backend

  • ๐Ÿ Python 3.11
  • ๐Ÿงฑ Django 5.x
  • โšก Django REST Framework (DRF) โ€” for building robust RESTful APIs
  • ๐Ÿ” JWT Authentication โ€” secure user authentication using JSON Web Tokens

๐Ÿงฉ Apps

  • ๐Ÿ‘ค UserAccount โ€” user management & authentication
  • ๐ŸŽ“ Bootcamp โ€” training or course management
  • ๐ŸŽŸ๏ธ Ticket โ€” ticketing & issue tracking system
  • ๐Ÿ’ฌ Support โ€” support chat / helpdesk functionality
  • ๐Ÿ“ฐ Blog โ€” article publishing & content management

๐Ÿš€ Performance & Optimization

  • ๐Ÿงฎ Rate Limiting โ€” API request throttling using DRF throttles
  • โšก Caching with Redis โ€” improving performance and response time
  • ๐Ÿ” Background Tasks with Celery + Redis โ€” for async task processing (emails, notifications, etc.)

๐Ÿ—„๏ธ Database & Storage

  • ๐Ÿ˜ PostgreSQL โ€” main relational database
  • ๐Ÿงฐ Redis โ€” in-memory cache and message broker

๐Ÿงฐ DevOps / Tools

  • ๐Ÿณ Docker & Docker Compose โ€” containerized environment setup
  • ๐Ÿงช Pytest / Django Test Framework โ€” testing and CI-ready setup
  • ๐Ÿงน Black / isort / flake8 โ€” code formatting and linting
  • โ˜๏ธ Environment Variables (.env) โ€” secure configuration management

๐Ÿ“ฆ Example Stack Overview

Django + DRF  โ†’  PostgreSQL  โ†’  Redis  โ†’  Celery  โ†’  Docker

# Kelassor โ€“ Django REST Framework

Production-ready Django REST Framework project, fully containerized with Docker Compose. This setup is designed for **consistent development**, **team collaboration**, and **production-like environments**.

---

## ๐Ÿš€ Quick Start (Docker Compose โ€“ Recommended)

This project runs **exclusively via Docker Compose**. No local Python, PostgreSQL, or Redis installation is required.

### Prerequisites

* Docker (v20+)
* Docker Compose (v2+)

Verify installation:

```bash
docker --version
docker compose version

โ–ถ๏ธ Run the Project

# 1. Clone the repository
git clone https://github.com/Amir-hash19/Final_Project.v2-DRF.git
cd Kelassor

# 2. Create environment file
cp .env.example .env

# 3. Build and start services
docker-compose up --build

This will start all required services automatically.


๐ŸŒ Application Access


๐Ÿงฑ Services Architecture

+-------------+        +-------------+
|   Client    | -----> |   Django    |
| (Browser /  |        |   REST API  |
|  Mobile)    |        +------+------+ 
+-------------+               |
                              |
        +---------------------+---------------------+
        |                     |                     |
+-------v-------+     +-------v-------+     +-------v-------+
| PostgreSQL DB |     |     Redis     |     |   Celery      |
|   (Data)     |     | (Cache/Broker)|     |   Workers     |
+---------------+     +---------------+     +---------------+

โš™๏ธ Environment Variables

All configuration is managed via environment variables.

Create a .env file based on .env.example.

Required Variables

# Django
DJANGO_SECRET_KEY=your-secret-key
DJANGO_DEBUG=False
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1

# Database
POSTGRES_DB=kelassor
POSTGRES_USER=kelassor
POSTGRES_PASSWORD=kelassor
POSTGRES_HOST=db
POSTGRES_PORT=5432

# Redis
REDIS_HOST=redis
REDIS_PORT=6379

# Celery
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/0

โš ๏ธ Never commit .env files to version control.


๐Ÿ›  Common Commands

Django Management

docker-compose exec app python manage.py migrate
docker-compose exec app python manage.py createsuperuser
docker-compose exec app python manage.py collectstatic

Code Formatting

docker-compose exec app isort .
docker-compose exec app black .

Stop Services

docker-compose down

๐Ÿงช Development Notes

  • Source code is mounted as a Docker volume (hot reload enabled)
  • Static files are collected automatically on startup
  • Celery workers run as separate services
  • Formatting is enforced using Black + isort

๐Ÿšซ Local (Non-Docker) Execution

Running the project outside Docker is not supported.

Docker Compose is the single source of truth for development and deployment.


๐Ÿ“ฆ Tech Stack

  • Django & Django REST Framework
  • PostgreSQL
  • Redis
  • Celery
  • Docker & Docker Compose

๐Ÿ“„ License

This project is licensed under the MIT License.

About

Scalable education management platform built with Django REST Framework, featuring JWT auth, Redis caching, and Celery background tasks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors