# Internal Service Overview

There are quite a lot of services required to acquire and preset the public transport data. The figure below shows the current services and which data in what format flows between them. Clicking on different text boxes will open their GitHub repository or documentation.

{% @mermaid/diagram content="flowchart TB
subgraph traffic-stop-box
antenna --> hardware-filter --> SDR --> |IQ samples| r09-receiver --> telegram-decoder
end

```
telegram-decoder -.->|HTTP Post| data-accumulator

subgraph data-hoarder

data-accumulator --> |<a href='https://github.com/tlm-solutions/tlms.rs/blob/31b1ba0092ed99a36b3c0215dc35d4dcb545eddb/proto/telegram.proto#L25'>gRPC</a>| chemo

trekkie --> |<a href='https://github.com/tlm-solutions/tlms.rs/blob/31b1ba0092ed99a36b3c0215dc35d4dcb545eddb/proto/telegram.proto#L15'>gRPC</a>| chemo

chemo --> |<a href='https://github.com/tlm-solutions/tlms.rs/blob/31b1ba0092ed99a36b3c0215dc35d4dcb545eddb/proto/telegram.proto#L45'>gRPC</a>| funnel
chemo --> |<a href='https://github.com/tlm-solutions/tlms.rs/blob/31b1ba0092ed99a36b3c0215dc35d4dcb545eddb/proto/telegram.proto#L45'>gRPC</a>| bureaucrat

datacare <--> |<a href='https://datacare.tlm.solutions/swagger-ui/'>HTTP</a>| kindergarten

funnel --> |<a href='https://github.com/tlm-solutions/funnel/blob/master/src/filter.hpp'>gRPC over WebSocket with filters</a>|kindergarten

bureaucrat --> redis --> lizard --> |<a href='https://lizard.tlm.solutions/swagger-ui/'>HTTP</a>| kindergarten

0-json[(0.json)] -.-> kindergarten
4-json[(4.json)] -.-> kindergarten

postgres-tlms --> grafana
postgres-tlms <--> data-accumulator
postgres-tlms <--> trekkie
postgres-tlms <--> datacare
postgres-tlms --> chemo

postgres-tlms[(Postgres `tlms`)]
redis[(Redis)]

end

    user[/User\]
    grafana <-.- |<a href='https://grafana.tlm.solutions'>HTTP</a>|user
    kindergarten <-.- |<a href='https://map.tlm.solutions'>HTTP</a>|user

strasi-user[/Strasi User\]
trekkie <-.- |<a href='https://trekkie.tlm.solutions/swagger-ui/'>HTTP</a>| strasi-user

click hardware-filter "https://github.com/tlm-solutions/bandpass-filter" _blank
click gnuradio-decoder "https://github.com/tlm-solutions/gnuradio-decoder" _blank
click telegram-decoder "https://github.com/tlm-solutions/decode-server" _blank
click data-accumulator "https://github.com/tlm-solutions/data-accumulator" _blank
click funnel "https://github.com/tlm-solutions/funnel" _blank
click bureaucrat "https://github.com/tlm-solutions/bureaucrat" _blank
click lizard "https://github.com/tlm-solutions/lizard" _blank
click trekkie "https://github.com/tlm-solutions/trekkie" _blank
click kindergarten "https://github.com/tlm-solutions/kindergarten" _blank
click datacare "https://github.com/tlm-solutions/datacare" _blank
click chemo "https://github.com/tlm-solutions/chemo" _blank" fullWidth="true" %}
```

One of the key concepts is to abstract away from acquired real world data and create value with this data by presenting it in an enriched and simplified form. This is done by the application chemo.

Chemo combines R09 Telegrams from data-accumulator and GPS data from trekkie into a unified format that contains Line, Run and GPS location and optional data.

This is served to the user via funnel in real-time and lizard, showing the state of the traffic network.

Individual API docs can be found here:

* Swagger UI for [lizard](https://lizard.tlm.solutions/swagger-ui/)
* Swagger UI for [datacare](https://datacare.tlm.solutions/swagger-ui/)
* Swagger UI for [trekkie](https://trekkie.tlm.solutions/swagger-ui/)
