diff --git a/README.md b/README.md index bbcb740..3774137 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,99 @@ # COOPGO Fleets -COOPGO Fleets is a vehicle management and booking service. +COOPGO Fleets is a vehicle fleet management microservice providing vehicle and booking management capabilities. -It provides : +## Features -- a gRPC API to manage fleets of vehicles and bookings -- availability information on véhicles -- a flexible data schema to push any information on vehicles or bookings +- 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 -It is not a full featured booking platform but just a microservice intended to be used as part of a bigger platform, like the COOPGO Technical Platform. It doesn't provide any king of booking UI or management interface. +## 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 + +```yaml +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 + +```bash +go build +``` + +## Docker + +```bash +docker build \ + --build-arg ACCESS_TOKEN_USR= \ + --build-arg ACCESS_TOKEN_PWD= \ + -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](LICENSE.md)