How 101t/jasmin-web-panel works
Project Type and Purpose
• This is a full-stack Django web application (“Jasmin Web Panel”) to manage a Jasmin SMS Gateway.
• It provides both a browser-based UI and a RESTful API, includes background tasks (via Celery), and is designed to run in Docker, behind Nginx/Gunicorn in production.
File Structure
• Top-level “config” directory holds Django settings, ASGI/WSGI entrypoints, Celery configuration, and Docker configs.
• “main/api” contains API endpoints (views, serializers).
• “main/web” contains server-rendered templates, static assets (JS/CSS) and web views.
• “main/core” holds core business logic: models, tasks, SMTP mailer, SMPP connectors to Jasmin.
• “main/users” manages authentication and user‐profile sub-system.
• Docker and docker-compose files orchestrate multi‐container deployments (app, DB, broker, Jasmin gateway, optional submit-log service).
README for Deployment Patterns
• Production stack: Nginx → Gunicorn → Django (config.wsgi)
• Async jobs: Celery workers (config.celery) → broker (Redis or RabbitMQ)
• External services:
– PostgreSQL (PRODB_URL)
– Jasmin SMS Gateway (Telnet/SMPP host & port)
– Submit-Log service (optional)
– External SMTP server (for notification emails)
Main Components
a. Client Layer
– Web Browser (UI)
– API Consumers (could be AJAX frontend or external apps)
b. Edge / Web Server
– Nginx (reverse proxy, static & media hosting)
– Upstream: Gunicorn WSGI/ASGI workers
c. Django Application
– URL Dispatcher (config/urls.py, main/api/urls.py, main/web/urls.py)
– Web MVC (main/web/views + templates + static)
– REST API (main/api/views)
– Users Module (authentication, profile management)
– Core Module (SMS commands, logging, SMPP connectors, mailer)
d. Data Stores
– PostgreSQL Database
– (Possibly) Redis/RabbitMQ as Celery broker
e. Background Workers
– Celery Workers executing tasks (mail_html, Submit-Log integration, SMPP jobs)
f. External Services
– Jasmin SMS Gateway (Telnet & SMPP interfaces)
– Submit-Log microservice (optional, via HTTP or AMQP)
– SMTP server (for sending emails)
Relationships and Data Flows
• Django ↔ Database: ORM calls to PostgreSQL
• Django → Celery broker: enqueue background tasks
• Celery worker → Django models/external systems: process queued tasks
• Django/Celery → Jasmin Gateway: Telnet API calls or SMPP sessions
• Django → SMTP server: send notification emails
• Docker-Compose: orchestrates all containers and inter-container networks
Architectural Patterns and Design Principles
• Django’s MTV (Model-Template-View) layered structure
• Clear separation: synchronous request/response vs asynchronous job processing
• Modular apps: api, web, core, users
• Infrastructure as code: Docker, Compose, Nginx, Systemd service
Technologies & Frameworks to Annotate
• Python ≥3.11, Django framework
• Celery for background processing
• PostgreSQL (primary DB)
• Redis or RabbitMQ (Celery broker)
• Jasmin SMS Gateway (external Telnet/SMPP)
• Docker / docker-compose orchestrator
• Nginx reverse proxy + Gunicorn application server
• SMTP server (mail notifications)