Files
fleets/README.md
Arnaud Delcasse 8f805162e2
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 1m53s
Update README
2026-01-05 23:26:16 +01:00

2.2 KiB

COOPGO Fleets

COOPGO Fleets is a vehicle fleet management microservice providing vehicle and booking management capabilities.

Features

  • gRPC API for vehicle and booking management
  • Vehicle availability tracking with booking integration
  • Flexible data schema for custom vehicle and booking attributes
  • Soft delete for bookings with metadata preservation
  • Multi-namespace support for fleet isolation
  • Vehicle filtering by type, administrator, and availability

Architecture

This microservice is designed to be part of the COOPGO Technical Platform. It does not provide a UI or management interface.

├── grpcapi/     # gRPC server and protocol definitions
├── handlers/    # Business logic
└── storage/     # Database access layer (MongoDB, PostgreSQL)

Configuration

Configuration is managed via Viper. Create a config.yaml file or use environment variables.

Default configuration

name: "COOPGO Fleets"
dev_env: false

storage:
  db:
    type: mongodb  # or "psql"
  mongodb:
    host: localhost
    port: "27017"
    db_name: coopgo_platform
    collections:
      vehicles: fleet_vehicles
      bookings: fleet_bookings

services:
  grpc:
    enable: true
    port: 8093

Environment variables

Use underscore-separated uppercase names: STORAGE_DB_TYPE, SERVICES_GRPC_PORT, etc.

Storage backends

  • MongoDB (default)
  • PostgreSQL (with Atlas migrations)

Build

go build

Docker

docker build \
  --build-arg ACCESS_TOKEN_USR=<user> \
  --build-arg ACCESS_TOKEN_PWD=<password> \
  -t coopgo-fleets .

gRPC API

Vehicles

Method Description
AddVehicle Create a new vehicle
GetVehicle Get a vehicle by ID (includes bookings)
GetVehicles List vehicles with filters
UpdateVehicle Update vehicle data

Bookings

Method Description
CreateBooking Create a booking
GetBooking Get a booking by ID
GetBookings List all bookings
GetDriverBookings Get bookings for a driver
UpdateBooking Update a booking
DeleteBooking Soft delete a booking

License

See LICENSE.md