# aditya-1123/full-fledged-online-examination-system architecture

> Architecture diagram of the GitHub repository aditya-1123/full-fledged-online-examination-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aditya-1123/full-fledged-online-examination-system
- Repository: https://github.com/aditya-1123/full-fledged-online-examination-system

## Overview

##### Project Type and Purpose
- This is a full-stack web application, specifically an Online Examination System built with Python and Django.
- It provides three user-facing domains (Student, Teacher, Admin) plus shared “exam” management logic.
- Data persistence is handled by SQLite; front-end rendering by Django templates (HTML/CSS/Bootstrap).

##### High-Level Architecture & File-Structure Analysis
- Top-level “onlinexam” folder: the Django project root containing settings.py, URL dispatcher, WSGI/ASGI entry points.
- Three Django apps under root:
- exam/    ← shared exam-management models, views, forms, admin hooks
- student/ ← student-specific URL routes, views, forms, templates
- teacher/ ← teacher-specific routes, views, forms, templates
- templates/ folder: grouped subfolders for exam/, student/, teacher/ – holds HTML templates.
- static/ folder: images, profile pics, CSS, JS (if any) served as static assets.
- db.sqlite3: single-file relational database.
- manage.py: CLI entry to runserver, migrations, shell, etc.

##### Core Components
a. Clients (Browser)
- Student UI
- Teacher UI
- Admin UI (leveraging Django’s built-in admin or custom admin templates)
b. Web Server & Request Pipeline
- Django WSGI/ASGI server (e.g., Gunicorn/Uvicorn + Nginx in production)
- URL Dispatcher → app-specific routers (student.urls, teacher.urls, exam/views, onlinexam/urls)
- View logic (class- and function-based views in each app)
c. Business Logic Layer (Django Apps)
- exam app: Models for Course, Question, Result; Forms for question creation/test taking; Views for admin workflows
- student app: Models (Student profile extension), Views for exam participation, result viewing
- teacher app: Models (Teacher profile extension), Views for question/exam creation, salary requests
d. Data Layer
- SQLite database with tables auto-generated from models and migrations
- Migrations subfolders to show schema evolution
e. Static/Template Layer
- Template engine rendering HTML + Bootstrap
- Static files served by Django’s staticfiles module (or CDN/webserver)

##### Relationships & Data Flows
- User (Student/Teacher/Admin) → HTTP(S) Request → Nginx (optional) → Gunicorn/Uvicorn → Django WSGI/ASGI
- Django → URL router (onlinexam/urls.py) → Dispatch to student.urls / teacher.urls / exam.views → View
- View → ORM call → SQLite → result set → business logic → Template context → Rendered HTML
- View POST (form submission) → Form validation → ORM write (new Question/ExamAttempt/Result) → Redirect/JSON response
- Static asset request → Django staticfiles (or webserver) → Browser

##### Architectural Patterns & Design Principles
- MVC (Model-View-Template) / MVT (Django variant) separation of concerns
- Modularization by domain: three Django apps for clear code ownership
- Reuse: “exam” app houses shared exam business logic; student & teacher apps import and extend the same models/forms
- Declarative URL configuration promotes loose coupling between endpoints and handlers
- Use of migrations ensures versioned, repeatable schema changes

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer (Blue)
    subgraph "Presentation Layer" 
        direction TB
        Browser_Student["Student UI"]:::presentation
        Browser_Teacher["Teacher UI"]:::presentation
        Browser_Admin["Admin UI"]:::presentation
        Templates["Django Templates"]:::presentation
        Static["Static Assets (/static/)"]:::presentation
    end

    %% Application Layer (Green)
    subgraph "Application Layer"
        direction TB
        WebServer["Nginx + Gunicorn/Uvicorn"]:::application
        subgraph "Django Project: onlinexam"
            direction TB
            Settings["settings.py"]:::application
            URLConf["urls.py"]:::application
            ASGI["asgi.py"]:::application
            WSGI["wsgi.py"]:::application
            Requirements["requirements.txt"]:::application
        end

        subgraph "App: exam (Shared Business Logic)"
            direction TB
            ExamModels["models.py"]:::application
            ExamViews["views.py"]:::application
            ExamForms["forms.py"]:::application
            ExamAdmin["admin.py"]:::application
            ExamMigrations["migrations/"]:::application
        end

        subgraph "App: student (Student Domain)"
            direction TB
            StudentModels["models.py"]:::application
            StudentViews["views.py"]:::application
            StudentForms["forms.py"]:::application
            StudentURLs["urls.py"]:::application
            StudentAdmin["admin.py"]:::application
            StudentMigrations["migrations/"]:::application
        end

        subgraph "App: teacher (Teacher Domain)"
            direction TB
            TeacherModels["models.py"]:::application
            TeacherViews["views.py"]:::application
            TeacherForms["forms.py"]:::application
            TeacherURLs["urls.py"]:::application
            TeacherAdmin["admin.py"]:::application
            TeacherMigrations["migrations/"]:::application
        end

        subgraph "Project Info Docs"
            direction TB
            InfoExam["exam/01 PROJECT INFO.txt"]:::application
            InfoRoot["onlinexam/01 PROJECT INFO.txt"]:::application
            InfoStudent["student/01 PROJECT INFO.txt"]:::application
            InfoTeacher["teacher/01 PROJECT INFO.txt"]:::application
            InfoTemplates["templates/01 PROJECT INFO.txt"]:::application
        end
    end

    %% Data Layer (Orange)
    subgraph "Data Layer"
        direction TB
        ORM["Django ORM"]:::data
        SQLiteDB["db.sqlite3"]:::data
    end

    %% Connections
    Browser_Student -->|"HTTP Request"| WebServer
    Browser_Teacher -->|"HTTP Request"| WebServer
    Browser_Admin -->|"HTTP Request"| WebServer

    WebServer -->|"WSGI/ASGI"| Settings
    Settings --> URLConf
    URLConf --> StudentURLs
    URLConf --> TeacherURLs
    URLConf --> ExamViews

    StudentURLs --> StudentViews
    TeacherURLs --> TeacherViews

    StudentViews -->|"uses"| ExamModels
    TeacherViews -->|"uses"| ExamModels
    ExamViews -->|"uses"| ExamModels

    StudentViews -->|"ORM Query/Write"| ORM
    TeacherViews -->|"ORM Query/Write"| ORM
    ExamViews -->|"ORM Query/Write"| ORM

    ORM --> SQLiteDB

    ExamModels --> ExamMigrations
    StudentModels --> StudentMigrations
    TeacherModels --> TeacherMigrations

    Templates --> StudentViews
    Templates --> TeacherViews
    Templates --> ExamViews
    Static --> Browser_Student
    Static --> Browser_Teacher
    Static --> Browser_Admin

    Requirements --> Settings

    %% Click Events
    click Settings "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/onlinexam/settings.py"
    click URLConf "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/onlinexam/urls.py"
    click ASGI "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/onlinexam/asgi.py"
    click WSGI "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/onlinexam/wsgi.py"
    click ExamModels "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/exam/models.py"
    click ExamViews "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/exam/views.py"
    click ExamForms "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/exam/forms.py"
    click ExamAdmin "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/exam/admin.py"
    click ExamMigrations "https://github.com/aditya-1123/full-fledged-online-examination-system/tree/main/exam/migrations/"
    click StudentModels "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/student/models.py"
    click StudentViews "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/student/views.py"
    click StudentForms "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/student/forms.py"
    click StudentURLs "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/student/urls.py"
    click StudentAdmin "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/student/admin.py"
    click StudentMigrations "https://github.com/aditya-1123/full-fledged-online-examination-system/tree/main/student/migrations/"
    click TeacherModels "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/teacher/models.py"
    click TeacherViews "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/teacher/views.py"
    click TeacherForms "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/teacher/forms.py"
    click TeacherURLs "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/teacher/urls.py"
    click TeacherAdmin "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/teacher/admin.py"
    click TeacherMigrations "https://github.com/aditya-1123/full-fledged-online-examination-system/tree/main/teacher/migrations/"
    click InfoExam "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/exam/01 PROJECT INFO.txt"
    click InfoRoot "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/onlinexam/01 PROJECT INFO.txt"
    click InfoStudent "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/student/01 PROJECT INFO.txt"
    click InfoTeacher "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/teacher/01 PROJECT INFO.txt"
    click InfoTemplates "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/templates/01 PROJECT INFO.txt"
    click Requirements "https://github.com/aditya-1123/full-fledged-online-examination-system/blob/main/requirements.txt"

    %% Styles
    classDef presentation fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef application fill:#d4edda,stroke:#333,stroke-width:1px
    classDef data fill:#fff3cd,stroke:#333,stroke-width:1px
```
