How nasrullaunais/mini-hackathon works
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: client.ts Postgres database · auth.ts Account actions · page.tsx Report detail · reports.ts Report submission
Components 29
Reporting and browsing
- Report form
src/components/report/report-form.tsx - Report submission
src/lib/actions/reports.ts - Vercel Blob
- Public report list
src/app/reports/page.tsx - Report detail
src/app/reports/[id]/page.tsx - Decision timeline
src/components/reports/report-timeline.tsx - Report presentation
src/components/reports
Triage and field response
- Officer workspace
src/app/staff/page.tsx - Triage queue
src/components/staff/triage-queue.tsx - Assess dispatch reject
src/components/staff - Triage transitions
src/lib/actions/triage.ts - Crew jobs
src/app/team/page.tsx - Resolution entry
src/components/staff/resolve-dialog.tsx
Risk and workload
- Risk dashboard
src/app/dashboard/page.tsx - Risk and workload calculations
src/lib/stats/area-risk.ts - Dashboard views
src/components/dashboard
Identity and persistence
- Login and registration
src/app/login/page.tsx - Auth forms
src/components/auth - Account actions
src/lib/actions/auth.ts - Password and tokens
src/lib/auth.ts - Session lifecycle
src/lib/current-user.ts - Input validation
src/lib/validations - Form state helpers
src/lib/form.ts - Domain labels
src/lib/labels.ts - Domain schema
src/db/schema.ts - Postgres database
src/db/client.ts
Other components
- Citizen
- PHI officer
- Field crew
Connections 30
- Citizen → Report form: submits report
- Report form → Report submission: invokes
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
src/app/reports/page.tsx - Report detail → Postgres database: reads report
src/app/reports/[id]/page.tsx - Report detail → Decision timeline: renders timeline
src/app/reports/[id]/page.tsx - Report detail → Report presentation: renders badges
src/app/reports/[id]/page.tsx - Public report list → Report presentation: renders cards and filters
src/app/reports/page.tsx - PHI officer → Officer workspace: uses workspace
- Officer workspace → Postgres database: reads queue data
src/app/staff/page.tsx - Officer workspace → Triage queue: renders queue
src/app/staff/page.tsx - Triage queue → Assess dispatch reject: renders actions
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
src/app/team/page.tsx - Crew jobs → Resolution entry: renders resolution
src/app/team/page.tsx - Resolution entry → Triage transitions: records resolution
- Risk dashboard → Risk and workload calculations: calculates summaries
src/app/dashboard/page.tsx - Risk and workload calculations → Postgres database: queries reports and teams
src/lib/stats/area-risk.ts - Risk dashboard → Dashboard views: renders metrics
src/app/dashboard/page.tsx - Login and registration → Auth forms: renders forms
src/app/login/page.tsx - Auth forms → Account actions: submits credentials
src/components/auth/register-form.tsx - Account actions → Input validation: validates input
src/lib/actions/auth.ts - Account actions → Form state helpers: parses form
src/lib/actions/auth.ts - Account actions → Password and tokens: hashes and verifies
src/lib/actions/auth.ts - Account actions → Session lifecycle: creates and destroys sessions
src/lib/actions/auth.ts - Session lifecycle → Postgres database: reads and writes sessions
src/lib/current-user.ts - Account actions → Postgres database: reads and writes users
src/lib/actions/auth.ts - Domain schema → Postgres database: defines persisted tables
src/db/client.ts