How dua-amir/caseease works
Main Components
• Web Client (Browser)
• Django Application Server
• ASGI/WGSI entrypoints (asgi.py, wsgi.py)
• URL router (urls.py)
• Two Django apps:
– accounts
– cases
• Core settings & configuration (settings.py)
• Database (SQLite – db.sqlite3)
• Media Storage (local file system under /media)
• Static Assets (local file system under /static)
• Optional reverse proxy or load balancer (e.g., Nginx/Gunicorn)
Relationships & Data Flows
• Browser → HTTP(S) requests → Django ASGI/WGSI endpoint
• ASGI/WGSI → URL dispatcher → Appropriate view (accounts.views or cases.views)
• Views ↔ Models (accounts.models.User, cases.models.Case, CaseHistory, etc.)
• ORM queries → SQLite database
• Views → render HTML templates (templates/base.html, accounts/templates, cases/templates)
• File uploads/downloads → Media folder (stored via Django’s default FileSystemStorage)
• Static file serving → Static folder (served by Django in dev or by a web server in production)
Architectural Patterns & Principles
• MVC (Model–View–Template) pattern:
• Models in models.py
• Views in views.py (request handling & business logic)
• Templates for presentation
• Separation of concerns between “accounts” and “cases” apps
• Role-based access: middleware and decorators in accounts/middleware.py and views→ templates for Admin/Handler/User
• Auto-generated migrations drive DB schema evolution
Technologies & Frameworks
• Python 3.x, Django framework
• Built-in authentication system (customized User model in accounts/models.py)
• SQLite (db.sqlite3) for persistence
• Django’s built-in static and media file handling
• HTML/CSS templates—no SPA or separate frontend framework
Detailed Capture of Architectural Elements
• Major URL entrypoints from CaseEase/CaseEase/urls.py and apps’ urls.py
• Middleware layer (accounts/middleware.py) intercepting requests for role enforcement
• File upload flow: register_case view → FileField → /media/case_files
• Migrations folder to represent schema versioning
• Clearly separates frontend, backend, persistence, and infrastructure
• Shows how HTTP requests flow through Django’s ASGI/WGSI entrypoint, URL router, views, models, and templates
• Highlights the two main Django apps (“accounts” and “cases”) and their interaction with the database and storage
• Reflects all essential components as gleaned from the file tree and README of CaseEase