A web interface for generating charts and graphs of Formula One session data, using functions from the Fast-F1 Python Library.
You can view the site at https://openf1.nick-dv.com
We welcome any contributions to this project, it's a lot of work for just two devs!
All of our frontend code is written in TypeScript for NextJS (React), and our backend is written as a Django REST API in Python.
We try to use Conventional Commits for our pull requests, have a quick read of the summary and you should be ready to get started. Example PR title:
feat(API): Get all available years with telemetry
<-- This PR would represent an API feature, which implements an endpoint to fetch all years that have complete telemetry data
You'll need the following things installed first:
Once you've installed these, fork this repository to your own account, and then clone it to your system.
N.B: If you only plan on altering the front-end, you can skip this section, although we highly reccomend running your own backend locally.
-
In a terminal, navigate to the parent directory containing the OpenF1 folder.
-
Create a virtual environment by running
python3 -m venv OpenF1
, then navigate into the OpenF1 directory -
Now you need to activate the environment.
Linux/MacOS:
source bin/activate
Windows:
Scripts\activate
-
Install the project requirements with
pip install -r requirements.txt
-
You can run the backend server with
python manage.py runserver
. Requests can be made tohttp://localhost:8000/api/
This is a Next.js project bootstrapped with create-next-app
.
-
In your terminal, navigate to the
frontend
directory in the repository. -
Run
yarn install
to install the project dependencies.2a. (Optional) If you skipped the backend setup, create a file called
.env.local
in the frontend directory, and paste the following code into it:NEXT_PUBLIC_QUERY_URL = https://openf1-api.herokuapp.com
This will tell your frontend instance to use the production API.
-
Run the website using
yarn dev
-
Open
http://localhost:3000
with your browser to see the result.
Once you've written some code and you're ready to submit it for review, push your branch up to GitHub and create a pull request. Fill out the template (deleting any unneeded sections) and we'll review it as soon as we can.