# vismay-dev1/college-project architecture

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

- Interactive diagram: https://gitdiagram.com/vismay-dev1/college-project
- Repository: https://github.com/vismay-dev1/college-project

## Overview

College-Project is a role-based college management portal with a React client, Express API, JSON-backed server state, and browser-based offline fallback. Users sign in, the app loads bootstrap data, and role-specific portals perform college operations through the API or static fallback. The README also documents installable PWA support. The map preserves the major portal domains and supporting UI; unsampled portal and server internals are represented at their known module boundaries, so only documented or indexed relationships are drawn.

Main entry points: [`src/App.tsx`](https://github.com/vismay-dev1/college-project/blob/main/src/App.tsx) (App coordinator), [`src/api/client.ts`](https://github.com/vismay-dev1/college-project/blob/main/src/api/client.ts) (API client), [`src/components/AppShell.tsx`](https://github.com/vismay-dev1/college-project/blob/main/src/components/AppShell.tsx) (Portal shell), [`server.ts`](https://github.com/vismay-dev1/college-project/blob/main/server.ts) (Express API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client Experience"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_login["Sign-in<br/>[LoginView.tsx]"]
  node_shell["Portal shell<br/>[AppShell.tsx]"]
  node_pwa["Install controls"]
  node_online["Connectivity status"]
end

subgraph group_portals["Role Workspaces"]
  node_admin["Administration<br/>[AdminPortal.tsx]"]
  node_student["Student services<br/>[StudentPortal.tsx]"]
  node_teacher["Teacher services<br/>[TeacherPortal.tsx]"]
  node_parent["Parent services<br/>[ParentPortal.tsx]"]
  node_transport["Transport services"]
  node_scanner["QR scanning"]
end

subgraph group_services["Application Services"]
  node_api["API client<br/>[client.ts]"]
  node_fallback["Static fallback<br/>[staticFallback.ts]"]
  node_server["Express API<br/>[server.ts]"]
end

subgraph group_state["Data and Shared Logic"]
  node_database[("JSON database<br/>[college360.db.json]")]
  node_db["Database access<br/>[db.ts]"]
  node_crypto["Credential security<br/>[cryptoUtils.ts]"]
  node_logic["College rules<br/>[collegeLogic.ts]"]
  node_seed["Demo seed data<br/>[seedData.ts]"]
end

node_user(("College user"))

node_user -->|"signs in"| node_login
node_login -->|"authenticates via"| node_api
node_app -->|"loads bootstrap"| node_api
node_app -->|"renders"| node_login
node_app -->|"selects role view"| node_admin
node_app -->|"selects role view"| node_student
node_app -->|"selects role view"| node_teacher
node_app -->|"selects role view"| node_parent
node_app -->|"selects role view"| node_transport
node_app -->|"renders"| node_online
node_admin -->|"requests operations"| node_api
node_student -->|"requests operations"| node_api
node_teacher -->|"requests operations"| node_api
node_transport -->|"requests operations"| node_api
node_parent -->|"uses shell"| node_shell
node_student -->|"uses shell"| node_shell
node_teacher -->|"uses shell"| node_shell
node_transport -->|"uses shell"| node_shell
node_admin -->|"uses shell"| node_shell
node_transport -->|"uses scanner"| node_scanner
node_shell -->|"renders"| node_pwa
node_api -->|"delegates offline"| node_fallback
node_api -.->|"sends API requests"| node_server
node_server -->|"loads and updates"| node_db
node_db -->|"reads and writes"| node_database
node_server -->|"uses credential security"| node_crypto
node_server -->|"validates rules"| node_logic
node_server -->|"uses seed data"| node_seed
node_fallback -->|"uses rules"| node_logic
node_fallback -->|"uses demo data"| node_seed

click node_app "https://github.com/vismay-dev1/college-project/blob/main/src/App.tsx"
click node_login "https://github.com/vismay-dev1/college-project/blob/main/src/components/LoginView.tsx"
click node_shell "https://github.com/vismay-dev1/college-project/blob/main/src/components/AppShell.tsx"
click node_pwa "https://github.com/vismay-dev1/college-project/blob/main/src/components/PWAInstallButton.tsx"
click node_online "https://github.com/vismay-dev1/college-project/blob/main/src/components/OfflineIndicator.tsx"
click node_admin "https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/AdminPortal.tsx"
click node_student "https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/StudentPortal.tsx"
click node_teacher "https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/TeacherPortal.tsx"
click node_parent "https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/ParentPortal.tsx"
click node_transport "https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/TransportPortal.tsx"
click node_scanner "https://github.com/vismay-dev1/college-project/blob/main/src/components/CameraQrScanner.tsx"
click node_api "https://github.com/vismay-dev1/college-project/blob/main/src/api/client.ts"
click node_fallback "https://github.com/vismay-dev1/college-project/blob/main/src/api/staticFallback.ts"
click node_server "https://github.com/vismay-dev1/college-project/blob/main/server.ts"
click node_database "https://github.com/vismay-dev1/college-project/blob/main/data/college360.db.json"
click node_db "https://github.com/vismay-dev1/college-project/blob/main/server/db.ts"
click node_crypto "https://github.com/vismay-dev1/college-project/blob/main/server/cryptoUtils.ts"
click node_logic "https://github.com/vismay-dev1/college-project/blob/main/src/shared/collegeLogic.ts"
click node_seed "https://github.com/vismay-dev1/college-project/blob/main/src/shared/seedData.ts"

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_app,node_login,node_shell,node_pwa,node_online,node_user toneBlue
class node_admin,node_student,node_teacher,node_parent,node_transport,node_scanner toneAmber
class node_api,node_fallback,node_server toneMint
class node_database,node_db,node_crypto,node_logic,node_seed toneRose
```

## Components

### Client Experience

- [App coordinator](https://github.com/vismay-dev1/college-project/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in](https://github.com/vismay-dev1/college-project/blob/main/src/components/LoginView.tsx): `src/components/LoginView.tsx`
- [Portal shell](https://github.com/vismay-dev1/college-project/blob/main/src/components/AppShell.tsx): `src/components/AppShell.tsx`
- [Install controls](https://github.com/vismay-dev1/college-project/blob/main/src/components/PWAInstallButton.tsx): `src/components/PWAInstallButton.tsx`
- [Connectivity status](https://github.com/vismay-dev1/college-project/blob/main/src/components/OfflineIndicator.tsx): `src/components/OfflineIndicator.tsx`

### Role Workspaces

- [Administration](https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/AdminPortal.tsx): `src/components/portals/AdminPortal.tsx`
- [Student services](https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/StudentPortal.tsx): `src/components/portals/StudentPortal.tsx`
- [Teacher services](https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/TeacherPortal.tsx): `src/components/portals/TeacherPortal.tsx`
- [Parent services](https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/ParentPortal.tsx): `src/components/portals/ParentPortal.tsx`
- [Transport services](https://github.com/vismay-dev1/college-project/blob/main/src/components/portals/TransportPortal.tsx): `src/components/portals/TransportPortal.tsx`
- [QR scanning](https://github.com/vismay-dev1/college-project/blob/main/src/components/CameraQrScanner.tsx): `src/components/CameraQrScanner.tsx`

### Application Services

- [API client](https://github.com/vismay-dev1/college-project/blob/main/src/api/client.ts): `src/api/client.ts`
- [Static fallback](https://github.com/vismay-dev1/college-project/blob/main/src/api/staticFallback.ts): `src/api/staticFallback.ts`
- [Express API](https://github.com/vismay-dev1/college-project/blob/main/server.ts): `server.ts`

### Data and Shared Logic

- [JSON database](https://github.com/vismay-dev1/college-project/blob/main/data/college360.db.json): `data/college360.db.json`
- [Database access](https://github.com/vismay-dev1/college-project/blob/main/server/db.ts): `server/db.ts`
- [Credential security](https://github.com/vismay-dev1/college-project/blob/main/server/cryptoUtils.ts): `server/cryptoUtils.ts`
- [College rules](https://github.com/vismay-dev1/college-project/blob/main/src/shared/collegeLogic.ts): `src/shared/collegeLogic.ts`
- [Demo seed data](https://github.com/vismay-dev1/college-project/blob/main/src/shared/seedData.ts): `src/shared/seedData.ts`

### Other components

- **College user**

## Connections

- College user → Sign-in: signs in (evidence: `src/components/LoginView.tsx`)
- Sign-in → API client: authenticates via (evidence: `src/components/LoginView.tsx`)
- App coordinator → API client: loads bootstrap (evidence: `src/App.tsx`)
- App coordinator → Sign-in: renders (evidence: `src/App.tsx`)
- App coordinator → Administration: selects role view (evidence: `src/App.tsx`)
- App coordinator → Student services: selects role view (evidence: `src/App.tsx`)
- App coordinator → Teacher services: selects role view (evidence: `src/App.tsx`)
- App coordinator → Parent services: selects role view (evidence: `src/App.tsx`)
- App coordinator → Transport services: selects role view (evidence: `src/App.tsx`)
- App coordinator → Connectivity status: renders (evidence: `src/App.tsx`)
- Administration → API client: requests operations (evidence: `src/components/portals/AdminPortal.tsx`)
- Student services → API client: requests operations (evidence: `src/components/portals/StudentPortal.tsx`)
- Teacher services → API client: requests operations (evidence: `src/components/portals/TeacherPortal.tsx`)
- Transport services → API client: requests operations (evidence: `src/components/portals/TransportPortal.tsx`)
- Parent services → Portal shell: uses shell (evidence: `src/components/portals/ParentPortal.tsx`)
- Student services → Portal shell: uses shell (evidence: `src/components/portals/StudentPortal.tsx`)
- Teacher services → Portal shell: uses shell (evidence: `src/components/portals/TeacherPortal.tsx`)
- Transport services → Portal shell: uses shell (evidence: `src/components/portals/TransportPortal.tsx`)
- Administration → Portal shell: uses shell (evidence: `src/components/portals/AdminPortal.tsx`)
- Transport services → QR scanning: uses scanner (evidence: `src/components/portals/TransportPortal.tsx`)
- Portal shell → Install controls: renders (evidence: `src/components/AppShell.tsx`)
- API client → Static fallback: delegates offline (evidence: `src/api/client.ts`)
- API client → Express API: sends API requests
- Express API → Database access: loads and updates (evidence: `server.ts`)
- Database access → JSON database: reads and writes (evidence: `README.md`)
- Express API → Credential security: uses credential security (evidence: `server.ts`)
- Express API → College rules: validates rules (evidence: `server.ts`)
- Express API → Demo seed data: uses seed data (evidence: `server.ts`)
- Static fallback → College rules: uses rules (evidence: `src/api/staticFallback.ts`)
- Static fallback → Demo seed data: uses demo data (evidence: `src/api/staticFallback.ts`)
