# a8ryanbhai-cmd/institutes-desk architecture

> Architecture diagram of the GitHub repository a8ryanbhai-cmd/institutes-desk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/a8ryanbhai-cmd/institutes-desk
- Repository: https://github.com/a8ryanbhai-cmd/institutes-desk

## Overview

Institute Desk is a single-file Node.js application for managing institutes, staff roles, classes and student records, with announcement distribution as an additional capability. The visible workflow includes role-aware sign-in, class management, student entry/import and class- or institute-scoped announcement preparation. Authentication, permissions, request handlers and persistence helpers are implemented together in server.js. The excerpts are partial and the README is empty, so relationships and capabilities not evidenced in the excerpts are omitted; the frontend’s behavior is not inferred from its filename.

Main entry points: [`server.js`](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js) (Authentication and sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and audit"]
  node_http["HTTP request handling<br/>[server.js]"]
  node_auth["Authentication and sessions<br/>[server.js]"]
  node_permissions["Role permissions<br/>[server.js]"]
  node_audit["Activity logging<br/>[server.js]"]
end

subgraph group_admin["Institute administration"]
  node_institutes["Institute management<br/>[server.js]"]
  node_staff["Staff accounts<br/>[server.js]"]
  node_classes["Class management<br/>[server.js]"]
end

subgraph group_students["Student records"]
  node_studentrecords["Student records<br/>[server.js]"]
  node_studentimport["Student import<br/>[server.js]"]
  node_customfields["Custom student fields<br/>[server.js]"]
end

subgraph group_messaging["Announcements"]
  node_announcements["Announcement handling<br/>[server.js]"]
  node_attachments["Announcement attachments<br/>[server.js]"]
  node_recipients["Phone recipients<br/>[server.js]"]
end

node_user(("User"))
node_sqlite[("SQLite database")]
node_localfiles["Local file storage"]

node_user -.->|"sends requests"| node_http
node_http -.->|"routes login"| node_auth
node_auth -->|"reads accounts"| node_sqlite
node_auth -->|"updates login"| node_sqlite
node_auth -->|"records login"| node_audit
node_audit -->|"writes activity"| node_sqlite
node_permissions -->|"checks institute"| node_sqlite
node_classes -->|"reads and writes"| node_sqlite
node_classes -->|"records changes"| node_audit
node_studentimport -->|"validates and inserts"| node_studentrecords
node_announcements -->|"processes files"| node_attachments
node_attachments -->|"writes attachment"| node_localfiles
node_announcements -->|"reads phone numbers"| node_sqlite

click node_http "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_auth "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_permissions "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_audit "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_institutes "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_staff "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_classes "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_studentrecords "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_studentimport "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_customfields "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_announcements "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_attachments "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"
click node_recipients "https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js"

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_http,node_auth,node_permissions,node_audit,node_user toneBlue
class node_institutes,node_staff,node_classes,node_sqlite,node_localfiles toneAmber
class node_studentrecords,node_studentimport,node_customfields toneMint
class node_announcements,node_attachments,node_recipients toneRose
```

## Components

### Access and audit

- [HTTP request handling](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`
- [Authentication and sessions](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`
- [Role permissions](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`
- [Activity logging](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`

### Institute administration

- [Institute management](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`
- [Staff accounts](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`
- [Class management](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`

### Student records

- [Student records](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`
- [Student import](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`
- [Custom student fields](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`

### Announcements

- [Announcement handling](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`
- [Announcement attachments](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`
- [Phone recipients](https://github.com/a8ryanbhai-cmd/institutes-desk/blob/main/server.js): `server.js`

### Other components

- **User**
- **SQLite database**
- **Local file storage**

## Connections

- User → HTTP request handling: sends requests
- HTTP request handling → Authentication and sessions: routes login (evidence: `server.js`)
- Authentication and sessions → SQLite database: reads accounts (evidence: `server.js`)
- Authentication and sessions → SQLite database: updates login (evidence: `server.js`)
- Authentication and sessions → Activity logging: records login (evidence: `server.js`)
- Activity logging → SQLite database: writes activity (evidence: `server.js`)
- Role permissions → SQLite database: checks institute (evidence: `server.js`)
- Class management → SQLite database: reads and writes (evidence: `server.js`)
- Class management → Activity logging: records changes (evidence: `server.js`)
- Student import → Student records: validates and inserts (evidence: `server.js`)
- Announcement handling → Announcement attachments: processes files (evidence: `server.js`)
- Announcement attachments → Local file storage: writes attachment (evidence: `server.js`)
- Announcement handling → SQLite database: reads phone numbers (evidence: `server.js`)
