Back to projects
Distributed Architecture

VehiGo

Microservices vehicle rental platform with Nginx Gateway and Redis cache

Year
2025
Source
Open Source
Role
Architecture, backend services, Docker/Nginx infra, and mobile app
ARCHITECTURE // VEHIGOC4 · DDD · OPENAPI 3.0
CLIENTReact NativeExpo · JWTHTTPGATEWAY :80NginxReverse Proxyusuarios-svcAuth & Perfisveiculos-svcFrota & Catálogoreservas-svcAgenda & StatusCACHERedis 7In-MemoryPERSISTENCEPostgreSQL 15TypeORM · Docker
3 BOUNDED CONTEXTS · DOCKER COMPOSEREDIS 7 + PG15

Context & problem

Booking workflows in tightly coupled monoliths bind authentication, fleet catalog, and reservation rules into one deployment unit. VehiGo separates these domains into bounded contexts backed by OpenAPI 3.0 specs, C4 diagrams, and Architecture Decision Records.

Node.jsTypeScriptNginxPostgreSQL 15Redis 7TypeORMDockerReact Native

System architecture

Select any layer to inspect responsibilities, protocol, and stack.

4 layers
Mobile AppHTTPS / JWTReact Native • Expo

Android/iOS client handling JWT auth, filtered fleet browsing, and reservation creation.

Technical decisions & trade-offs

Decision 01

Single Nginx API Gateway at the edge

Why

Centralizes HTTP routing across all three services while keeping internal service ports isolated inside the Docker network.

Trade-off & mitigation

Adds a proxy configuration layer to maintain; mitigated through versioned Docker Compose config and explicit per-context routes.

Decision 02

Three domain-scoped services (DDD) with OpenAPI 3.0 contracts

Why

Isolates users, vehicle catalog, and reservations so each domain evolves without leaking internal models.

Trade-off & mitigation

Increases local orchestration and contract overhead; mitigated via OpenAPI 3.0 specs, C4 diagrams, and ADRs.

Decision 03

Redis 7 in-memory cache alongside PostgreSQL 15

Why

Offloads repetitive read lookups while letting PostgreSQL enforce relational and transactional integrity for reservations.

Trade-off & mitigation

Requires cache invalidation discipline on fleet updates; handled by treating PostgreSQL as the single source of truth.

Delivery scope

  • Three independent microservices (users/auth, fleet/vehicles, and reservations) in Node.js, TypeScript, and TypeORM
  • Nginx serving as API Gateway and reverse proxy, centralizing ingress without exposing internal service ports
  • Redis 7 in-memory cache paired with containerized PostgreSQL 15 via Docker Compose
  • Android/iOS mobile client in React Native (Expo) with JWT authentication and filtered fleet browsing
  • Architectural documentation covering DDD bounded contexts, C4 diagrams, ADRs, and OpenAPI 3.0 contracts

Next case study

go-vit

Visual terminal Git manager compiled as a single Go binary