Description
Fleet telemetry platform at OMD do Brasil. I started the project and wrote its initial structure: the monorepo, the data model, the multi-tenant isolation and the geospatial layer. The team builds on it today.
Features
- Turborepo monorepo with four applications and eight shared packages
- Multi-tenant isolation with Row Level Security, applied per request
- Policy-based authorization with CASL, permission groups and session management
- Geospatial data in PostGIS: fleet, points of interest and routes, with RLS per tenant and per team
- Google Maps foundation with canvas, overlays and drawing tools
Challenges
- Making Row Level Security hold per request, so no query has to remember the tenant on its own
- Splitting telemetry and video telemetry into separate services without duplicating the contracts
- Setting the frontend defaults early enough that the team would build on the same ones
Learnings
- That access control in the database survives mistakes the application layer does not
- How PostGIS changes the shape of a schema once routes and areas become first-class
- Where a monorepo pays off, and where it only moves the coupling somewhere else