# saranrajsnkr/docket-app architecture

> Architecture diagram of the GitHub repository saranrajsnkr/docket-app, 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/saranrajsnkr/docket-app
- Repository: https://github.com/saranrajsnkr/docket-app

## Overview

Docket is a ticket tracker with a shared-secret admin dashboard, an unauthenticated client submission page, and separate common, daily, and weekly to-do lists. Admins review and update tickets, move completed or closed work to the archive, and manage to-dos; clients submit tickets that enter the pending queue. The server serves the public pages, handles API routes, and reads and writes PostgreSQL. Page implementations and table definitions are not excerpted, so their links reflect README documentation rather than inspected frontend code.

Main entry points: [`server.js`](https://github.com/saranrajsnkr/docket-app/blob/main/server.js) (Express server), [`public/index.html`](https://github.com/saranrajsnkr/docket-app/blob/main/public/index.html) (Home dashboard), [`public/archive.html`](https://github.com/saranrajsnkr/docket-app/blob/main/public/archive.html) (Ticket archive), [`public/submit.html`](https://github.com/saranrajsnkr/docket-app/blob/main/public/submit.html) (Client submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Web pages"]
  node_home["Home dashboard<br/>[index.html]"]
  node_archive["Ticket archive<br/>[archive.html]"]
  node_submission["Client submission<br/>[submit.html]"]
end

subgraph group_tickets["Ticket workflow"]
  node_ticket_api["Ticket API<br/>[server.js]"]
  node_public_intake["Public intake<br/>[server.js]"]
end

subgraph group_todos["To-do lists"]
  node_todo_api["To-do API<br/>[server.js]"]
end

subgraph group_backend["Server and data"]
  node_auth["Admin token check<br/>[server.js]"]
  node_http["Express server<br/>[server.js]"]
  node_database[("PostgreSQL")]
  node_schema["Database schema<br/>[schema.sql]"]
end

node_admin(("Admin"))
node_client(("Client"))

node_admin -->|"opens dashboard"| node_home
node_admin -->|"opens archive"| node_archive
node_client -->|"submits ticket"| node_submission
node_home -->|"manages tickets"| node_ticket_api
node_archive -->|"reopens or deletes"| node_ticket_api
node_submission -->|"sends submission"| node_public_intake
node_home -->|"manages to-dos"| node_todo_api
node_admin -->|"provides token"| node_auth
node_http -->|"serves pages"| node_home
node_http -->|"serves pages"| node_archive
node_http -->|"serves pages"| node_submission
node_ticket_api -->|"checks admin"| node_auth
node_todo_api -->|"checks admin"| node_auth
node_ticket_api -->|"reads and writes"| node_database
node_public_intake -->|"creates pending ticket"| node_database
node_todo_api -->|"reads and writes"| node_database
node_http -->|"connects through pool"| node_database
node_schema -->|"defines tables"| node_database

click node_home "https://github.com/saranrajsnkr/docket-app/blob/main/public/index.html"
click node_archive "https://github.com/saranrajsnkr/docket-app/blob/main/public/archive.html"
click node_submission "https://github.com/saranrajsnkr/docket-app/blob/main/public/submit.html"
click node_ticket_api "https://github.com/saranrajsnkr/docket-app/blob/main/server.js"
click node_public_intake "https://github.com/saranrajsnkr/docket-app/blob/main/server.js"
click node_todo_api "https://github.com/saranrajsnkr/docket-app/blob/main/server.js"
click node_auth "https://github.com/saranrajsnkr/docket-app/blob/main/server.js"
click node_http "https://github.com/saranrajsnkr/docket-app/blob/main/server.js"
click node_schema "https://github.com/saranrajsnkr/docket-app/blob/main/schema.sql"

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_home,node_archive,node_submission,node_client toneBlue
class node_ticket_api,node_public_intake toneAmber
class node_todo_api toneMint
class node_auth,node_http,node_database,node_schema toneRose
class node_admin toneIndigo
```

## Components

### Web pages

- [Home dashboard](https://github.com/saranrajsnkr/docket-app/blob/main/public/index.html): `public/index.html`
- [Ticket archive](https://github.com/saranrajsnkr/docket-app/blob/main/public/archive.html): `public/archive.html`
- [Client submission](https://github.com/saranrajsnkr/docket-app/blob/main/public/submit.html): `public/submit.html`

### Ticket workflow

- [Ticket API](https://github.com/saranrajsnkr/docket-app/blob/main/server.js): `server.js`
- [Public intake](https://github.com/saranrajsnkr/docket-app/blob/main/server.js): `server.js`

### To-do lists

- [To-do API](https://github.com/saranrajsnkr/docket-app/blob/main/server.js): `server.js`

### Server and data

- [Admin token check](https://github.com/saranrajsnkr/docket-app/blob/main/server.js): `server.js`
- [Express server](https://github.com/saranrajsnkr/docket-app/blob/main/server.js): `server.js`
- **PostgreSQL**
- [Database schema](https://github.com/saranrajsnkr/docket-app/blob/main/schema.sql): `schema.sql`

### Other components

- **Admin**
- **Client**

## Connections

- Admin → Home dashboard: opens dashboard (evidence: `README.md`)
- Admin → Ticket archive: opens archive (evidence: `README.md`)
- Client → Client submission: submits ticket (evidence: `README.md`)
- Home dashboard → Ticket API: manages tickets (evidence: `README.md`)
- Ticket archive → Ticket API: reopens or deletes (evidence: `README.md`)
- Client submission → Public intake: sends submission (evidence: `README.md`)
- Home dashboard → To-do API: manages to-dos (evidence: `README.md`)
- Admin → Admin token check: provides token (evidence: `README.md`)
- Express server → Home dashboard: serves pages (evidence: `server.js`)
- Express server → Ticket archive: serves pages (evidence: `server.js`)
- Express server → Client submission: serves pages (evidence: `server.js`)
- Ticket API → Admin token check: checks admin (evidence: `server.js`)
- To-do API → Admin token check: checks admin (evidence: `server.js`)
- Ticket API → PostgreSQL: reads and writes (evidence: `server.js`)
- Public intake → PostgreSQL: creates pending ticket (evidence: `server.js`)
- To-do API → PostgreSQL: reads and writes (evidence: `server.js`)
- Express server → PostgreSQL: connects through pool (evidence: `server.js`)
- Database schema → PostgreSQL: defines tables (evidence: `README.md`)
