Skip to content

DSniatecki/location-tracker

Repository files navigation

Location Tracker

Location Tracker is a system responsible for tracking object locations.

Architecture:

architecture-diagram

Apps:

  • Visualizer - web app responsible for visualizing the location of selected object

Services:

  • Storage - service responsible for storing objects data
  • Receiver - service responsible for receiving object locations
  • Archiver - service responsible for archiving and querying object locations
  • Performer - service responsible for executing scheduled jobs

All services are written in a reactive paradigm. It makes them ideal for low-latency, high-throughput workloads. Additionally, Storage, Receiver and Archiver exposes public APIs secured by JWT token. These tokens can be generated by Guard (Keycloak).

Receiver sends messages to Archiver via RabbitMq in batches. Archiver receives these batches and saves them in ArchiverDB using only one query per batch. It allows the system to be resilient and handle high load. Thanks to it, the system can be also easily scaled horizontally.

Components:

  • Visualizer - web app responsible for visualizing the location of selected object
  • Storage - service responsible for storing objects data
  • Storage Api - OpenAPI definitions for Storage service
  • Receiver - service responsible for receiving object locations
  • Receiver Api - OpenAPI definitions for Receiver service
  • Archiver - service responsible for archiving and querying object locations
  • Archiver Api - OpenAPI definitions for Archiver service
  • Archiver Msg - Protobuf message definitions for Archiver service
  • Performer - service responsible for executing scheduled jobs

Frontend technologies used:

  • TypeScript 4.5.2
  • Angular 13.2.0

Backend technologies used:

  • Kotlin 1.6.21
  • JVM 17
  • Maven 3.8.4
  • Spring Boot 2.6.7 (Webflux)
  • Spring Data R2DBC (+ PostgreSQL R2DBC drivers)
  • Testcontainers 1.17.1 (+ JUnit, Mockk)
  • OpenApi
  • RabbitMQ 3.9.8
  • PostgreSQL 14
  • TimescaleDB 2.6.0 (Based on PostgreSQL 14)
  • Prometheus 2.33.3
  • Grafana 8.2.6
  • Alertmanager 0.23.0
  • Nginx 1.21.6
  • Docker 20.10.12
  • Keycloak 18.0.0

Visualizer ( web app ):

visualizer-1

visualizer-2

visualizer-guard-login

visualizer-guard-login

visualizer-guard-forgot-password

Notifications:

  • Performer location snapshot job mail message:

pefromer-location-snapshot-job-message

Monitoring:

dashboards

  • JVM metrics (For every service)

jvm-metrics

  • Storage metrics

storage-metrics

  • Receiver metrics

receiver-metrics

  • Archiver metrics

archiver-metrics

  • Performer metrics

performer-metrics

Alerts:

  • Pending alert

performer-metrics

  • Firing alert

performer-metrics

  • Alert mail message

performer-metrics

Docker Hub:

https://hub.docker.com/u/dsniatecki

How to start the system:

  1. Clone repo
  2. Execute: docker-compose -f docker-compose-0.1.0.yml up

Plans:

  1. Extend visualizer
  2. Create proper object locations simulator