# nagarjuna2997/adms_project architecture

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

- Interactive diagram: https://gitdiagram.com/nagarjuna2997/adms_project
- Repository: https://github.com/nagarjuna2997/adms_project

## Overview

##### Project type and purpose
- From the file tree and the bare-bones README, this is a monolithic full-stack web application built with Python/Flask.
- It provides role-based dashboards and CRUD operations for an educational administration system (students, teachers, admins).

##### File structure
- Top-level Python scripts (app.py, models.py, migrations.py, init_db.py, create_tables.py, etc.) drive the server logic and database setup.
- The “templates” directory holds Jinja2 HTML views for admin, teacher, and student pages—following an MVC-style organization.
- The “static” directory contains CSS for styling.
- SQLite database files live under “instance/” (GAMS_database.db, school.db, etc.).
- Utility scripts (clean_db.py, delete_data.py, reset_db.py, update_db.py) handle data lifecycle and migrations.

##### README
- Although minimal, the naming (“Adms_project”) and the structure confirm an Admin-Dashboard Management System for a school-like environment.

a. Main components
- Web Browser (Client UI)
- Flask Web Server (app.py + routes)
- MVC Layers inside Flask:
– Controllers (Flask route handlers in app.py)
– Models (models.py + SQLAlchemy or raw SQLite calls)
– Views (Jinja2 templates in “templates/”)
- Static Assets (CSS under “static/css/”)
- SQLite Database (instance/*.db)
- Utility Scripts (DB setup & migration tools)

b. Relationships & interactions
1. User (admin/teacher/student) issues HTTP request from browser →
2. Flask routes in app.py receive request →
3. Controllers invoke Models to query/update SQLite DB →
4. Data returned to Controller →
5. Controller renders a Jinja2 template with the data →
6. Response (HTML + CSS) sent back to Browser

Utility scripts (create_tables.py, migrations.py, reset_db.py) run offline or as part of deployment to set up or migrate the database schema.

c. Architectural patterns/design principles
- MVC (Model-View-Controller) pattern
- Layered separation: Presentation (templates/static), Application Logic (Flask), Data Layer (SQLite models)
- Single code base (monolith) with modular directory separation

d. Key technologies/frameworks
– Python 3 + Flask web framework
– Jinja2 templating engine
– SQLite for persistent storage
– CSS for styling
– Standard Python scripts for DB migrations & maintenance

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["Web Browser"]:::frontend
        subgraph "Static Assets"
            direction TB
            StyleCSS["style.css"]:::frontend
        end
        subgraph "Views (Templates)"
            direction TB
            AdminDash["admin_dashboard.html"]:::frontend
            AdminPending["admin_pending_approvals.html"]:::frontend
            StudentDash["student_dashboard.html"]:::frontend
            StudentAttend["student_attendance.html"]:::frontend
            StudentGrades["student_grades.html"]:::frontend
            StudentRegister["student_register.html"]:::frontend
            TeacherDash["teacher_dashboard.html"]:::frontend
            TeacherAttend["teacher_attendance.html"]:::frontend
            TeacherCategories["teacher_grade_categories.html"]:::frontend
            TeacherGrades["teacher_grades.html"]:::frontend
            TeacherRegister["teacher_register.html"]:::frontend
            BaseTmpl["base.html"]:::frontend
            IndexTmpl["index.html"]:::frontend
            LoginTmpl["login.html"]:::frontend
        end
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        subgraph "Flask Application"
            direction TB
            App["app.py\n(Controllers)"]:::backend
            Models["models.py"]:::backend
        end
    end

    %% Database Layer
    subgraph "Database Layer"
        direction TB
        DB1["GAMS_database.db"]:::persistence
        DB2["school.db"]:::persistence
        DB3["school_new.db"]:::persistence
    end

    %% Utility Scripts
    subgraph "Utility Scripts"
        direction TB
        CreateTables["create_tables.py"]:::utility
        InitDB["init_db.py"]:::utility
        SetupDB["setup_database.py"]:::utility
        Migrations["migrations.py"]:::utility
        ResetDB["reset_db.py"]:::utility
        UpdateDB["update_db.py"]:::utility
        CleanDB["clean_db.py"]:::utility
        DeleteData["delete_data.py"]:::utility
        ViewDB["view_db.py"]:::utility
        TestDB["test_db.py"]:::utility
    end

    %% Connections
    Browser -->|"HTTP GET/POST"| App
    App -->|"uses ORM/SQL"| Models
    Models -->|"SQL queries"| DB1
    Models -->|"SQL queries"| DB2
    Models -->|"SQL queries"| DB3
    App -->|"renders"| AdminDash
    App -->|"renders"| AdminPending
    App -->|"renders"| StudentDash
    App -->|"renders"| StudentAttend
    App -->|"renders"| StudentGrades
    App -->|"renders"| StudentRegister
    App -->|"renders"| TeacherDash
    App -->|"renders"| TeacherAttend
    App -->|"renders"| TeacherCategories
    App -->|"renders"| TeacherGrades
    App -->|"renders"| TeacherRegister
    App -->|"renders"| BaseTmpl
    App -->|"renders"| IndexTmpl
    App -->|"renders"| LoginTmpl
    StyleCSS -->|"served with"| Browser

    CreateTables -->|"schema setup"| DB1
    InitDB -->|"initialization"| DB1
    SetupDB -->|"database setup"| DB1
    Migrations -->|"migrations"| DB1
    ResetDB -->|"reset"| DB1
    UpdateDB -->|"update schema"| DB1
    CleanDB -->|"cleanup"| DB1
    DeleteData -->|"delete records"| DB1
    ViewDB -->|"view data"| DB1
    TestDB -->|"test DB"| DB1

    %% Click Events
    click StyleCSS "https://github.com/nagarjuna2997/adms_project/blob/main/static/css/style.css"
    click AdminDash "https://github.com/nagarjuna2997/adms_project/blob/main/templates/admin_dashboard.html"
    click AdminPending "https://github.com/nagarjuna2997/adms_project/blob/main/templates/admin_pending_approvals.html"
    click StudentDash "https://github.com/nagarjuna2997/adms_project/blob/main/templates/student_dashboard.html"
    click StudentAttend "https://github.com/nagarjuna2997/adms_project/blob/main/templates/student_attendance.html"
    click StudentGrades "https://github.com/nagarjuna2997/adms_project/blob/main/templates/student_grades.html"
    click StudentRegister "https://github.com/nagarjuna2997/adms_project/blob/main/templates/student_register.html"
    click TeacherDash "https://github.com/nagarjuna2997/adms_project/blob/main/templates/teacher_dashboard.html"
    click TeacherAttend "https://github.com/nagarjuna2997/adms_project/blob/main/templates/teacher_attendance.html"
    click TeacherCategories "https://github.com/nagarjuna2997/adms_project/blob/main/templates/teacher_grade_categories.html"
    click TeacherGrades "https://github.com/nagarjuna2997/adms_project/blob/main/templates/teacher_grades.html"
    click TeacherRegister "https://github.com/nagarjuna2997/adms_project/blob/main/templates/teacher_register.html"
    click BaseTmpl "https://github.com/nagarjuna2997/adms_project/blob/main/templates/base.html"
    click IndexTmpl "https://github.com/nagarjuna2997/adms_project/blob/main/templates/index.html"
    click LoginTmpl "https://github.com/nagarjuna2997/adms_project/blob/main/templates/login.html"
    click App "https://github.com/nagarjuna2997/adms_project/blob/main/app.py"
    click Models "https://github.com/nagarjuna2997/adms_project/blob/main/models.py"
    click DB1 "https://github.com/nagarjuna2997/adms_project/blob/main/instance/GAMS_database.db"
    click DB2 "https://github.com/nagarjuna2997/adms_project/blob/main/instance/school.db"
    click DB3 "https://github.com/nagarjuna2997/adms_project/blob/main/instance/school_new.db"
    click CreateTables "https://github.com/nagarjuna2997/adms_project/blob/main/create_tables.py"
    click InitDB "https://github.com/nagarjuna2997/adms_project/blob/main/init_db.py"
    click SetupDB "https://github.com/nagarjuna2997/adms_project/blob/main/setup_database.py"
    click Migrations "https://github.com/nagarjuna2997/adms_project/blob/main/migrations.py"
    click ResetDB "https://github.com/nagarjuna2997/adms_project/blob/main/reset_db.py"
    click UpdateDB "https://github.com/nagarjuna2997/adms_project/blob/main/update_db.py"
    click CleanDB "https://github.com/nagarjuna2997/adms_project/blob/main/clean_db.py"
    click DeleteData "https://github.com/nagarjuna2997/adms_project/blob/main/delete_data.py"
    click ViewDB "https://github.com/nagarjuna2997/adms_project/blob/main/view_db.py"
    click TestDB "https://github.com/nagarjuna2997/adms_project/blob/main/test_db.py"

    %% Styles
    classDef frontend fill:#85C1E9,stroke:#333,stroke-width:1px
    classDef backend fill:#82E0AA,stroke:#333,stroke-width:1px
    classDef persistence fill:#F5B041,stroke:#333,stroke-width:1px
    classDef utility fill:#D7DBDD,stroke:#333,stroke-width:1px
```
