Theme
Developer Guide
This section is for engineers who run, extend or deploy N2E. End-user documentation lives under User Guide; this section assumes you are comfortable with the command line, Node.js and SQL.
Tech stack
| Layer | Tech |
|---|---|
| Web client | Next.js 15 (App Router, React 19, TypeScript, Tailwind 4) |
| Backend services | Encore.ts (TypeScript) |
| Databases | Postgres (per-service, managed by Encore) |
| ORM | Drizzle |
| Resend | |
| Live telemetry | Encore PubSub topics + Postgres |
| Maps & charts | Leaflet, Google Maps JS API, Recharts |
Repository layout
n2e/web/
├── backend/ # Encore.ts backend (one folder per service)
│ ├── auth/ # users, sessions, password recovery
│ ├── driver/ # driver records
│ ├── truck/ # fleet assets
│ ├── dispatch/ # routes & trips
│ ├── maintenance/ # service tickets
│ ├── predictive-maintenance/ # AI risk engine
│ ├── telemetry-store/ # raw telemetry persistence
│ ├── iot/ # device protocol bridge
│ ├── chat/ # in-app messaging
│ ├── notification/ # multi-channel notifications
│ ├── email/ # transactional email
│ ├── exporter/ # CSV/XLSX export jobs
│ ├── cache/ # shared cache helpers
│ ├── seed/ # local data seeding
│ ├── encore.app # Encore app id and CORS config
│ └── *.config.ts # Drizzle migration configs (one per database)
├── monitoring_dashboard/ # Next.js web client
│ ├── src/app/ # App Router routes
│ ├── src/views/ # Top-level page views
│ ├── src/components/ # Shared UI
│ ├── src/lib/ # Auth, query, theme providers
│ └── .env.example # Frontend env template
└── docs/ # This documentation site (VitePress)Reading order
- Prerequisites — install the toolchain.
- Run the backend — boot Encore locally.
- Run the frontend — boot Next.js against the local backend.
- Seed data — populate the admin user and a sample fleet.
- Deploy to Encore Cloud — ship the backend.
- Deploy the frontend — ship the Next.js app.
- Environment variables — full reference.