# nasrullaunais/mini-hackathon architecture

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

- Interactive diagram: https://gitdiagram.com/nasrullaunais/mini-hackathon
- Repository: https://github.com/nasrullaunais/mini-hackathon

## Overview

DengueWatch connects community reports of dengue breeding sites with officer triage and field-crew resolution, then summarizes risk and workload for operational planning. The principal flow runs from citizen submission through public report visibility, assessment and dispatch, to crew resolution and a recorded decision trail. Authentication supports role-specific access. The graph preserves documented capabilities, including photo uploads, filtering and report timelines; several action implementations and UI components were not excerpted, so their links rely on README statements or SOURCE INDEX references.

Main entry points: [`src/db/client.ts`](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/db/client.ts) (Postgres database), [`src/lib/actions/auth.ts`](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/actions/auth.ts) (Account actions), [`src/app/reports/[id]/page.tsx`](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/reports/%5Bid%5D/page.tsx) (Report detail), [`src/lib/actions/reports.ts`](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/actions/reports.ts) (Report submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reporting["Reporting and browsing"]
  node_report_form["Report form<br/>[report-form.tsx]"]
  node_report_action["Report submission<br/>[reports.ts]"]
  node_blob[("Vercel Blob")]
  node_report_list["Public report list<br/>[page.tsx]"]
  node_report_detail["Report detail<br/>[page.tsx]"]
  node_report_timeline["Decision timeline"]
  node_report_views["Report presentation"]
end

subgraph group_response["Triage and field response"]
  node_staff_page["Officer workspace<br/>[page.tsx]"]
  node_triage_queue["Triage queue<br/>[triage-queue.tsx]"]
  node_triage_actions["Assess dispatch reject"]
  node_triage_action["Triage transitions<br/>[triage.ts]"]
  node_team_page["Crew jobs<br/>[page.tsx]"]
  node_resolve_dialog["Resolution entry<br/>[resolve-dialog.tsx]"]
end

subgraph group_insights["Risk and workload"]
  node_dashboard["Risk dashboard<br/>[page.tsx]"]
  node_risk_stats["Risk and workload calculations<br/>[area-risk.ts]"]
  node_dashboard_views["Dashboard views"]
end

subgraph group_identity["Identity and persistence"]
  node_auth_pages["Login and registration<br/>[page.tsx]"]
  node_auth_forms["Auth forms"]
  node_auth_actions["Account actions<br/>[auth.ts]"]
  node_password_security["Password and tokens<br/>[auth.ts]"]
  node_sessions["Session lifecycle<br/>[current-user.ts]"]
  node_validation["Input validation"]
  node_form_state["Form state helpers<br/>[form.ts]"]
  node_labels["Domain labels<br/>[labels.ts]"]
  node_schema["Domain schema<br/>[schema.ts]"]
  node_database[("Postgres database<br/>[client.ts]")]
end

node_citizen(("Citizen"))
node_officer(("PHI officer"))
node_crew(("Field crew"))

node_citizen -->|"submits report"| node_report_form
node_report_form -->|"invokes"| node_report_action
node_report_action -->|"writes report"| node_database
node_report_action -->|"uploads photo"| node_blob
node_report_list -->|"reads reports"| node_database
node_report_detail -->|"reads report"| node_database
node_report_detail -->|"renders timeline"| node_report_timeline
node_report_detail -->|"renders badges"| node_report_views
node_report_list -->|"renders cards and filters"| node_report_views
node_officer -->|"uses workspace"| node_staff_page
node_staff_page -->|"reads queue data"| node_database
node_staff_page -->|"renders queue"| node_triage_queue
node_triage_queue -->|"renders actions"| node_triage_actions
node_triage_actions -.->|"submits transitions"| node_triage_action
node_crew -->|"uses jobs view"| node_team_page
node_team_page -->|"reads assigned jobs"| node_database
node_team_page -->|"renders resolution"| node_resolve_dialog
node_resolve_dialog -.->|"records resolution"| node_triage_action
node_dashboard -->|"calculates summaries"| node_risk_stats
node_risk_stats -->|"queries reports and teams"| node_database
node_dashboard -->|"renders metrics"| node_dashboard_views
node_auth_pages -->|"renders forms"| node_auth_forms
node_auth_forms -->|"submits credentials"| node_auth_actions
node_auth_actions -->|"validates input"| node_validation
node_auth_actions -->|"parses form"| node_form_state
node_auth_actions -->|"hashes and verifies"| node_password_security
node_auth_actions -->|"creates and destroys sessions"| node_sessions
node_sessions -->|"reads and writes sessions"| node_database
node_auth_actions -->|"reads and writes users"| node_database
node_schema -->|"defines persisted tables"| node_database

click node_report_form "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/components/report/report-form.tsx"
click node_report_action "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/actions/reports.ts"
click node_report_list "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/reports/page.tsx"
click node_report_detail "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/reports/%5Bid%5D/page.tsx"
click node_report_timeline "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/components/reports/report-timeline.tsx"
click node_report_views "https://github.com/nasrullaunais/mini-hackathon/tree/main/src/components/reports"
click node_staff_page "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/staff/page.tsx"
click node_triage_queue "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/components/staff/triage-queue.tsx"
click node_triage_actions "https://github.com/nasrullaunais/mini-hackathon/tree/main/src/components/staff"
click node_triage_action "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/actions/triage.ts"
click node_team_page "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/team/page.tsx"
click node_resolve_dialog "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/components/staff/resolve-dialog.tsx"
click node_dashboard "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/dashboard/page.tsx"
click node_risk_stats "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/stats/area-risk.ts"
click node_dashboard_views "https://github.com/nasrullaunais/mini-hackathon/tree/main/src/components/dashboard"
click node_auth_pages "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/login/page.tsx"
click node_auth_forms "https://github.com/nasrullaunais/mini-hackathon/tree/main/src/components/auth"
click node_auth_actions "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/actions/auth.ts"
click node_password_security "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/auth.ts"
click node_sessions "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/current-user.ts"
click node_validation "https://github.com/nasrullaunais/mini-hackathon/tree/main/src/lib/validations"
click node_form_state "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/form.ts"
click node_labels "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/labels.ts"
click node_schema "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/db/schema.ts"
click node_database "https://github.com/nasrullaunais/mini-hackathon/blob/main/src/db/client.ts"

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_report_form,node_report_action,node_blob,node_report_list,node_report_detail,node_report_timeline,node_report_views toneBlue
class node_staff_page,node_triage_queue,node_triage_actions,node_triage_action,node_team_page,node_resolve_dialog toneAmber
class node_dashboard,node_risk_stats,node_dashboard_views toneMint
class node_auth_pages,node_auth_forms,node_auth_actions,node_password_security,node_sessions,node_validation,node_form_state,node_labels,node_schema,node_database toneRose
class node_citizen,node_officer,node_crew toneIndigo
```

## Components

### Reporting and browsing

- [Report form](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/components/report/report-form.tsx): `src/components/report/report-form.tsx`
- [Report submission](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/actions/reports.ts): `src/lib/actions/reports.ts`
- **Vercel Blob**
- [Public report list](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/reports/page.tsx): `src/app/reports/page.tsx`
- [Report detail](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/reports/%5Bid%5D/page.tsx): `src/app/reports/[id]/page.tsx`
- [Decision timeline](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/components/reports/report-timeline.tsx): `src/components/reports/report-timeline.tsx`
- [Report presentation](https://github.com/nasrullaunais/mini-hackathon/tree/main/src/components/reports): `src/components/reports`

### Triage and field response

- [Officer workspace](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/staff/page.tsx): `src/app/staff/page.tsx`
- [Triage queue](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/components/staff/triage-queue.tsx): `src/components/staff/triage-queue.tsx`
- [Assess dispatch reject](https://github.com/nasrullaunais/mini-hackathon/tree/main/src/components/staff): `src/components/staff`
- [Triage transitions](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/actions/triage.ts): `src/lib/actions/triage.ts`
- [Crew jobs](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/team/page.tsx): `src/app/team/page.tsx`
- [Resolution entry](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/components/staff/resolve-dialog.tsx): `src/components/staff/resolve-dialog.tsx`

### Risk and workload

- [Risk dashboard](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Risk and workload calculations](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/stats/area-risk.ts): `src/lib/stats/area-risk.ts`
- [Dashboard views](https://github.com/nasrullaunais/mini-hackathon/tree/main/src/components/dashboard): `src/components/dashboard`

### Identity and persistence

- [Login and registration](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Auth forms](https://github.com/nasrullaunais/mini-hackathon/tree/main/src/components/auth): `src/components/auth`
- [Account actions](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/actions/auth.ts): `src/lib/actions/auth.ts`
- [Password and tokens](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Session lifecycle](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/current-user.ts): `src/lib/current-user.ts`
- [Input validation](https://github.com/nasrullaunais/mini-hackathon/tree/main/src/lib/validations): `src/lib/validations`
- [Form state helpers](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/form.ts): `src/lib/form.ts`
- [Domain labels](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/lib/labels.ts): `src/lib/labels.ts`
- [Domain schema](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/db/schema.ts): `src/db/schema.ts`
- [Postgres database](https://github.com/nasrullaunais/mini-hackathon/blob/main/src/db/client.ts): `src/db/client.ts`

### Other components

- **Citizen**
- **PHI officer**
- **Field crew**

## Connections

- Citizen → Report form: submits report
- Report form → Report submission: invokes (evidence: `src/components/report/report-form.tsx`)
- Report submission → Postgres database: writes report
- Report submission → Vercel Blob: uploads photo
- Public report list → Postgres database: reads reports (evidence: `src/app/reports/page.tsx`)
- Report detail → Postgres database: reads report (evidence: `src/app/reports/[id]/page.tsx`)
- Report detail → Decision timeline: renders timeline (evidence: `src/app/reports/[id]/page.tsx`)
- Report detail → Report presentation: renders badges (evidence: `src/app/reports/[id]/page.tsx`)
- Public report list → Report presentation: renders cards and filters (evidence: `src/app/reports/page.tsx`)
- PHI officer → Officer workspace: uses workspace
- Officer workspace → Postgres database: reads queue data (evidence: `src/app/staff/page.tsx`)
- Officer workspace → Triage queue: renders queue (evidence: `src/app/staff/page.tsx`)
- Triage queue → Assess dispatch reject: renders actions (evidence: `src/components/staff/triage-queue.tsx`)
- Assess dispatch reject → Triage transitions: submits transitions
- Field crew → Crew jobs: uses jobs view
- Crew jobs → Postgres database: reads assigned jobs (evidence: `src/app/team/page.tsx`)
- Crew jobs → Resolution entry: renders resolution (evidence: `src/app/team/page.tsx`)
- Resolution entry → Triage transitions: records resolution
- Risk dashboard → Risk and workload calculations: calculates summaries (evidence: `src/app/dashboard/page.tsx`)
- Risk and workload calculations → Postgres database: queries reports and teams (evidence: `src/lib/stats/area-risk.ts`)
- Risk dashboard → Dashboard views: renders metrics (evidence: `src/app/dashboard/page.tsx`)
- Login and registration → Auth forms: renders forms (evidence: `src/app/login/page.tsx`)
- Auth forms → Account actions: submits credentials (evidence: `src/components/auth/register-form.tsx`)
- Account actions → Input validation: validates input (evidence: `src/lib/actions/auth.ts`)
- Account actions → Form state helpers: parses form (evidence: `src/lib/actions/auth.ts`)
- Account actions → Password and tokens: hashes and verifies (evidence: `src/lib/actions/auth.ts`)
- Account actions → Session lifecycle: creates and destroys sessions (evidence: `src/lib/actions/auth.ts`)
- Session lifecycle → Postgres database: reads and writes sessions (evidence: `src/lib/current-user.ts`)
- Account actions → Postgres database: reads and writes users (evidence: `src/lib/actions/auth.ts`)
- Domain schema → Postgres database: defines persisted tables (evidence: `src/db/client.ts`)
