Go to file
Arnaud Delcasse e0b7d73e74 update 2023-09-26 16:42:46 +02:00
geoutils Add PostgreSQL database option and more booking flow functionalities 2023-05-08 01:29:59 +02:00
handler update 2023-09-26 16:42:46 +02:00
internal update 2023-09-26 16:42:46 +02:00
interoperability update 2023-09-26 16:42:46 +02:00
servers update 2023-09-26 16:42:46 +02:00
storage Add PostgreSQL database option and more booking flow functionalities 2023-05-08 01:30:50 +02:00
tiles Add PostgreSQL database option and more booking flow functionalities 2023-05-08 01:29:59 +02:00
.gitignore initial commit 2023-03-27 20:54:56 +02:00
Dockerfile make distance stuff greate again 2023-03-30 00:45:18 +02:00
README.md Add PostgreSQL database option and more booking flow functionalities 2023-05-08 01:29:59 +02:00
config.go Add PostgreSQL database option and more booking flow functionalities 2023-05-08 01:29:59 +02:00
go.mod Add PostgreSQL database option and more booking flow functionalities 2023-05-08 01:29:59 +02:00
go.sum Add PostgreSQL database option and more booking flow functionalities 2023-05-08 01:29:59 +02:00
main.go Add tiles management 2023-03-29 12:50:25 +02:00

README.md

COOPGO Carpool Service

COOPGO Carpool Service is a carpool management microservice. It is part of the COOPGO Technical Platform and the base carpool component of COOPGO's RIDYGO application. It was redesigned from scratch to implement natively the new OCSS carpool standard and bring interoperability.

This is not a full featured carpooling application. There is no UI and it only implements basic carpooling functionalities (create, search, book journeys). The objective of this service is to be embedded in a bigger carpool or Mobility as a Service platform.

It provides a gRPC service to interact with other microservices or the main application, and an HTTP API to provide interoperability with external carpooling operators.

Technical architecture

Managing trips and journeys

Trips and journeys are managed through the provided gRPC service and stored in the database (PostgreSQL or MongoDB for the moment). They are stored in the database as GeoJSON feature collections with extra members defining the trips and journeys non-geographical parameters.

Many thanks to https://github.com/paulmach/orb !

Tiles architecture

To reduce dependencies on the chosen database, we decided to manage geographical calculations directly in our code instead of relying completely on MongoDB or PostgreSQL/Postgis geographical features.

We use a tiles system to retrieve relevant journeys easily. Each tile is defined by :

Tile IDs from each journey/trip is processed at creation time and stored with the journeys or regular trips in the database.

We can simply generate tiles by retrieving the appropriate data from the database.

Search is handled by generating the appropriate tiles for the fiven departure/destination/date/driver/passenger state, and filter the journeys included in these tiles.

TODO : Performance could probably be improved by parallelilizing the filtering flow with goroutines, and adding some tiles caching with groupcache

Database

Supported databases :

  • PostgreSQL
  • MongoDB

TODO : add the option for a simple embedded key-value store like bbolt or badgerdb, with a distributed consensus mechanism (like raft) to allow for even simpler deployments when the overall infrastructure doesn't use PostgreSQL or MongoDB

OCSS standard

The OCSS standard is the new carpooling interoperability standard defined by the french carpooling ecosystem.

COOPGO Carpool Service intends to support this standard completely.

State of the implementation :

  • Server side :
    • GET /driver_journeys
    • GET /passenger_journeys
    • GET /driver_regular_trips
    • GET /passenger_regular_trips
    • POST /bookings
    • PATCH /bookings
    • GET /bookings
    • GET /messages
    • GET /status
  • Client side : ongoing

Licence

COOPGO Carpool Service is released under the terms of the AGPL version 3 licence