A modern, full-stack social Formula 1 application that brings together F1 teams, races, and fan engagement in one comprehensive platform.
- Team Management: Browse and explore detailed F1 team profiles with complete member rosters
- Race Tracking: Follow current and historical F1 races with comprehensive circuit information
- Member Profiles: Detailed driver and team member information with roles and statistics
- Circuit Database: Comprehensive circuit information with race history
- Reviews System: Rate and review teams, races, and members with detailed feedback
- Like System: Express appreciation for your favorite teams, drivers, and races
- User Authentication: Secure user registration and login system
- User Profiles: Personalized user experiences with interaction history
- Live F1 Data: Integration with APISports F1 API for real-time race data
- Automated Data Sync: Management commands to pull and sync race data
- Admin Dashboard: Django admin interface for content management
- Django 4.2: Web framework with REST API capabilities
- Django REST Framework: RESTful API development
- PostgreSQL: Primary database with UUID primary keys
- Python 3.x: Core programming language
- React 19: Modern UI library with hooks
- TypeScript: Type-safe JavaScript development
- Vite: Fast development build tool
- Tailwind CSS: Utility-first CSS framework
- React Router: Client-side routing
- Docker: Containerization for consistent development
- Docker Compose: Multi-container orchestration
- PostgreSQL: Database containerization
- APISports F1 API: Real Formula 1 data integration
- Docker and Docker Compose
- Make (optional, for convenient commands)
git clone <repository-url>
cd formulatedCreate a .env file in the root directory:
# Django Settings
DJANGO_SECRET_KEY=your-secret-key-here
DEBUG=1
ALLOWED_HOSTS=localhost,127.0.0.1,api
# Database
DATABASE_URL=postgresql://formulated_user:formulated_pass@db:5432/formulated
# API Keys (Optional)
APISPORTS_API_KEY=your-apisports-api-key
# Admin User
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_EMAIL=admin@formulated.com
DJANGO_SUPERUSER_PASSWORD=qwerty123# Build and start all services
make up
# or
docker-compose up -d
# The application will automatically:
# - Set up the PostgreSQL database
# - Run Django migrations
# - Create a superuser account
# - Seed initial data- Frontend: http://localhost:5173
- API: http://localhost:8000/api/
- Admin Panel: http://localhost:8000/admin/
- Admin: admin / qwerty123
- Test User: testuser / qwerty123
make help # Show all available commands
make build # Build all containers
make up # Start all services
make down # Stop all services
make logs # View logs from all services
make shell # Enter API container shell
make migrate # Run Django migrations
make test # Run Django tests
make seed # Seed database with initial data# Container management
docker-compose build
docker-compose up -d
docker-compose down
docker-compose logs -f
# Django commands
docker-compose exec api python manage.py migrate
docker-compose exec api python manage.py createsuperuser
docker-compose exec api python manage.py test
docker-compose exec api python manage.py seed_data
# Data loading commands
docker-compose exec api python manage.py pull_races --season 2024
# Frontend commands
docker-compose exec client npm install
docker-compose exec client npm run buildGET /api/teams/- List all teamsGET /api/teams/{id}/- Get team detailsPOST /api/teams/{id}/reviews/- Create team reviewPOST /api/teams/{id}/like/- Like/unlike team
GET /api/races/- List all racesGET /api/races/{id}/- Get race detailsPOST /api/races/{id}/reviews/- Create race reviewPOST /api/races/{id}/like/- Like/unlike race
GET /api/members/- List all team membersGET /api/members/{id}/- Get member detailsPOST /api/members/{id}/reviews/- Create member reviewPOST /api/members/{id}/like/- Like/unlike member
GET /api/circuits/- List all circuitsGET /api/circuits/{id}/- Get circuit detailsPOST /api/circuits/{id}/reviews/- Create circuit reviewPOST /api/circuits/{id}/like/- Like/unlike circuit
POST /api/auth/register/- User registrationPOST /api/auth/login/- User loginPOST /api/auth/logout/- User logout
- Team: F1 teams with detailed information and statistics
- Member: Team members (drivers, engineers, managers) with roles
- Race: F1 races with status tracking and results
- Circuit: Racing circuits with location information
- Position: Race results and driver positions
- Review: User reviews with ratings (1-5 stars) for teams, races, and members
- Like: User likes for teams, races, and members
- User: Django's built-in user model for authentication
# Pull current season races
docker-compose exec api python manage.py pull_races
# Pull specific season
docker-compose exec api python manage.py pull_races --season 2024
# Dry run (preview changes)
docker-compose exec api python manage.py pull_races --dry-run# Create database backup
docker-compose exec db pg_dump -U postgres formulated > backup.sql
# Reset database (careful!)
docker-compose exec api python manage.py flush
# Check migration status
docker-compose exec api python manage.py showmigrations# Run all tests
docker-compose exec api python manage.py test
# Run specific app tests
docker-compose exec api python manage.py test teams
docker-compose exec api python manage.py test races
docker-compose exec api python manage.py test interactions
# Run with coverage
docker-compose exec api coverage run --source='.' manage.py test
docker-compose exec api coverage report# Run all tests locally (without Docker)
./scripts/run-tests.sh
# Run with verbose output
./scripts/run-tests.sh --verbose
# Run with coverage report
./scripts/run-tests.sh --coverage
# Run tests for specific app
./scripts/run-tests.sh --app teams# Type checking
docker-compose exec client npm run type-check
# Linting
docker-compose exec client npm run lint
# Build for production
docker-compose exec client npm run buildformulated/
βββ api/ # Django REST Framework backend
β βββ formulated/ # Main Django project
β βββ teams/ # Teams and members app
β βββ races/ # Races and circuits app
β βββ interactions/ # Reviews and likes app
β βββ data_loader/ # External API integration
β βββ requirements.txt
βββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ lib/ # API client and utilities
β β βββ routing/ # Router configuration
β βββ package.json
βββ docker-compose.yml # Development orchestration
βββ Makefile # Development commands