A Formula 1 prediction and discussion platform where users can make predictions about race outcomes and compete with others.
- Race Predictions: Make predictions for upcoming F1 races
- Leaderboard: Compete with other users and see rankings
- Real-time Data: Automatic synchronization with F1 data sources
- User Authentication: Secure login with Facebook OAuth
- Mobile Responsive: Works great on all devices
- Kotlin with Spring Boot
- PostgreSQL database
- JPA/Hibernate for data persistence
- Spring Security for authentication
- Scheduled tasks for data synchronization
- React with TypeScript
- Tailwind CSS for styling
- Vite for build tooling
- React Router for navigation
The application uses external APIs (OpenF1 and Jolpica) for F1 data. To prevent rate limiting issues, the following configuration options are available:
Add these settings to your application.yml or environment variables:
openf1:
api:
rate-limit:
delay-between-drivers-ms: 500 # Delay between processing different drivers
delay-between-calls-ms: 200 # Delay between API calls for the same driver
max-errors-before-stop: 5 # Stop after this many errors
startup:
update-profile-pictures: false # Disable profile picture updates during startupUPDATE_PROFILE_PICTURES_ON_STARTUP: Set totrueto enable profile picture updates during application startup (default:false)
The original implementation was making too many API calls to the OpenF1 API during startup, causing 504 Gateway Timeout errors. The improvements include:
- Configurable delays between API calls to respect rate limits
- Optional startup updates to prevent startup delays
- Better error handling to stop when too many errors occur
- Increased timeouts in RestTemplate configuration
- Scheduled updates that run weekly instead of during startup
- Java 17+
- Node.js 18+
- PostgreSQL 13+
- Navigate to the backend directory:
cd backend - Create a PostgreSQL database
- Update
application-dev.ymlwith your database credentials - Run:
./gradlew bootRun
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install - Start development server:
npm run dev
The application is configured for deployment on Railway with automatic database provisioning and environment variable management.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.