# pointonesixhsevuhn/returno architecture

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

- Interactive diagram: https://gitdiagram.com/pointonesixhsevuhn/returno
- Repository: https://github.com/pointonesixhsevuhn/returno

## Overview

RETURNO is a campus lost-and-found web application. Students register or log in, browse and search reports, and submit their own lost/found posts; administrators manage reports and accounts. The browser UI sends same-origin requests through a shared API client to the Node server, which enforces permissions and persists data in SQLite. The graph separates account recovery and verification, report workflows, and administration. Server internals beyond the excerpts are grouped by documented capabilities; their detailed route wiring is not independently verified.

Main entry points: [`server.js`](https://github.com/pointonesixhsevuhn/returno/blob/main/server.js) (HTTP server and API), [`public/app.js`](https://github.com/pointonesixhsevuhn/returno/blob/main/public/app.js) (Screens and interactions), [`mail.js`](https://github.com/pointonesixhsevuhn/returno/blob/main/mail.js) (Email delivery), [`public/api.js`](https://github.com/pointonesixhsevuhn/returno/blob/main/public/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser application"]
  node_web_ui["Screens and interactions<br/>[app.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_web_entry["HTML entry<br/>[index.html]"]
end

subgraph group_server["Server and policy"]
  node_http_server["HTTP server and API<br/>[server.js]"]
  node_access_policy["Permission policy<br/>[access-control.js]"]
end

subgraph group_identity["Accounts and identity"]
  node_account_flows["Registration and sessions<br/>[server.js]"]
  node_email_verification["Email verification<br/>[server.js]"]
  node_password_recovery["Password recovery<br/>[server.js]"]
  node_admin_management["Admin account management<br/>[server.js]"]
end

subgraph group_reports["Lost and found"]
  node_report_workflows["Report operations<br/>[server.js]"]
  node_report_search["Report search<br/>[app.js]"]
end

subgraph group_storage["Persistence and email"]
  node_sqlite_store[("SQLite database<br/>[db.js]")]
  node_migration_runner["Schema migrations<br/>[migrations.js]"]
  node_mail_delivery["Email delivery<br/>[mail.js]"]
end

node_student(("Student"))
node_admin(("Administrator"))
node_smtp["SMTP service"]

node_student -->|"uses"| node_web_ui
node_admin -->|"uses"| node_web_ui
node_web_ui -->|"requests"| node_api_client
node_api_client -->|"fetches API"| node_http_server
node_http_server -->|"serves files"| node_web_entry
node_http_server -->|"checks permissions"| node_access_policy
node_http_server -->|"handles accounts"| node_account_flows
node_http_server -->|"handles verification"| node_email_verification
node_http_server -->|"handles recovery"| node_password_recovery
node_http_server -->|"handles reports"| node_report_workflows
node_web_ui -->|"renders search"| node_report_search
node_http_server -->|"handles admin accounts"| node_admin_management
node_http_server -->|"reads and writes"| node_sqlite_store
node_sqlite_store -->|"runs migrations"| node_migration_runner
node_email_verification -->|"sends codes"| node_mail_delivery
node_password_recovery -->|"sends reset codes"| node_mail_delivery
node_mail_delivery -->|"delivers email"| node_smtp

click node_web_ui "https://github.com/pointonesixhsevuhn/returno/blob/main/public/app.js"
click node_api_client "https://github.com/pointonesixhsevuhn/returno/blob/main/public/api.js"
click node_web_entry "https://github.com/pointonesixhsevuhn/returno/blob/main/public/index.html"
click node_http_server "https://github.com/pointonesixhsevuhn/returno/blob/main/server.js"
click node_access_policy "https://github.com/pointonesixhsevuhn/returno/blob/main/access-control.js"
click node_account_flows "https://github.com/pointonesixhsevuhn/returno/blob/main/server.js"
click node_email_verification "https://github.com/pointonesixhsevuhn/returno/blob/main/server.js"
click node_password_recovery "https://github.com/pointonesixhsevuhn/returno/blob/main/server.js"
click node_report_workflows "https://github.com/pointonesixhsevuhn/returno/blob/main/server.js"
click node_report_search "https://github.com/pointonesixhsevuhn/returno/blob/main/public/app.js"
click node_admin_management "https://github.com/pointonesixhsevuhn/returno/blob/main/server.js"
click node_sqlite_store "https://github.com/pointonesixhsevuhn/returno/blob/main/db.js"
click node_migration_runner "https://github.com/pointonesixhsevuhn/returno/blob/main/migrations.js"
click node_mail_delivery "https://github.com/pointonesixhsevuhn/returno/blob/main/mail.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_web_ui,node_api_client,node_web_entry toneBlue
class node_http_server,node_access_policy toneAmber
class node_account_flows,node_email_verification,node_password_recovery,node_admin_management toneMint
class node_report_workflows,node_report_search toneRose
class node_sqlite_store,node_migration_runner,node_mail_delivery,node_student,node_admin,node_smtp toneIndigo
```

## Components

### Browser application

- [Screens and interactions](https://github.com/pointonesixhsevuhn/returno/blob/main/public/app.js): `public/app.js`
- [API client](https://github.com/pointonesixhsevuhn/returno/blob/main/public/api.js): `public/api.js`
- [HTML entry](https://github.com/pointonesixhsevuhn/returno/blob/main/public/index.html): `public/index.html`

### Server and policy

- [HTTP server and API](https://github.com/pointonesixhsevuhn/returno/blob/main/server.js): `server.js`
- [Permission policy](https://github.com/pointonesixhsevuhn/returno/blob/main/access-control.js): `access-control.js`

### Accounts and identity

- [Registration and sessions](https://github.com/pointonesixhsevuhn/returno/blob/main/server.js): `server.js`
- [Email verification](https://github.com/pointonesixhsevuhn/returno/blob/main/server.js): `server.js`
- [Password recovery](https://github.com/pointonesixhsevuhn/returno/blob/main/server.js): `server.js`
- [Admin account management](https://github.com/pointonesixhsevuhn/returno/blob/main/server.js): `server.js`

### Lost and found

- [Report operations](https://github.com/pointonesixhsevuhn/returno/blob/main/server.js): `server.js`
- [Report search](https://github.com/pointonesixhsevuhn/returno/blob/main/public/app.js): `public/app.js`

### Persistence and email

- [SQLite database](https://github.com/pointonesixhsevuhn/returno/blob/main/db.js): `db.js`
- [Schema migrations](https://github.com/pointonesixhsevuhn/returno/blob/main/migrations.js): `migrations.js`
- [Email delivery](https://github.com/pointonesixhsevuhn/returno/blob/main/mail.js): `mail.js`

### Other components

- **Student**
- **Administrator**
- **SMTP service**

## Connections

- Student → Screens and interactions: uses (evidence: `README.md`)
- Administrator → Screens and interactions: uses (evidence: `README.md`)
- Screens and interactions → API client: requests (evidence: `public/app.js`)
- API client → HTTP server and API: fetches API (evidence: `public/api.js`)
- HTTP server and API → HTML entry: serves files (evidence: `server.js`)
- HTTP server and API → Permission policy: checks permissions (evidence: `server.js`)
- HTTP server and API → Registration and sessions: handles accounts (evidence: `README.md`)
- HTTP server and API → Email verification: handles verification (evidence: `server.js`)
- HTTP server and API → Password recovery: handles recovery (evidence: `server.js`)
- HTTP server and API → Report operations: handles reports (evidence: `README.md`)
- Screens and interactions → Report search: renders search (evidence: `public/app.js`)
- HTTP server and API → Admin account management: handles admin accounts (evidence: `README.md`)
- HTTP server and API → SQLite database: reads and writes (evidence: `server.js`)
- SQLite database → Schema migrations: runs migrations (evidence: `db.js`)
- Email verification → Email delivery: sends codes (evidence: `server.js`)
- Password recovery → Email delivery: sends reset codes (evidence: `server.js`)
- Email delivery → SMTP service: delivers email (evidence: `mail.js`)
