# mehmet4406/cuny-student-portal architecture

> Architecture diagram of the GitHub repository mehmet4406/cuny-student-portal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mehmet4406/cuny-student-portal
- Repository: https://github.com/mehmet4406/cuny-student-portal

## Overview

#### Purpose and entry points
This is a Django student portal for authentication, student profiles, course browsing, semester selection, and enrollment. HTTP entry points are routed through `config/urls.py` into app routes in `portal/urls.py`; request behavior is implemented in `portal/views.py`. Deployment can use either `config/wsgi.py` or `config/asgi.py`.

#### Django project boundary
`config/settings.py` defines the project runtime, installed applications, middleware, templates, database, and authentication-related settings. `manage.py` is the operational entry point for development server, migrations, and admin commands. The `portal` package is the primary Django application.

#### Domain model and persistence
The relational domain is centered in `portal/models.py`, with migration history in `portal/migrations/0001_initial.py` through `portal/migrations/0009_academicdepartment_remove_course_capacity_and_more.py`. The evolving model includes students/student profiles, majors, courses, semesters, sections, enrollments, and academic departments. Django ORM forms the persistence boundary between portal workflows and the configured database.

#### User identity and student profile flow
Authentication and registration are handled by views and forms in `portal/views.py` and `portal/forms.py`, rendered through `portal/templates/portal/login.html` and `portal/templates/portal/signup.html`. Authenticated users proceed to dashboard/profile functionality, with student-specific state represented by the model layer and displayed in `portal/templates/portal/dashboard.html` and `portal/templates/portal/student_profile.html`.

#### Academic selection and enrollment flow
Course and semester selection are distinct UI stages: `portal/templates/portal/select_semester.html` establishes the academic term, while `portal/templates/portal/select_courses.html` supports course/section choices. `portal/views.py` coordinates these requests against `portal/models.py`, where enrollment and section entities provide the transactional boundary for a student’s selections. Course presentation is also exposed through `portal/templates/portal/courses.html`.

#### Presentation and administration
Server-rendered Django templates live under `portal/templates/portal/`, with `portal/templates/portal/home.html` acting as a public/home surface. Administrative management is registered in `portal/admin.py` and exposed through Django’s admin infrastructure configured by `config/urls.py`; this is the operational interface for managing academic records.

#### Legacy or standalone data utilities
Root-level modules `main.py`, `data_manager.py`, `courses.py`, `student.py`, `admin.py`, and `utils.py`, plus JSON files in `data/`, suggest a separate file-backed or earlier command-line data-management layer. Its data boundary is `data/courses.json`, `data/students.json`, and `data/admins.json`; it should be treated as separate from the Django ORM unless explicitly integrated.

Main entry points: [`config/settings.py`](https://github.com/mehmet4406/cuny-student-portal/blob/main/config/settings.py) (Runtime settings), [`portal/views.py`](https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/views.py) (Portal workflows), [`portal/models.py`](https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/models.py) (Academic domain), [`config/urls.py`](https://github.com/mehmet4406/cuny-student-portal/blob/main/config/urls.py) (Project routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_django["Django project"]
  node_manage{{"Management CLI<br/>Django command entry<br/>[manage.py]"}}
  node_settings["Runtime settings<br/>Django settings<br/>[settings.py]"]
  node_urls["Project routes<br/>URL router<br/>[urls.py]"]
  node_wsgi["WSGI deployment<br/>WSGI entry<br/>[wsgi.py]"]
  node_asgi["ASGI deployment<br/>ASGI entry<br/>[asgi.py]"]
  node_database[("Configured database<br/>Relational database")]
end

subgraph group_portal["Student portal"]
  node_portal_urls["Portal routes<br/>URL router<br/>[urls.py]"]
  node_views["Portal workflows<br/>Django views<br/>[views.py]"]
  node_forms["Auth forms<br/>Django forms<br/>[forms.py]"]
  node_models["Academic domain<br/>Django models<br/>[models.py]"]
  node_migrations["Schema history<br/>Django migrations<br/>[0001_initial.py]"]
  node_templates["Portal templates<br/>Server-rendered UI"]
  node_admin["Academic admin<br/>Django admin registration<br/>[admin.py]"]
end

subgraph group_legacy["Legacy data utilities"]
  node_legacy_cli{{"Legacy CLI layer<br/>Standalone modules<br/>[main.py]"}}
  node_legacy_data[("JSON data store<br/>File-backed data<br/>[courses.json]")]
end

node_manage -->|"loads runtime settings"| node_settings
node_wsgi -->|"loads"| node_settings
node_asgi -->|"loads"| node_settings
node_urls -->|"includes"| node_portal_urls
node_urls -->|"exposes admin"| node_admin
node_portal_urls -->|"dispatches requests"| node_views
node_views -->|"validates auth input"| node_forms
node_views -->|"reads and updates"| node_models
node_views -->|"renders"| node_templates
node_models -->|"persists through ORM"| node_database
node_migrations -->|"evolves schema"| node_database
node_admin -->|"manages records"| node_models
node_settings -.->|"configures"| node_database
node_settings -.->|"configures discovery"| node_templates
node_legacy_cli -->|"reads and writes"| node_legacy_data

click node_manage "https://github.com/mehmet4406/cuny-student-portal/blob/main/manage.py"
click node_settings "https://github.com/mehmet4406/cuny-student-portal/blob/main/config/settings.py"
click node_urls "https://github.com/mehmet4406/cuny-student-portal/blob/main/config/urls.py"
click node_wsgi "https://github.com/mehmet4406/cuny-student-portal/blob/main/config/wsgi.py"
click node_asgi "https://github.com/mehmet4406/cuny-student-portal/blob/main/config/asgi.py"
click node_portal_urls "https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/urls.py"
click node_views "https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/views.py"
click node_forms "https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/forms.py"
click node_models "https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/models.py"
click node_migrations "https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/migrations/0001_initial.py"
click node_admin "https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/admin.py"
click node_legacy_cli "https://github.com/mehmet4406/cuny-student-portal/blob/main/main.py"
click node_legacy_data "https://github.com/mehmet4406/cuny-student-portal/blob/main/data/courses.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manage,node_settings,node_urls,node_wsgi,node_asgi,node_database toneBlue
class node_portal_urls,node_views,node_forms,node_models,node_migrations,node_templates,node_admin toneAmber
class node_legacy_cli,node_legacy_data toneMint
```

## Components

### Django project

- [Management CLI](https://github.com/mehmet4406/cuny-student-portal/blob/main/manage.py): Django command entry · `manage.py`
- [Runtime settings](https://github.com/mehmet4406/cuny-student-portal/blob/main/config/settings.py): Django settings · Defines apps, middleware, templates, database, and auth settings. · `config/settings.py`
- [Project routes](https://github.com/mehmet4406/cuny-student-portal/blob/main/config/urls.py): URL router · Routes portal and admin requests. · `config/urls.py`
- [WSGI deployment](https://github.com/mehmet4406/cuny-student-portal/blob/main/config/wsgi.py): WSGI entry · `config/wsgi.py`
- [ASGI deployment](https://github.com/mehmet4406/cuny-student-portal/blob/main/config/asgi.py): ASGI entry · `config/asgi.py`
- **Configured database**: Relational database

### Student portal

- [Portal routes](https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/urls.py): URL router · `portal/urls.py`
- [Portal workflows](https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/views.py): Django views · Handles authentication, profiles, selection, and enrollment requests. · `portal/views.py`
- [Auth forms](https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/forms.py): Django forms · `portal/forms.py`
- [Academic domain](https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/models.py): Django models · Students, majors, courses, semesters, sections, enrollments, and departments. · `portal/models.py`
- [Schema history](https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/migrations/0001_initial.py): Django migrations · `portal/migrations/0001_initial.py`
- **Portal templates**: Server-rendered UI · Home, login, signup, dashboard, profile, courses, semester, and course selection screens.
- [Academic admin](https://github.com/mehmet4406/cuny-student-portal/blob/main/portal/admin.py): Django admin registration · `portal/admin.py`

### Legacy data utilities

Separate file-backed layer.

- [Legacy CLI layer](https://github.com/mehmet4406/cuny-student-portal/blob/main/main.py): Standalone modules · Earlier file-backed student and course management. · `main.py`
- [JSON data store](https://github.com/mehmet4406/cuny-student-portal/blob/main/data/courses.json): File-backed data · Courses, students, and administrator records. · `data/courses.json`

## Connections

- Management CLI → Runtime settings: loads runtime settings
- WSGI deployment → Runtime settings: loads
- ASGI deployment → Runtime settings: loads
- Project routes → Portal routes: includes
- Project routes → Academic admin: exposes admin
- Portal routes → Portal workflows: dispatches requests
- Portal workflows → Auth forms: validates auth input
- Portal workflows → Academic domain: reads and updates
- Portal workflows → Portal templates: renders
- Academic domain → Configured database: persists through ORM
- Schema history → Configured database: evolves schema
- Academic admin → Academic domain: manages records
- Runtime settings → Configured database: configures
- Runtime settings → Portal templates: configures discovery
- Legacy CLI layer → JSON data store: reads and writes
