# phurhard/schoolportal architecture

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

- Interactive diagram: https://gitdiagram.com/phurhard/schoolportal
- Repository: https://github.com/phurhard/schoolportal

## Overview

School Portal is an early-stage Django school-management application. Its main workflow is account registration and login, followed by student subject selection and access to results or teacher entry of continuous-assessment scores; the README describes PDF result output as a capability. The model layer defines users, classes, subjects and assessments. Edges reflect the sampled views, forms, models and URL declarations; unsampled wiring and behaviors are not inferred.

Main entry points: [`main/models.py`](https://github.com/phurhard/schoolportal/blob/dev/main/models.py) (School domain models), [`Authentication/views.py`](https://github.com/phurhard/schoolportal/blob/dev/Authentication/views.py) (Account workflows), [`Student/views.py`](https://github.com/phurhard/schoolportal/blob/dev/Student/views.py) (Student workflows), [`Staff/views.py`](https://github.com/phurhard/schoolportal/blob/dev/Staff/views.py) (Teacher workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts"]
  node_auth_routes["Account routes<br/>[urls.py]"]
  node_auth_views["Account workflows<br/>[views.py]"]
  node_auth_forms["Account forms<br/>[forms.py]"]
  node_reg_number["Registration number"]
end

subgraph group_school["School data"]
  node_school_models["School domain models<br/>[models.py]"]
  node_database[("Application database")]
  node_main_routes["Portal routes<br/>[urls.py]"]
  node_main_views["Public school views<br/>[views.py]"]
end

subgraph group_learner["Student portal"]
  node_student_routes["Student routes<br/>[urls.py]"]
  node_student_views["Student workflows<br/>[views.py]"]
  node_subject_serializer["Subject serializer<br/>[serializers.py]"]
  node_pdf_renderer["PDF rendering library"]
end

subgraph group_staff["Teacher portal"]
  node_staff_routes["Staff routes<br/>[urls.py]"]
  node_staff_views["Teacher workflows<br/>[views.py]"]
  node_teacher_guard["Teacher access guard<br/>[decorators.py]"]
end

node_visitor(("Portal user"))

node_visitor -->|"requests account"| node_auth_routes
node_auth_routes -->|"dispatches"| node_auth_views
node_auth_views -->|"validates forms"| node_auth_forms
node_auth_views -->|"generates identifier"| node_reg_number
node_auth_views -->|"reads and saves"| node_school_models
node_visitor -->|"requests portal"| node_main_routes
node_main_routes -->|"dispatches"| node_main_views
node_main_views -->|"queries records"| node_school_models
node_visitor -->|"requests student pages"| node_student_routes
node_student_routes -->|"dispatches"| node_student_views
node_student_views -->|"reads and updates"| node_school_models
node_student_views -->|"serializes subjects"| node_subject_serializer
node_student_views -->|"renders result PDF"| node_pdf_renderer
node_visitor -->|"requests staff pages"| node_staff_routes
node_staff_routes -->|"dispatches"| node_staff_views
node_staff_views -->|"guards teacher views"| node_teacher_guard
node_staff_views -->|"reads and updates scores"| node_school_models
node_school_models -.->|"defines persisted data"| node_database

click node_auth_routes "https://github.com/phurhard/schoolportal/blob/dev/Authentication/urls.py"
click node_auth_views "https://github.com/phurhard/schoolportal/blob/dev/Authentication/views.py"
click node_auth_forms "https://github.com/phurhard/schoolportal/blob/dev/Authentication/forms.py"
click node_reg_number "https://github.com/phurhard/schoolportal/blob/dev/Authentication/matric_no_generator.py"
click node_school_models "https://github.com/phurhard/schoolportal/blob/dev/main/models.py"
click node_main_routes "https://github.com/phurhard/schoolportal/blob/dev/main/urls.py"
click node_main_views "https://github.com/phurhard/schoolportal/blob/dev/main/views.py"
click node_student_routes "https://github.com/phurhard/schoolportal/blob/dev/Student/urls.py"
click node_student_views "https://github.com/phurhard/schoolportal/blob/dev/Student/views.py"
click node_subject_serializer "https://github.com/phurhard/schoolportal/blob/dev/Student/serializers.py"
click node_staff_routes "https://github.com/phurhard/schoolportal/blob/dev/Staff/urls.py"
click node_staff_views "https://github.com/phurhard/schoolportal/blob/dev/Staff/views.py"
click node_teacher_guard "https://github.com/phurhard/schoolportal/blob/dev/Staff/decorators.py"

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_auth_routes,node_auth_views,node_auth_forms,node_reg_number,node_visitor toneBlue
class node_school_models,node_database,node_main_routes,node_main_views toneAmber
class node_student_routes,node_student_views,node_subject_serializer,node_pdf_renderer toneMint
class node_staff_routes,node_staff_views,node_teacher_guard toneRose
```

## Components

### Accounts

- [Account routes](https://github.com/phurhard/schoolportal/blob/dev/Authentication/urls.py): `Authentication/urls.py`
- [Account workflows](https://github.com/phurhard/schoolportal/blob/dev/Authentication/views.py): `Authentication/views.py`
- [Account forms](https://github.com/phurhard/schoolportal/blob/dev/Authentication/forms.py): `Authentication/forms.py`
- [Registration number](https://github.com/phurhard/schoolportal/blob/dev/Authentication/matric_no_generator.py): `Authentication/matric_no_generator.py`

### School data

- [School domain models](https://github.com/phurhard/schoolportal/blob/dev/main/models.py): `main/models.py`
- **Application database**
- [Portal routes](https://github.com/phurhard/schoolportal/blob/dev/main/urls.py): `main/urls.py`
- [Public school views](https://github.com/phurhard/schoolportal/blob/dev/main/views.py): `main/views.py`

### Student portal

- [Student routes](https://github.com/phurhard/schoolportal/blob/dev/Student/urls.py): `Student/urls.py`
- [Student workflows](https://github.com/phurhard/schoolportal/blob/dev/Student/views.py): `Student/views.py`
- [Subject serializer](https://github.com/phurhard/schoolportal/blob/dev/Student/serializers.py): `Student/serializers.py`
- **PDF rendering library**

### Teacher portal

- [Staff routes](https://github.com/phurhard/schoolportal/blob/dev/Staff/urls.py): `Staff/urls.py`
- [Teacher workflows](https://github.com/phurhard/schoolportal/blob/dev/Staff/views.py): `Staff/views.py`
- [Teacher access guard](https://github.com/phurhard/schoolportal/blob/dev/Staff/decorators.py): `Staff/decorators.py`

### Other components

- **Portal user**

## Connections

- Portal user → Account routes: requests account (evidence: `Authentication/urls.py`)
- Account routes → Account workflows: dispatches (evidence: `Authentication/urls.py`)
- Account workflows → Account forms: validates forms (evidence: `Authentication/views.py`)
- Account workflows → Registration number: generates identifier (evidence: `Authentication/views.py`)
- Account workflows → School domain models: reads and saves (evidence: `Authentication/views.py`)
- Portal user → Portal routes: requests portal (evidence: `main/urls.py`)
- Portal routes → Public school views: dispatches (evidence: `main/urls.py`)
- Public school views → School domain models: queries records (evidence: `main/views.py`)
- Portal user → Student routes: requests student pages (evidence: `Student/urls.py`)
- Student routes → Student workflows: dispatches (evidence: `Student/urls.py`)
- Student workflows → School domain models: reads and updates (evidence: `Student/views.py`)
- Student workflows → Subject serializer: serializes subjects (evidence: `Student/views.py`)
- Student workflows → PDF rendering library: renders result PDF (evidence: `Student/views.py`)
- Portal user → Staff routes: requests staff pages (evidence: `Staff/urls.py`)
- Staff routes → Teacher workflows: dispatches (evidence: `Staff/urls.py`)
- Teacher workflows → Teacher access guard: guards teacher views (evidence: `Staff/views.py`)
- Teacher workflows → School domain models: reads and updates scores (evidence: `Staff/views.py`)
- School domain models → Application database: defines persisted data
