An Elixir project dedicated to processing live data from Formula 1 races.
Project's Website displays live telemetry and analysis (Work in progress).
Development & Demo Website displays telemetry of previous events to demonstate the functionality.
All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
- Elixir 1.14+
- NodeJS 16+ to install NPM dependencies
Alternatively you can use asdf
to manage tool versions, but be aware that it builds Erlang from source which
requires installation of additional system dependencies.
# Install dependencies
mix setup
# Configuration file `.env` must be created by copying `.env.example`
cp .env.example .env
# Copy .env into your environment variables - the application doesn't read .env file on its own
# Only works on fish terminal at the moment
source env.fish
# Generate documentation
mix docs
# Run locally
iex -S mix phx.server
# Run a backtest on an old session
iex -S mix backtest --url "http://livetiming.formula1.com/static/2022/2022-05-08_Miami_Grand_Prix/2022-05-07_Qualifying"
To get a general overview of the data flow and processing in this project, you can explore the project in this order:
Example packet: SessionStatus
packet with status started
F1Bot.ExternalApi.SignalR.Client
receives the packet from live timing APIF1Bot.F1Session.Server
calls the functional code to process thisPacket
F1Bot.F1Session.LiveTimingHandlers
determines and calls the handler module for this packetF1Bot.F1Session.LiveTimingHandlers.SessionStatus
callsF1Session
function to update the stateF1Bot.F1Session
updates its state with new session status and returns its new state + a 'session status change' eventF1Bot.F1Session.Server
broadcasts the event viaF1Bot.PubSub
F1Bot.Output.Discord
receives the session status change event and composes a Discord messageF1Bot.ExternalApi.Discord
chooses the configured Discord client module (live or console for local testing)F1Bot.ExternalApi.Discord.Console
outputs composed message ("F1 Session just started") to your console
Pull requests, bug reports and feature suggestions are welcome!
💙 theOehrly/Fast-F1: For inspiration, their effort and documentation. Fast-F1 was extremely valuable in quickly understanding how F1's live timing service works.
💙 MultiViewer for F1: For tyre icons used in this project
This project is licensed under GNU Affero General Public License version 3, see LICENSE.md
for details.