# sahat/hackathon-starter architecture

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

- Interactive diagram: https://gitdiagram.com/sahat/hackathon-starter
- Repository: https://github.com/sahat/hackathon-starter

## Overview

Hackathon Starter is an Express/MVC Node.js web-application boilerplate. A browser request enters the Express app, which dispatches to authentication/account, API-example, AI, contact, and WebAuthn controllers; those handlers use persistence or integrations and return web responses. The README also documents broad OAuth, account-security, AI, and third-party API capabilities. The graph follows the route and call relationships visible in excerpts and the source index; unsampled view wiring and individual API-provider routes are not expanded.

Main entry points: [`app.js`](https://github.com/sahat/hackathon-starter/blob/master/app.js) (Express app), [`controllers/user.js`](https://github.com/sahat/hackathon-starter/blob/master/controllers/user.js) (Account controller), [`config/passport.js`](https://github.com/sahat/hackathon-starter/blob/master/config/passport.js) (Passport auth), [`config/nodemailer.js`](https://github.com/sahat/hackathon-starter/blob/master/config/nodemailer.js) (SMTP mailer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_express["Express app<br/>[app.js]"]
  node_web_views["Page templates"]
  node_static_assets["Browser assets"]
end

subgraph group_identity["Identity and accounts"]
  node_account["Account controller<br/>[user.js]"]
  node_passport["Passport auth<br/>[passport.js]"]
  node_webauthn["Passkey controller<br/>[webauthn.js]"]
  node_user_store[("User records<br/>[User.js]")]
  node_session_store[("Session records<br/>[Session.js]")]
  node_revocation["Token revocation"]
end

subgraph group_examples["Product examples"]
  node_api_examples["API examples<br/>[api.js]"]
  node_ai_examples["AI examples<br/>[ai.js]"]
  node_ai_agent["AI agent<br/>[ai-agent.js]"]
  node_contact["Contact form<br/>[contact.js]"]
end

subgraph group_integrations["External services"]
  node_mail["SMTP mailer<br/>[nodemailer.js]"]
  node_mongodb[("MongoDB")]
  node_oauth_providers{{"OAuth providers"}}
  node_api_services{{"API providers"}}
  node_llm_services{{"LLM services"}}
  node_smtp_service{{"SMTP service"}}
end

node_visitor(("Browser user"))

node_visitor -->|"sends requests"| node_express
node_express -->|"routes to"| node_account
node_express -->|"routes to"| node_api_examples
node_express -->|"dispatches to"| node_ai_examples
node_express -->|"dispatches to"| node_ai_agent
node_express -->|"routes to"| node_contact
node_express -->|"routes to"| node_webauthn
node_express -->|"initializes"| node_passport
node_account -->|"reads and writes"| node_user_store
node_account -->|"uses"| node_session_store
node_account -->|"sends mail"| node_mail
node_account -->|"revokes tokens"| node_revocation
node_passport -->|"loads and saves"| node_user_store
node_webauthn -->|"reads and writes"| node_user_store
node_contact -->|"sends mail"| node_mail
node_mail -.->|"delivers messages"| node_smtp_service
node_account -.->|"persists accounts"| node_mongodb
node_passport -.->|"authenticates with"| node_oauth_providers
node_api_examples -->|"calls examples"| node_api_services
node_ai_examples -.->|"uses models"| node_llm_services
node_ai_agent -->|"invokes models"| node_llm_services
node_visitor -.->|"views pages"| node_web_views
node_visitor -.->|"loads assets"| node_static_assets

click node_express "https://github.com/sahat/hackathon-starter/blob/master/app.js"
click node_web_views "https://github.com/sahat/hackathon-starter/tree/master/views"
click node_static_assets "https://github.com/sahat/hackathon-starter/tree/master/public"
click node_account "https://github.com/sahat/hackathon-starter/blob/master/controllers/user.js"
click node_passport "https://github.com/sahat/hackathon-starter/blob/master/config/passport.js"
click node_webauthn "https://github.com/sahat/hackathon-starter/blob/master/controllers/webauthn.js"
click node_user_store "https://github.com/sahat/hackathon-starter/blob/master/models/User.js"
click node_session_store "https://github.com/sahat/hackathon-starter/blob/master/models/Session.js"
click node_revocation "https://github.com/sahat/hackathon-starter/blob/master/config/token-revocation.js"
click node_api_examples "https://github.com/sahat/hackathon-starter/blob/master/controllers/api.js"
click node_ai_examples "https://github.com/sahat/hackathon-starter/blob/master/controllers/ai.js"
click node_ai_agent "https://github.com/sahat/hackathon-starter/blob/master/controllers/ai-agent.js"
click node_contact "https://github.com/sahat/hackathon-starter/blob/master/controllers/contact.js"
click node_mail "https://github.com/sahat/hackathon-starter/blob/master/config/nodemailer.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_express,node_web_views,node_static_assets,node_visitor toneBlue
class node_account,node_passport,node_webauthn,node_user_store,node_session_store,node_revocation toneAmber
class node_api_examples,node_ai_examples,node_ai_agent,node_contact toneMint
class node_mail,node_mongodb,node_oauth_providers,node_api_services,node_llm_services,node_smtp_service toneRose
```

## Components

### Web application

- [Express app](https://github.com/sahat/hackathon-starter/blob/master/app.js): `app.js`
- [Page templates](https://github.com/sahat/hackathon-starter/tree/master/views): `views`
- [Browser assets](https://github.com/sahat/hackathon-starter/tree/master/public): `public`

### Identity and accounts

- [Account controller](https://github.com/sahat/hackathon-starter/blob/master/controllers/user.js): `controllers/user.js`
- [Passport auth](https://github.com/sahat/hackathon-starter/blob/master/config/passport.js): `config/passport.js`
- [Passkey controller](https://github.com/sahat/hackathon-starter/blob/master/controllers/webauthn.js): `controllers/webauthn.js`
- [User records](https://github.com/sahat/hackathon-starter/blob/master/models/User.js): `models/User.js`
- [Session records](https://github.com/sahat/hackathon-starter/blob/master/models/Session.js): `models/Session.js`
- [Token revocation](https://github.com/sahat/hackathon-starter/blob/master/config/token-revocation.js): `config/token-revocation.js`

### Product examples

- [API examples](https://github.com/sahat/hackathon-starter/blob/master/controllers/api.js): `controllers/api.js`
- [AI examples](https://github.com/sahat/hackathon-starter/blob/master/controllers/ai.js): `controllers/ai.js`
- [AI agent](https://github.com/sahat/hackathon-starter/blob/master/controllers/ai-agent.js): `controllers/ai-agent.js`
- [Contact form](https://github.com/sahat/hackathon-starter/blob/master/controllers/contact.js): `controllers/contact.js`

### External services

- [SMTP mailer](https://github.com/sahat/hackathon-starter/blob/master/config/nodemailer.js): `config/nodemailer.js`
- **MongoDB**
- **OAuth providers**
- **API providers**
- **LLM services**
- **SMTP service**

### Other components

- **Browser user**

## Connections

- Browser user → Express app: sends requests (evidence: `README.md`)
- Express app → Account controller: routes to (evidence: `app.js`)
- Express app → API examples: routes to (evidence: `app.js`)
- Express app → AI examples: dispatches to (evidence: `app.js`)
- Express app → AI agent: dispatches to (evidence: `app.js`)
- Express app → Contact form: routes to (evidence: `app.js`)
- Express app → Passkey controller: routes to (evidence: `app.js`)
- Express app → Passport auth: initializes (evidence: `app.js`)
- Account controller → User records: reads and writes (evidence: `controllers/user.js`)
- Account controller → Session records: uses (evidence: `controllers/user.js`)
- Account controller → SMTP mailer: sends mail (evidence: `controllers/user.js`)
- Account controller → Token revocation: revokes tokens (evidence: `controllers/user.js`)
- Passport auth → User records: loads and saves (evidence: `config/passport.js`)
- Passkey controller → User records: reads and writes (evidence: `controllers/webauthn.js`)
- Contact form → SMTP mailer: sends mail (evidence: `controllers/contact.js`)
- SMTP mailer → SMTP service: delivers messages (evidence: `README.md`)
- Account controller → MongoDB: persists accounts (evidence: `README.md`)
- Passport auth → OAuth providers: authenticates with (evidence: `README.md`)
- API examples → API providers: calls examples (evidence: `controllers/api.js`)
- AI examples → LLM services: uses models (evidence: `README.md`)
- AI agent → LLM services: invokes models (evidence: `controllers/ai-agent.js`)
- Browser user → Page templates: views pages (evidence: `README.md`)
- Browser user → Browser assets: loads assets (evidence: `README.md`)
