A real-time field dispatch and operations management dashboard built with Next.js 15, TypeScript, Tailwind CSS v4, and Supabase. Consumes incoming ticket streams from Google Apps Script monitoring sheets (ticket-monitoring).
✅ Next.js 15 & TypeScript Rewrite Complete (Spec B): Migrated from legacy single-file Vanilla JS (app.js) to a modular Next.js App Router application with typed domain boundaries, unit-tested logic, Recharts analytics, and real URL tab routing (/inbox, /dispatched, /history, /performance).
- ⚡ Real-Time Operations: Live Supabase subscriptions for instant ticket updates across field tech teams.
- 🏷️ Mode Switcher (SLR vs SLI): Dynamic environment switching between SLR tickets and SLI job orders.
- 📍 URL-Based Tab Navigation:
/inbox: Pending ticket queue for admin triage, team assignment, and approval./dispatched: Active field operations queue with tech checklist items (pic,pwr,speed,rpt) and remarks./history: Completed ticket archive with[PROCESSED]review status tagging./performance: Interactive analytics dashboard powered by Recharts (efficiency rate, completion trend, trouble pie chart, per-team metrics).
- 🛡️ Data Integrity Policy (Never-Delete Rule):
service_ordersrows are NEVER deleted.- Team removals or bulk updates reassign tickets to
Unassignedinstead of issuing SQLDELETEs to preserve full historical stats for performance analytics.
- 🔐 RBAC & Dev Impersonation: Role-based access control (
developer,admin,tech) with developer role/team impersonation toolbar.
- Framework: Next.js 15 (App Router)
- Language: TypeScript (Strict)
- Styling: Tailwind CSS v4, Lucide Icons
- Database / Auth: Supabase (PostgreSQL),
@supabase/ssr(Google OAuth) - State & Data Fetching: TanStack React Query + Supabase Realtime Channels
- Analytics / Visualization: Recharts
- Testing: Vitest (Unit testing for domain logic)
Create .env.local in the project root:
NEXT_PUBLIC_SUPABASE_URL=https://qqrzlltwvvpowdigffsq.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-keynpm installnpm run devOpen http://localhost:3000 in your browser.
npm test # Run Vitest unit tests
npm run build # Compile production buildSee AGENTS.md for full workspace rules, git commit/push policies, and data integrity guidelines.