Overview
Built the backend for OOMCO's HSEQ field platform as a NestJS microservices system on PostgreSQL, with strict database-per-service boundaries and RabbitMQ for cross-service sync via an outbox/inbox pattern. Identity handles auth and RBAC; Fieldops runs training, inspections, and incidents; Supply handles orders and approvals; Engagement handles notifications. The stack supports Flutter mobile and admin clients with JWT security and OpenAPI-documented REST APIs behind a unified gateway (/identity, /fieldops, /supply, /engagement).
What It Is
Backend for OOMCO (fuel retail / forecourt operations): Health, Safety, Environment & Quality (HSEQ) workflows in the field, including training, inspections, checklists, incidents, site/region structure, supply orders, and admin access control. Serves mobile field apps and admin web behind a single API surface.
Problem It Solves
Trainers, site managers, RBS (regional supervisors), and back-office staff need one system for plans and visits, on-site training and inspections (including offline capture), approvals and orders, and centralized users, sites, and permissions, without one giant monolithic database.
Architecture
| Layer | Choice |
|---|---|
| Style | Microservices (4 services), database per service |
| Runtime | Node.js, TypeScript, NestJS |
| Repo | pnpm monorepo (apps/ + shared libs/messaging) |
| Data | PostgreSQL: oomco_identity, oomco_fieldops, oomco_supply, oomco_engagement |
| ORM | Prisma (one schema/client per service) |
| Messaging | RabbitMQ (topic exchanges per service, e.g. oomco.identity) |
| Integration | Transactional outbox + inbox; domain events; no cross-DB joins |
| Auth | JWT from Identity; RBAC with permission matrix (roles/modules CRUD) |
| API | REST + OpenAPI/Swagger per service; reverse proxy path prefix in prod |
| Ops | Health checks (DB + broker); Docker Compose for local Postgres/RabbitMQ |
Rule of thumb: If Fieldops needs a site name, it keeps a local replica updated from Identity events. It never queries Identity's database.
The Four Services
- Identity: Login/OTP, users, roles & permissions, regions, sites, site managers/fillers, RBS delegations, audit logs, media upload, shared dropdowns.
- Fieldops: Trainer/RBS/site-manager flows: plans, weekly visits, training sessions, inspections (HSEQ, housekeeping, RBS checklists), incidents, templates, offline-safe submits (
clientUuid). - Supply: Orders (fuel, uniform, lubes, etc.), terminals/items, approval workflow.
- Engagement: Push/notifications (e.g. FCM), device tokens, notification config (evolving).
Features Worth Highlighting
- Event-driven sync between Identity and downstream services (RabbitMQ + outbox).
- Fine-grained RBAC (module permission matrix, custom roles, admin vs field roles).
- Multi-tenant org structure: regions → sites → assignments (site managers, fillers).
- Field-first: inspections/training designed for offline retry and review workflows.
- Unified API surface for Flutter mobile + admin panel (auth, users, roles, regions, fieldops, orders).
My Contribution
- Designed and implemented REST APIs and DTOs in Identity (users, roles, dropdowns, site manager filtering).
- Worked on the permission matrix and role access APIs for admin.
- Integrated Flutter clients with Identity, Fieldops, and Supply endpoints.
- Contributed to event contracts and service boundaries in a pnpm monorepo.
Tech Stack
Project: OOMCO HSEQ Backend | Industry: Fuel retail / forecourt operations | Status: Ongoing