# purohith08/ds-university-allotment architecture

> Architecture diagram of the GitHub repository purohith08/ds-university-allotment, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/purohith08/ds-university-allotment
- Repository: https://github.com/purohith08/ds-university-allotment

## Overview

This is a Flask-based university exam hall allotment application. Staff upload Excel rosters, select years, configure classrooms and exam slots, request allocations, review results, and download an Excel workbook. The sampled backend explicitly passes uploaded roster paths and allocation settings to the allocation engine; the engine reads workbook sheets and assigns students to rooms. The browser also exposes upload and clear actions. README content is absent and some source is unsampled, so unshown result-rendering and frontend request links are omitted.

Main entry points: [`main.py`](https://github.com/purohith08/ds-university-allotment/blob/master/main.py) (Flask API), [`static/js/main.js`](https://github.com/purohith08/ds-university-allotment/blob/master/static/js/main.js) (Browser interface), [`hall_allotment.py`](https://github.com/purohith08/ds-university-allotment/blob/master/hall_allotment.py) (Allotment engine), [`templates/index.html`](https://github.com/purohith08/ds-university-allotment/blob/master/templates/index.html) (Application page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_browser["Browser interface<br/>[main.js]"]
  node_page["Application page<br/>[index.html]"]
end

subgraph group_service["Flask service"]
  node_api["Flask API<br/>[main.py]"]
  node_uploads[("Uploaded rosters<br/>[main.py]")]
  node_summary["Allocation summary<br/>[main.py]"]
end

subgraph group_allocation["Allocation engine"]
  node_engine["Allotment engine<br/>[hall_allotment.py]"]
  node_roster_read["Roster parsing<br/>[hall_allotment.py]"]
  node_room_assign["Room assignment<br/>[hall_allotment.py]"]
end

subgraph group_output["Reports"]
  node_workbook["Excel workbook export<br/>[main.py]"]
end

node_staff(("Exam staff"))

node_staff -->|"uses"| node_browser
node_browser -.->|"interacts with"| node_page
node_browser -->|"uploads files"| node_api
node_browser -->|"clears data"| node_api
node_api -->|"saves rosters"| node_uploads
node_api -->|"calls allotment"| node_engine
node_engine -->|"loads workbooks"| node_roster_read
node_engine -->|"dispatches groups"| node_room_assign
node_api -->|"calculates totals"| node_summary
node_api -->|"creates export"| node_workbook
node_engine -.->|"reads roster paths"| node_uploads

click node_browser "https://github.com/purohith08/ds-university-allotment/blob/master/static/js/main.js"
click node_page "https://github.com/purohith08/ds-university-allotment/blob/master/templates/index.html"
click node_api "https://github.com/purohith08/ds-university-allotment/blob/master/main.py"
click node_uploads "https://github.com/purohith08/ds-university-allotment/blob/master/main.py"
click node_engine "https://github.com/purohith08/ds-university-allotment/blob/master/hall_allotment.py"
click node_roster_read "https://github.com/purohith08/ds-university-allotment/blob/master/hall_allotment.py"
click node_room_assign "https://github.com/purohith08/ds-university-allotment/blob/master/hall_allotment.py"
click node_summary "https://github.com/purohith08/ds-university-allotment/blob/master/main.py"
click node_workbook "https://github.com/purohith08/ds-university-allotment/blob/master/main.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_browser,node_page toneBlue
class node_api,node_uploads,node_summary toneAmber
class node_engine,node_roster_read,node_room_assign toneMint
class node_workbook toneRose
class node_staff toneIndigo
```

## Components

### Web interface

- [Browser interface](https://github.com/purohith08/ds-university-allotment/blob/master/static/js/main.js): `static/js/main.js`
- [Application page](https://github.com/purohith08/ds-university-allotment/blob/master/templates/index.html): `templates/index.html`

### Flask service

- [Flask API](https://github.com/purohith08/ds-university-allotment/blob/master/main.py): `main.py`
- [Uploaded rosters](https://github.com/purohith08/ds-university-allotment/blob/master/main.py): `main.py`
- [Allocation summary](https://github.com/purohith08/ds-university-allotment/blob/master/main.py): `main.py`

### Allocation engine

- [Allotment engine](https://github.com/purohith08/ds-university-allotment/blob/master/hall_allotment.py): `hall_allotment.py`
- [Roster parsing](https://github.com/purohith08/ds-university-allotment/blob/master/hall_allotment.py): `hall_allotment.py`
- [Room assignment](https://github.com/purohith08/ds-university-allotment/blob/master/hall_allotment.py): `hall_allotment.py`

### Reports

- [Excel workbook export](https://github.com/purohith08/ds-university-allotment/blob/master/main.py): `main.py`

### Other components

- **Exam staff**

## Connections

- Exam staff → Browser interface: uses
- Browser interface → Application page: interacts with
- Browser interface → Flask API: uploads files (evidence: `static/js/main.js`)
- Browser interface → Flask API: clears data (evidence: `static/js/main.js`)
- Flask API → Uploaded rosters: saves rosters (evidence: `main.py`)
- Flask API → Allotment engine: calls allotment (evidence: `main.py`)
- Allotment engine → Roster parsing: loads workbooks (evidence: `hall_allotment.py`)
- Allotment engine → Room assignment: dispatches groups (evidence: `hall_allotment.py`)
- Flask API → Allocation summary: calculates totals (evidence: `main.py`)
- Flask API → Excel workbook export: creates export (evidence: `main.py`)
- Allotment engine → Uploaded rosters: reads roster paths (evidence: `main.py`)
