Slick Telemetry backend written in python with fastf1.
Table of Contents:
- VSCode / Pycharm
- Python 3.12.4 (Please check
pyproject.toml
for the latest supported python version) - Poetry for dependency management
- Docker Desktop [OPTIONAL]
- In project root, create a copy of
.env.example
as.env
.- run
cp .env.example .env
for UNIX. - run
copy .env.example .env
for Windows.
- run
Note: Ensure that the python interpreter in your IDE is set to the newly created virtual environment by poetry. If you have not modified poetry configuration, you can find the virtual environment location as stated here.
- Your IDE should activate the virtual environment for you automatically.
- If it doesn't, you can follow either of these steps:
- Check the path of poetry env -
poetry env info
. - Set poetry python interpreter path in VS Code OR
- Run
poetry shell
OR - Execute the
/Scripts/Activate
script from the virtual environment located here.
- Check the path of poetry env -
poetry install --sync --no-root --with dev,lint,test
A task runner that works well with poetry. https://github.com/nat-n/poethepoet.
- Check available tasks:
poetry run poe
- Execute a task:
For example, running the project formatters:
poetry run poe <task-name>
poetry run poe formatters
poetry run poe git-hooks-setup
- Create a
newrelic.ini
file at the root of the project. - Copy contents supplied by Pratik Borole into it.
- Open up a terminal in your IDE.
- If you're not in the python virtual environment, run
poetry shell
to activate it. - Run
python run.py
to start the server. - Open your browser at
http://localhost:8081
.
- Once the server is running, open your browser at
http://localhost:8081/docs
.
- Build image
docker build --file Dockerfile.dev --tag rearwing-dev .
- Run container
docker run --name rearwing-dev --publish 8081:8081 rearwing-dev --detach
- Open your browser at
http://localhost:8081
.
For other docker commands, see useful_commands.md.
- NEVER MERGE YOUR OWN CODE; ALWAYS RAISE A PR AGAINST
main
! - Follow conventional commit format when authoring commit messages.
- Always pull latest changes
- There are several developers working on this project. Always pull/pull-rebase the latest, as necessary, from the branch you intend to commit your changes to.
- If there are local staged/unstaged changes, please stash or discard them as appropriate and then use
git pull --rebase
. - If you don't want to use git CLI, to simplify these operations and have a visual representation of the git tree, we suggest to use a git GUI -
- Github Desktop (free)
- GitKraken (paid)
- Fork (paid)
- GitLens (freemium)
- Git Graph (free)
- Branches:
main
is the production mainline (default branch).
- PR merge strategy on Github
- Code should flow in the following direction through branches:
feature/bug fix -> main
- We'll be keeping a linear commit history and so using a combination of
Rebase and merge
andSquash and merge
merge strategies. - Use
Rebase and merge
as default to ensure all commits from the branch to be merged are brought in individually to the target branch. Squash and merge
may be used ONLY when bringing in changes from a feature/bug fix branch intomain
.- More information on git rebase.
- More information on PR merge strategies.
- Code should flow in the following direction through branches:
- Jira issue linking
- Commits and PRs must be linked to a Jira issue.
- To do so, include the Jira issue key in the PR title and/or the commit message after the conventional commit type.
- More information on Jira smart commits.
App is deployed via Heroku.