# tanvir2159/cse1102-project-1 architecture

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

- Interactive diagram: https://gitdiagram.com/tanvir2159/cse1102-project-1
- Repository: https://github.com/tanvir2159/cse1102-project-1

## Overview

VAULT is an interactive C terminal suite: a user enters the shell, dispatches commands to independent rooms, and receives terminal output. Its domain stages include attendance reporting, user lookup, runoff election and leader persistence, leader-gated readability analysis, games, and shared-debt tracking. The shell also provides identity and status commands. The graph follows documented capabilities and the sampled call/file interactions; room implementations not sampled are shown at their documented source paths, without assuming their internal wiring.

Main entry points: [`src/shell.c`](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/shell.c) (Shell and dispatcher), [`src/room_election.c`](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_election.c) (Runoff election), [`src/room_readability.c`](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_readability.c) (Readability analyzer), [`src/room_ledger.c`](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_ledger.c) (Shared ledger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Shell and identity"]
  node_main["Application entry<br/>[main.c]"]
  node_shell_runtime["Shell and dispatcher<br/>[shell.c]"]
  node_user_data["User registry<br/>[users.txt]"]
  node_leader_data["Elected leader"]
end

subgraph group_campus["Campus records"]
  node_attendance["Attendance room<br/>[room_attendance.c]"]
  node_attendance_data["Attendance roster<br/>[attendance.txt]"]
  node_records["Records search<br/>[room_records.c]"]
end

subgraph group_governance["Election and analysis"]
  node_election["Runoff election<br/>[room_election.c]"]
  node_candidate_data["Candidate list<br/>[candidates.txt]"]
  node_vote_data["Ballots<br/>[votes.txt]"]
  node_readability["Readability analyzer<br/>[room_readability.c]"]
  node_sample_data["Sample text<br/>[sample.txt]"]
end

subgraph group_utilities["Games and ledger"]
  node_games["Games arcade<br/>[room_games.c]"]
  node_ledger["Shared ledger<br/>[room_ledger.c]"]
  node_ledger_data[("Ledger storage")]
end

node_user(("Terminal user"))

node_user -->|"starts"| node_main
node_main -->|"starts shell"| node_shell_runtime
node_user -->|"enters commands"| node_shell_runtime
node_shell_runtime -->|"dispatches"| node_attendance
node_shell_runtime -->|"dispatches"| node_records
node_shell_runtime -->|"dispatches"| node_election
node_shell_runtime -->|"dispatches"| node_readability
node_shell_runtime -->|"dispatches"| node_games
node_shell_runtime -->|"dispatches"| node_ledger
node_attendance -->|"reads"| node_attendance_data
node_records -->|"searches"| node_user_data
node_shell_runtime -->|"checks identity"| node_user_data
node_shell_runtime -->|"reads leader"| node_leader_data
node_election -->|"loads candidates"| node_candidate_data
node_election -->|"loads ballots"| node_vote_data
node_election -->|"saves winner"| node_leader_data
node_readability -->|"checks leader"| node_shell_runtime
node_readability -->|"analyzes text"| node_sample_data
node_ledger -->|"reads and writes"| node_ledger_data
node_user -->|"plays"| node_games
node_user -->|"manages debts"| node_ledger

click node_main "https://github.com/tanvir2159/cse1102-project-1/blob/main/src/main.c"
click node_shell_runtime "https://github.com/tanvir2159/cse1102-project-1/blob/main/src/shell.c"
click node_user_data "https://github.com/tanvir2159/cse1102-project-1/blob/main/data/users.txt"
click node_attendance "https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_attendance.c"
click node_attendance_data "https://github.com/tanvir2159/cse1102-project-1/blob/main/data/attendance.txt"
click node_records "https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_records.c"
click node_election "https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_election.c"
click node_candidate_data "https://github.com/tanvir2159/cse1102-project-1/blob/main/data/candidates.txt"
click node_vote_data "https://github.com/tanvir2159/cse1102-project-1/blob/main/data/votes.txt"
click node_readability "https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_readability.c"
click node_sample_data "https://github.com/tanvir2159/cse1102-project-1/blob/main/data/sample.txt"
click node_games "https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_games.c"
click node_ledger "https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_ledger.c"

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_main,node_shell_runtime,node_user_data,node_leader_data,node_user toneBlue
class node_attendance,node_attendance_data,node_records toneAmber
class node_election,node_candidate_data,node_vote_data,node_readability,node_sample_data toneMint
class node_games,node_ledger,node_ledger_data toneRose
```

## Components

### Shell and identity

- [Application entry](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/main.c): `src/main.c`
- [Shell and dispatcher](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/shell.c): `src/shell.c`
- [User registry](https://github.com/tanvir2159/cse1102-project-1/blob/main/data/users.txt): `data/users.txt`
- **Elected leader**

### Campus records

- [Attendance room](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_attendance.c): `src/room_attendance.c`
- [Attendance roster](https://github.com/tanvir2159/cse1102-project-1/blob/main/data/attendance.txt): `data/attendance.txt`
- [Records search](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_records.c): `src/room_records.c`

### Election and analysis

- [Runoff election](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_election.c): `src/room_election.c`
- [Candidate list](https://github.com/tanvir2159/cse1102-project-1/blob/main/data/candidates.txt): `data/candidates.txt`
- [Ballots](https://github.com/tanvir2159/cse1102-project-1/blob/main/data/votes.txt): `data/votes.txt`
- [Readability analyzer](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_readability.c): `src/room_readability.c`
- [Sample text](https://github.com/tanvir2159/cse1102-project-1/blob/main/data/sample.txt): `data/sample.txt`

### Games and ledger

- [Games arcade](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_games.c): `src/room_games.c`
- [Shared ledger](https://github.com/tanvir2159/cse1102-project-1/blob/main/src/room_ledger.c): `src/room_ledger.c`
- **Ledger storage**

### Other components

- **Terminal user**

## Connections

- Terminal user → Application entry: starts
- Application entry → Shell and dispatcher: starts shell
- Terminal user → Shell and dispatcher: enters commands
- Shell and dispatcher → Attendance room: dispatches
- Shell and dispatcher → Records search: dispatches
- Shell and dispatcher → Runoff election: dispatches
- Shell and dispatcher → Readability analyzer: dispatches
- Shell and dispatcher → Games arcade: dispatches
- Shell and dispatcher → Shared ledger: dispatches
- Attendance room → Attendance roster: reads
- Records search → User registry: searches
- Shell and dispatcher → User registry: checks identity
- Shell and dispatcher → Elected leader: reads leader
- Runoff election → Candidate list: loads candidates
- Runoff election → Ballots: loads ballots
- Runoff election → Elected leader: saves winner
- Readability analyzer → Shell and dispatcher: checks leader
- Readability analyzer → Sample text: analyzes text
- Shared ledger → Ledger storage: reads and writes
- Terminal user → Games arcade: plays
- Terminal user → Shared ledger: manages debts
