# chandrima0503/secureskyscholars architecture

> Architecture diagram of the GitHub repository chandrima0503/secureskyscholars, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chandrima0503/secureskyscholars
- Repository: https://github.com/chandrima0503/secureskyscholars

## Overview

##### Project type and purpose
- SecureSkyScholars is a full-stack web application built in Django.
- Purpose: Manage students, staff, courses, attendance, feedback, notifications and live classrooms.
- Key indicators:
- `student_management_system` (Django project)
- `students_app` (business logic, models, views, templates)
- MySQL configured in `settings.py`
- Static assets (AdminLTE, Chart.js, Socket.io, etc.)

##### File structure
- Top-level directories & files:
- `student_management_system/` – Django project settings, URL routing, ASGI/WSGI.
- `students_app/` – custom Django app: models, views (admin, staff, student), middleware, management commands, email backend.
- `templates/` (under students_app) – separate areas for admin, staff, student pages; signup & registration.
- `staticfiles/` & `students_app/static/` – pre-collected and versioned frontend assets: AdminLTE theme, plugins, Socket.io client, charting libraries.
- `Procfile` – Heroku deployment.
- `.github/workflows/django.yml` – CI pipeline.

##### README for additional insights
- MySQL database as primary persistence.
- CI via GitHub Actions; automatic build & test.
- Deployment target: local dev server and Heroku (Procfile).

##### Main components
a. Clients (web browsers) with three personas: Admin, Staff, Student
b. Reverse proxy / Load balancer (Heroku router or Nginx)
c. Django Application Server (Gunicorn via WSGI/ASGI)
– Core: `student_management_system` + `students_app`
– Middleware: `LoginCheckMiddleware`, Django’s auth, email backend
d. Static Asset Store / CDN
– AdminLTE, JS/CSS, Socket.io client, charting libs, etc.
e. MySQL Database
– Schema generated by Django migrations (models in `students_app/models.py`)
f. External services
– SMTP Email Service (used by `backend_email.py`)
– (Optional) Real-time subsystem or video conferencing service (Socket.io)
g. CI/CD Pipeline
– GitHub Actions → run tests → deploy to Heroku

##### Relationships & data flows
- Browser → HTTP(S) → Load Balancer (Heroku) → Django Server
- Django Server
- Serves dynamic pages via template engine (templates/*.html)
- Serves or redirects static file requests to Asset Store/CDN
- Reads/writes data to MySQL via Django ORM
- Sends emails via SMTP backend
- (If implemented) opens WebSocket/Socket.io channel for live classroom interactions
- GitHub Actions commits → build & test → deploy to Heroku (automatic)

##### Architectural patterns & design principles
- MVC (Django’s MTV):
- Models layer in `students_app/models.py`
- Templates in `students_app/templates/…`
- Views in `views.py`, `views_admin.py`, `views_staff.py`, `views_student.py`
- Separation of concerns:
- Authentication & role-based pages (admin vs. staff vs. student)
- Static asset bundling vs. dynamic content
- Custom middleware for login checks
- Twelve-factor app ready:
- `Procfile` for process declaration
- Config in `settings.py` from environment

##### Detail & essential elements
- Major static plugins as one grouped “AdminLTE & JS Plugins” node.
- Database migrations via management command `runmigrations`.
- Environment variables (DB credentials) loaded in `settings.py`.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Users Layer
    subgraph "Users"
        direction TB
        AdminBrowser["Admin Browser"]:::client
        StaffBrowser["Staff Browser"]:::client
        StudentBrowser["Student Browser"]:::client
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline" 
        direction TB
        GitHubActions["GitHub Actions CI"]:::cicd
        HerokuDeploy["Heroku Deployment"]:::cicd
    end

    %% Web Tier
    LoadBalancer["Load Balancer / Heroku Router"]:::web

    %% Application Tier
    subgraph "Django App Server (Gunicorn + WSGI)" 
        direction TB
        subgraph "Project Configuration & Entry Points"
            direction TB
            SettingsPy["settings.py"]:::backend
            UrlsPy["urls.py"]:::backend
            AsgiPy["asgi.py"]:::backend
            WsgiPy["wsgi.py"]:::backend
            ManagePy["manage.py"]:::backend
        end
        subgraph "Business Logic & MVC App"
            direction TB
            ModelsPy["models.py"]:::backend
            ViewsPy["views.py"]:::backend
            ViewsAdminPy["views_admin.py"]:::backend
            ViewsStaffPy["views_staff.py"]:::backend
            ViewsStudentPy["views_student.py"]:::backend
            FormsPy["forms.py"]:::backend
            AdminPy["admin.py"]:::backend
            AppsPy["apps.py"]:::backend
        end
        LoginMiddleware["LoginCheckMiddleWare.py"]:::backend
        EmailBackend["backend_email.py"]:::backend
        MigrationsCmd["runmigrations.py"]:::backend
        TemplatesDir["templates/"]:::backend
        TestsPy["tests.py"]:::backend
    end

    %% Data Tier
    MySQLDB["MySQL Database"]:::database

    %% Static Asset Store
    StaticStore["Static Asset Store / CDN"]:::external

    %% External Services
    SMTPService["SMTP Email Service"]:::external
    RealtimeService["Real-time / Socket.io Server"]:::external

    %% Connections: Users to Load Balancer
    AdminBrowser -->|"HTTP(S) requests"| LoadBalancer
    StaffBrowser -->|"HTTP(S) requests"| LoadBalancer
    StudentBrowser -->|"HTTP(S) requests"| LoadBalancer

    %% CI/CD Connections
    GitHubActions -->|"build & test"| HerokuDeploy
    HerokuDeploy -->|"deploy"| LoadBalancer

    %% Load Balancer to App Server
    LoadBalancer -->|"forward requests"| SettingsPy

    %% App Server internal flows
    SettingsPy -->|includes URLs| UrlsPy
    UrlsPy -->|routes to views| ViewsPy
    UrlsPy -->|routes to admin| ViewsAdminPy
    UrlsPy -->|routes to staff| ViewsStaffPy
    UrlsPy -->|routes to student| ViewsStudentPy
    ViewsPy -->|"renders"| TemplatesDir
    ViewsAdminPy -->|"accesses"| ModelsPy
    ViewsStaffPy -->|"accesses"| ModelsPy
    ViewsStudentPy -->|"accesses"| ModelsPy
    ModelsPy -->|"ORM queries"| MySQLDB
    LoginMiddleware -->|"auth check"| ViewsPy
    EmailBackend -->|"SMTP send"| SMTPService
    MigrationsCmd -->|"runs migrations"| MySQLDB
    TemplatesDir -->|"static refs"| StaticStore
    ViewsPy -->|"opens socket"| RealtimeService
    TestsPy -->|"unit tests"| ModelsPy

    %% App Server to external resources
    SettingsPy -->|"loads static URLs"| StaticStore
    SettingsPy -->|"loads env vars"| SettingsPy

    %% App Server to Data Tier
    SettingsPy --> MySQLDB

    %% App Server to External Services
    SettingsPy --> SMTPService
    SettingsPy --> RealtimeService

    %% Styles
    classDef client fill:#b2f5bf,stroke:#2f855a,color:#22543d;
    classDef web fill:#bee3f8,stroke:#2b6cb0,color:#2c5282;
    classDef backend fill:#ebf8ff,stroke:#3182ce,color:#2a4365;
    classDef database fill:#fefcbf,stroke:#d69e2e,color:#975a16,stroke-width:2px;
    classDef external fill:#e2e8f0,stroke:#4a5568,color:#1a202c;
    classDef cicd fill:#faf5ff,stroke:#9f7aea,color:#553c9a,stroke-dasharray: 5 5;

    %% Click Events
    click SettingsPy "https://github.com/chandrima0503/secureskyscholars/blob/main/student_management_system/settings.py"
    click UrlsPy "https://github.com/chandrima0503/secureskyscholars/blob/main/student_management_system/urls.py"
    click AsgiPy "https://github.com/chandrima0503/secureskyscholars/blob/main/student_management_system/asgi.py"
    click WsgiPy "https://github.com/chandrima0503/secureskyscholars/blob/main/student_management_system/wsgi.py"
    click ManagePy "https://github.com/chandrima0503/secureskyscholars/blob/main/manage.py"

    click ModelsPy "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/models.py"
    click ViewsPy "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/views.py"
    click ViewsAdminPy "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/views_admin.py"
    click ViewsStaffPy "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/views_staff.py"
    click ViewsStudentPy "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/views_student.py"
    click FormsPy "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/forms.py"
    click AdminPy "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/admin.py"
    click AppsPy "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/apps.py"

    click LoginMiddleware "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/LoginCheckMiddleWare.py"
    click EmailBackend "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/backend_email.py"
    click MigrationsCmd "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/management/commands/runmigrations.py"
    click TemplatesDir "https://github.com/chandrima0503/secureskyscholars/tree/main/students_app/templates/"
    click TestsPy "https://github.com/chandrima0503/secureskyscholars/blob/main/students_app/tests.py"

    click StaticStore "https://github.com/chandrima0503/secureskyscholars/tree/main/staticfiles/"
    click StaticStore "https://github.com/chandrima0503/secureskyscholars/tree/main/students_app/static/"
    click GitHubActions "https://github.com/chandrima0503/secureskyscholars/blob/main/.github/workflows/django.yml"
    click HerokuDeploy "https://github.com/chandrima0503/secureskyscholars/tree/main/Procfile"
```
