Theme
Architecture
This page is for power users and integrators who want to understand how the platform is wired up.
Web client
The dashboard is a Next.js 15 application using the App Router. Routes are colocated under src/app/:
src/app/auth/— sign in, sign up, email verification, password recoverysrc/app/(app)/— protected modules (dashboard,drivers,assets,dispatch,risk,maintenance,analytics,users,notifications,fuel,incentive,logs,settings)src/app/driver-dashboard/— driver-facing experience
State management uses React Query with an AuthContext and a ThemeContext provider tree.
Backend services
The backend is built with Encore.ts. Each business domain is its own service:
auth— user identity, sessions, password reset, email verificationdriver— driver records and verification flowstruck— fleet assets and telematics mappingdispatch— routes, trips and on-time trackingmaintenance— service tickets and historypredictive-maintenance— AI risk enginetelemetry-store— live IoT ingestioniot— device protocol bridgechat— operator/driver messagingnotification— multi-channel deliveryemail— transactional email via Resendexporter— CSV/XLSX generationcache— shared Redis-style caches
Each service has its own Postgres database managed through Drizzle migrations.
Data flow
[Truck Telematics] → iot → telemetry-store → predictive-maintenance → notification
↘
[Web Client (Next.js)] ←—————————————— Encore Gateway ——————————————→ [Postgres × N]The Next.js client talks to a single Encore gateway which fans out to the right backend service per route.
Authentication
- Session tokens are stored in HttpOnly cookies set by the Encore gateway.
- Verification codes are 6-digit numeric, valid for a short TTL.
- Password reset tokens are single-use opaque strings.
- All sensitive endpoints are marked
sensitive: truein their Encore API definition.
Deployment
The web client runs on Vercel (or any Node host). The backend services run as a single Encore application — usually deployed to Encore Cloud, GCP, or AWS depending on the tenant.
For end users
You do not need any of this to use the product. This page is documentation for the technical team. Most users can safely skip it.