BayanLink
Modern civic infrastructure platform engineered inside a Turborepo monorepo with Next.js 15, NestJS, PostgreSQL, Prisma, Redis, BullMQ, and Socket.IO to manage citizen incident triage, case conversion, and dispatch governance.
Implemented Platform vs. Planned Roadmap
- • Turborepo monorepo with shared TypeScript packages
- • Next.js 15 (React 19) citizen & operator dashboards
- • NestJS enterprise API with strict CQRS boundaries
- • PostgreSQL relational models via Prisma migrations
- • Citizen incident submission with media validation
- • Real-time Socket.IO operator triage dispatch room
- • Redis and BullMQ background worker jobs
- • PostGIS geospatial spatial polygon clustering
- • Offline mobile SMS SOS fallback dispatch gateway
- • Real-time GPS emergency vehicle routing
- • Predictive municipal weather hazard models
- • Native mobile cross-platform citizen app
Municipal Incident Triage Friction
Municipal governance often relies on fragmented communication channels: citizen complaints submitted via social media comments, phone calls, and walk-in paper affidavits. This causes duplicate dispatch of municipal work crews, lack of verification on fraudulent reports, zero accountability for response times, and zero transparency for reporting citizens.
BayanLink was architected to replace this chaos with a structured, auditable incident lifecycle pipeline.
The Incident Verification & Dispatch Pipeline
When a citizen logs an infrastructure hazard or municipal issue, NestJS validates the report, checks for geospatial proximity to open tickets to prevent duplicate spam, and streams the event to verified agency operators over WebSockets:
@WebSocketGateway({ cors: { origin: '*' }, namespace: '/events' })
export class DispatchGateway implements OnGatewayConnection {
@WebSocketServer()
server: Server;
// Broadcasts newly verified citizen incidents to authorized department rooms
async broadcastIncident(incident: IncidentReportDto): Promise {
const room = `department_${incident.departmentId}`;
this.server.to(room).emit('incident:new', {
id: incident.id,
category: incident.category,
severity: incident.urgencyLevel,
coordinates: incident.coordinates,
timestamp: new Date().toISOString(),
});
}
}
Heavy image processing, EXIF metadata extraction, and automated email notifications are offloaded to Redis-backed BullMQ queues, keeping the main HTTP and WebSocket event loop responsive under high citizen traffic.
Turborepo Structure
Structured in a high-efficiency monorepo utilizing pnpm workspaces with shared TypeScript validation packages and isolated services:
Multi-Tenant Civic Operations & Real-Time Incident Dispatch
Turborepo · Next.js 15 App Router · NestJS Microservices · PostgreSQL Prisma · Socket.IO Event Bus