A web application for exploring Formula 1 driver data, sessions, lap times, and results — using OpenF1 data.
Application is live on https://f1racepace.vercel.app
- ✅ Track F1 events by year and location
- ✅ View session info (FP1, FP2, Qualifying, Race, etc.)
- ✅ Explore driver participation and compare lap times
- ✅ Clean, modular FastAPI backend using SQLModel
- ✅ PostgreSQL database
- ✅ Frontend in React
F1Project/
├── backend/
│ ├── main.py # ✅ FastAPI app entry point
│ ├── models/ # SQLModel ORM classes
│ ├── api/ # API route definitions
│ ├── crud/ # DB access logic
│ ├── db/ # DB definitions and utilities (engine, sessions, populators)
│ ├── schemas/ # Pydantic models for request/response
│ ├── utils/ # Utility files
│ └── __init__.py
├── frontend/
│ ├── app/ # Exports frontend code
│ ├── public/ # Frontend static files
│ ├── src/ # Source code
├── static/ # static files (icons)
├── .env # Environment variables (ignored in Git)
├── requirements.txt # Python dependencies
└── README.md # Project documentationgit clone git@github.com:estefanotuyama/racepace-web.git
cd racepace-webpython -m venv venv
source venv/bin/activate # On macOS/Linux
# or
.\venv\Scripts\activate # On Windowspip install -r dev-requirements.txtThis project uses PostgreSQL for the database. You will need to have PostgreSQL installed and running.
-
Install PostgreSQL: You can download and install PostgreSQL from the official website: https://www.postgresql.org/download/
-
Create a Database and User: Create a new database and a user with privileges to access it. You can do this using the
psqlcommand-line tool or a graphical tool like pgAdmin. -
Create a
.envfile: In the root of the project, create a file named.envand add the following line, replacing 'user' with your username, 'password' with your password (if set) and 'database' with your database name:DATABASE_URL="postgresql://user:password@host:port/database"
The project pulls data from the OpenF1 API. To create the database tables and populate them, run:
python -m backend.db.update_dbMay take up to 20 minutes.
From the root directory (with the venv active), start the development server with:
uvicorn backend.main:app --reloadNow, you can access the API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Add a .env in the frontend directory and point the frontend to the API:
REACT_APP_API_URL=http://localhost:8000
cd ./frontend
npm install
npm startNow, you can access the application at http://localhost:3000
- Add driver, session, and lap time API routes (in progress)
- Write tests using
pytest - Add Front-End
- Add session stats feature
- Convert to PostgreSQL
- Add lap time comparison feature
- Deploy to a cloud service (frontend deployed in Vercel, backend on Hetzner)
Built by Estéfano Tuyama Gerassi
This project is for educational purposes only. Data is sourced from the public OpenF1 API.