Skip to content

GT service tracks if drivers are moving using GPS coordinates. Service consumes coordinate events and uses reactive cache to serve driver moving status through HTTP. DDD, Hexagonal, EDA, and CQRS architecture.

Notifications You must be signed in to change notification settings

TestardR/geo-tracking

Repository files navigation

Functional requirements

  • Send driver's location updates from mobile and forward them to a broker
  • Store locations, compute if a driver is moving or not
  • A driver status is not moving if he has driven less than 500 meters in the last 5 minutes

Geo-Tracking service

The service has two main features:

  • compute and stores driver's status (isZombie) asynchronously consuming driver coordinate updated events. As such, the service leverages reactive caching,
  • serve a driver's status synchronously through HTTP GET requests.

This service has been built following several architecture paradigms:

Architecture

C4 - components diagram

Distance Formula

Distance are commonly computed through Haversine or Vincenty formulas with slightly different results. Either distance formulas can be used in the service using application configuration. Strategy design pattern was an ideal candidate.

Testing Strategy

For the sake of time, critical aspects are covered by unit tests and integration tests.

  • unit tests cover algorithm in charge of computing distance between coordinates
  • integration tests cover the whole application workflow:
    • produce coordinate events, which will update store with driver's coordinates and isZombie status
    • retrieve a driver isZombie status

Setup

  • Go >= 1.18
  • Docker >= 23.0.4

Start infrastructure - services used by GT

Install dependencies by running:

$ make deps

Start the infrastructure by running:

$ make infra-up

Stop the infrastructure by running:

$ make infra-down

Run integration tests (you will need ginkgo test runner installed):

$ make integration-test

Start services in dev mode

$ make build
$ ./build/geo-tracking s

Access pages locally, such as:

Note: driver's coordinate and status are updated through events.

About

GT service tracks if drivers are moving using GPS coordinates. Service consumes coordinate events and uses reactive cache to serve driver moving status through HTTP. DDD, Hexagonal, EDA, and CQRS architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published