How yuvisidhu19/queue-management-system works
Project Type & Purpose
• This is a monolithic, full-stack Django web application with three user roles (Customer, Employee, Admin) and an underlying queue-balancing algorithm.
• It exposes HTML/CSS/JS front-ends via Django templates, serves static assets, persists data in a relational store (SQLite), and integrates with two external services (Twilio SMS API and SMTP email).
File Structure
• Top-level:
• manage.py – Django CLI entry
• qms/ – Django project config (settings.py, urls.py, wsgi/asgi)
• app1/ – Main Django app (models.py, views.py, urls.py, admin.py, migrations)
• templates/ – HTML templates for user, employee, admin flows
• staticfiles/ – Compiled static assets (CSS/JS/fonts/images for Django admin)
• db.sqlite3 – Local database file
• Patterns & concerns:
• MVC (Model = app1/models.py, Views = app1/views.py & templates, Controller = Django URL dispatcher)
• Three logical “sub-applications” share the same codebase: Customer UI, Employee UI, Admin UI (Django admin).
• External integrations are isolated in views.py (Twilio & smtplib).
Extract Architecture Insights from README
• Three “flows”:
a. Customer registers via a web page; receives OTP via SMS+email; queries queue status; gets notifications when it’s their turn.
b. Employee logs in, selects a counter, serves “next customer” which triggers the queue balancing algorithm.
c. Admin uses Django admin to manage employee accounts and counter count.
• Dynamic queue rebalancing algorithm is the business-logic core.
Main Components & Their Interactions
A. Client Layer
• Mobile Browser (Customer)
• Web Browser (Employee & Admin)
B. Presentation Layer (Django server)
• Django URL Router (qms/urls.py → app1/urls.py)
• Templates Renderer (Django template engine)
• Static Files Server (staticfiles via WhiteNoise or Django’s staticfiles)
C. Application Layer (app1)
• Authentication & Authorization (Django auth for employees & admin; custom OTP logic for customers)
• Views / Controllers (app1/views.py)
• Queue Management Logic
• Token assignment
• Counter assignment (smallest-queue strategy)
• Dynamic rebalancing algorithm (on “next customer” clicks)
• Email/SMS Notification Module (Twilio REST client & smtplib)
D. Data Layer
• Relational DB (SQLite db.sqlite3)
• Models (app1/models.py)
• UserData (customers)
• Employee & Admin users (Django auth, extended)
• Counter & Queue tables
E. External Services
• Twilio SMS API (REST calls)
• SMTP Mail Server (smtplib)
Architectural Patterns & Design Principles
• MVC / MTV (Model-Template-View) in Django
• Layered architecture: Presentation → Application → Data
• Single monolith: All logical modules share one process and one DB
• External integration via well-defined adapters (views.py segments)
a. URL Router & Middleware
b. Templates Renderer + Static File server
c. app1 View Functions (annotate OTP flow, queue logic, next-customer algorithm)
d. Auth subsystem (Django auth & OTP)
6. At the bottom or side, note the “Dynamic Queue Allocation Algorithm” as a highlighted component inside app1, with a short annotation of its logic.