How anay0305/online-mock-tests-webapp works
Project Type and Purpose
• This is a full-stack web application built with Django (Python) on the backend and plain HTML/CSS/JS on the frontend.
• Primary purpose: Let users take online mock tests, calculate instant results, and review answers.
File Structure
• Top-level “WebApp” folder is the Django project (settings, ASGI/WGSI, urls).
• Two Django apps beneath root:
– “main”: serves HTML views, handles form submissions, renders templates.
– “API”: exposes REST-style endpoints for tests, questions, results.
• “static/” holds all CSS, JS, images, organized per page (login, signup, test, etc.).
• “templates/” contains HTML templates (login.html, test.html, etc.).
• “db.sqlite3” is the development database; migrations live under each app’s “migrations/.”
• “config/gunicorn.conf.py” & “scripts/super.sh” suggest a production deploy via Gunicorn.
README for Additional Insights
• Instant scoring and feedback, admin panel for test management.
• Responsive design (mobile/desktop).
• Some features may be incomplete—focus on core flows.
Main Components
1. Web Client (Browser)
• Loads “static” assets; interacts via HTTP(S).
2. Load Balancer / Reverse Proxy (optional)
• Nginx or similar in front of Gunicorn (implied by gunicorn.conf.py).
3. Application Server (Gunicorn)
• Receives HTTP requests, forwards to Django.
4. Django WebApp
• URL Router splits requests between the “main” app and the “API” app.
• “main” app renders templates, handles user-driven flows.
• “API” app serves JSON endpoints for quizzes and results.
5. Database (SQLite)
• Django ORM persists users, tests, questions, answers, results.
6. Admin Interface
• Django’s built-in admin site for managing tests and questions.
7. (Optional) External Authentication or Analytics
• Not present currently but leave space for future integration.
Relationships and Data Flows
• Browser → (HTTPS) → Load Balancer/Reverse Proxy → Gunicorn → Django URL Router.
• Router → “main/views.py” or → “API/views.py” depending on endpoint.
• Views → ORM → SQLite (read/write).
• Views → Templates (“templates/”) or JSON responses.
• Browser renders returned HTML or JS-driven UI updates.
• Admin users interact via /admin URLs, same flow.
Architectural Patterns
• MVC/MVT pattern: Models (API/models.py + main/models.py), Views (views.py), Templates.
• Separation of concerns:
– “main” for server-rendered front end.
– “API” for AJAX/REST calls.
• Static asset pipeline: CSS/JS under “static/” served directly by Django or a CDN.
Final Checklist
• Callouts for key frameworks (Django, Gunicorn, SQLite).
• Optional production layers (Nginx, CDN) even if not yet implemented.