# itsashishdev0/pass architecture

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

- Interactive diagram: https://gitdiagram.com/itsashishdev0/pass
- Repository: https://github.com/itsashishdev0/pass

## Overview

This is a college-event pass management system: an administrator creates and manages passes, attendees receive a QR-bearing digital pass, and gate staff scan it for verification. The backend assigns sequential IDs, generates QR images, stores pass records, serves verification and admin APIs, and exports pass data. The README documents canvas pass generation and the entry outcome; those UI details are represented from documentation because the HTML files were not sampled. The graph does not imply an unshown canvas implementation or unverified UI/API calls.

Main entry points: [`server.js`](https://github.com/itsashishdev0/pass/blob/main/server.js) (Pass creation API), [`verify.html`](https://github.com/itsashishdev0/pass/blob/main/verify.html) (Scan and verify UI), [`admin.html`](https://github.com/itsashishdev0/pass/blob/main/admin.html) (Admin dashboard), [`index.html`](https://github.com/itsashishdev0/pass/blob/main/index.html) (Pass creation UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pass_creation["Pass creation"]
  node_pass_form["Pass creation UI<br/>[index.html]"]
  node_pass_api["Pass creation API<br/>[server.js]"]
  node_qr_encoder["QR encoder"]
  node_canvas_pass["Canvas pass design<br/>[gen.html]"]
  node_digital_pass["Digital pass<br/>[gen.html]"]
end

subgraph group_entry_verification["Entry verification"]
  node_verify_ui["Scan and verify UI<br/>[verify.html]"]
  node_verify_api["Pass verification API<br/>[server.js]"]
  node_entry_outcome["Entry decision"]
end

subgraph group_admin_operations["Admin operations"]
  node_admin_ui["Admin dashboard<br/>[admin.html]"]
  node_pass_management["Pass management APIs<br/>[server.js]"]
  node_pass_export["Pass CSV export<br/>[server.js]"]
end

subgraph group_backend_storage["Backend and storage"]
  node_id_counter["Sequential ID counter<br/>[server.js]"]
  node_qr_files[("QR image files")]
  node_pass_store[("Pass records<br/>[server.js]")]
  node_config["App configuration<br/>[conf.json]"]
  node_static_server["Static file server<br/>[server.js]"]
end

node_admin(("Event admin"))
node_gate_staff(("Gate staff"))
node_mongo[("MongoDB")]

node_admin -->|"creates pass"| node_pass_form
node_pass_form -->|"submits pass"| node_pass_api
node_pass_api -->|"gets ID"| node_id_counter
node_pass_api -->|"generates QR"| node_qr_encoder
node_pass_api -->|"writes image"| node_qr_files
node_pass_api -->|"saves record"| node_pass_store
node_pass_api -->|"reads settings"| node_config
node_pass_api -->|"connects to"| node_mongo
node_pass_api -.->|"provides pass data"| node_canvas_pass
node_canvas_pass -->|"renders pass"| node_digital_pass
node_gate_staff -->|"scans QR"| node_verify_ui
node_verify_ui -->|"requests verification"| node_verify_api
node_verify_api -->|"looks up pass"| node_pass_store
node_verify_ui -.->|"shows result"| node_entry_outcome
node_admin -->|"manages passes"| node_admin_ui
node_admin_ui -.->|"uses management APIs"| node_pass_management
node_pass_management -->|"reads and updates"| node_pass_store
node_admin_ui -.->|"requests export"| node_pass_export
node_pass_export -->|"reads records"| node_pass_store
node_static_server -->|"serves UI"| node_pass_form
node_static_server -->|"serves UI"| node_verify_ui
node_static_server -->|"serves UI"| node_admin_ui

click node_pass_form "https://github.com/itsashishdev0/pass/blob/main/index.html"
click node_pass_api "https://github.com/itsashishdev0/pass/blob/main/server.js"
click node_id_counter "https://github.com/itsashishdev0/pass/blob/main/server.js"
click node_qr_files "https://github.com/itsashishdev0/pass/tree/main/qrsaves"
click node_canvas_pass "https://github.com/itsashishdev0/pass/blob/main/gen.html"
click node_digital_pass "https://github.com/itsashishdev0/pass/blob/main/gen.html"
click node_verify_ui "https://github.com/itsashishdev0/pass/blob/main/verify.html"
click node_verify_api "https://github.com/itsashishdev0/pass/blob/main/server.js"
click node_admin_ui "https://github.com/itsashishdev0/pass/blob/main/admin.html"
click node_pass_management "https://github.com/itsashishdev0/pass/blob/main/server.js"
click node_pass_export "https://github.com/itsashishdev0/pass/blob/main/server.js"
click node_pass_store "https://github.com/itsashishdev0/pass/blob/main/server.js"
click node_config "https://github.com/itsashishdev0/pass/blob/main/conf.json"
click node_static_server "https://github.com/itsashishdev0/pass/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_pass_form,node_pass_api,node_qr_encoder,node_canvas_pass,node_digital_pass toneBlue
class node_verify_ui,node_verify_api,node_entry_outcome,node_mongo toneAmber
class node_admin_ui,node_pass_management,node_pass_export toneMint
class node_id_counter,node_qr_files,node_pass_store,node_config,node_static_server toneRose
class node_admin,node_gate_staff toneIndigo
```

## Components

### Pass creation

- [Pass creation UI](https://github.com/itsashishdev0/pass/blob/main/index.html): `index.html`
- [Pass creation API](https://github.com/itsashishdev0/pass/blob/main/server.js): `server.js`
- **QR encoder**
- [Canvas pass design](https://github.com/itsashishdev0/pass/blob/main/gen.html): `gen.html`
- [Digital pass](https://github.com/itsashishdev0/pass/blob/main/gen.html): `gen.html`

### Entry verification

- [Scan and verify UI](https://github.com/itsashishdev0/pass/blob/main/verify.html): `verify.html`
- [Pass verification API](https://github.com/itsashishdev0/pass/blob/main/server.js): `server.js`
- **Entry decision**

### Admin operations

- [Admin dashboard](https://github.com/itsashishdev0/pass/blob/main/admin.html): `admin.html`
- [Pass management APIs](https://github.com/itsashishdev0/pass/blob/main/server.js): `server.js`
- [Pass CSV export](https://github.com/itsashishdev0/pass/blob/main/server.js): `server.js`

### Backend and storage

- [Sequential ID counter](https://github.com/itsashishdev0/pass/blob/main/server.js): `server.js`
- [QR image files](https://github.com/itsashishdev0/pass/tree/main/qrsaves): `qrsaves`
- [Pass records](https://github.com/itsashishdev0/pass/blob/main/server.js): `server.js`
- [App configuration](https://github.com/itsashishdev0/pass/blob/main/conf.json): `conf.json`
- [Static file server](https://github.com/itsashishdev0/pass/blob/main/server.js): `server.js`

### Other components

- **Event admin**
- **Gate staff**
- **MongoDB**

## Connections

- Event admin → Pass creation UI: creates pass (evidence: `README.md`)
- Pass creation UI → Pass creation API: submits pass (evidence: `server.js`)
- Pass creation API → Sequential ID counter: gets ID (evidence: `server.js`)
- Pass creation API → QR encoder: generates QR (evidence: `server.js`)
- Pass creation API → QR image files: writes image (evidence: `server.js`)
- Pass creation API → Pass records: saves record (evidence: `server.js`)
- Pass creation API → App configuration: reads settings (evidence: `server.js`)
- Pass creation API → MongoDB: connects to (evidence: `server.js`)
- Pass creation API → Canvas pass design: provides pass data
- Canvas pass design → Digital pass: renders pass (evidence: `README.md`)
- Gate staff → Scan and verify UI: scans QR (evidence: `README.md`)
- Scan and verify UI → Pass verification API: requests verification (evidence: `server.js`)
- Pass verification API → Pass records: looks up pass (evidence: `server.js`)
- Scan and verify UI → Entry decision: shows result
- Event admin → Admin dashboard: manages passes (evidence: `README.md`)
- Admin dashboard → Pass management APIs: uses management APIs
- Pass management APIs → Pass records: reads and updates (evidence: `server.js`)
- Admin dashboard → Pass CSV export: requests export
- Pass CSV export → Pass records: reads records (evidence: `server.js`)
- Static file server → Pass creation UI: serves UI (evidence: `server.js`)
- Static file server → Scan and verify UI: serves UI (evidence: `server.js`)
- Static file server → Admin dashboard: serves UI (evidence: `server.js`)
