Game Marathon
A web application for running gaming marathons with friends. Spin the wheel, complete challenges, earn points!
Features
- Create private marathons and invite friends
- Add games with download links
- AI-generated challenges using GPT
- Spin the wheel for random game + challenge
- Points system with streak bonuses
- Leaderboard and activity feed
- Proof upload for completed challenges
Tech Stack
- Frontend: React 18, TypeScript, Vite, Tailwind CSS, Zustand
- Backend: FastAPI, SQLAlchemy, PostgreSQL
- AI: OpenAI GPT-4o-mini
- Infrastructure: Docker, Nginx
Quick Start
Prerequisites
- Docker and Docker Compose
- OpenAI API key
Setup
- Clone the repository:
cd WebApp
- Create
.envfile:
cp .env.example .env
- Edit
.envand set your values:
DB_PASSWORD=your_secure_password
SECRET_KEY=your_jwt_secret_at_least_32_characters
OPENAI_API_KEY=sk-your-openai-key
- Start with Docker:
docker-compose up -d
- Open http://localhost in your browser
Development Mode
Backend:
cd backend
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
uvicorn app.main:app --reload
Frontend:
cd frontend
npm install
npm run dev
Project Structure
WebApp/
├── backend/ # FastAPI application
│ ├── app/
│ │ ├── api/ # API endpoints
│ │ ├── models/ # SQLAlchemy models
│ │ ├── schemas/ # Pydantic schemas
│ │ ├── services/ # Business logic
│ │ └── core/ # Config, security
│ └── uploads/ # Uploaded files
├── frontend/ # React application
│ └── src/
│ ├── api/ # API client
│ ├── components/# UI components
│ ├── pages/ # Page components
│ ├── store/ # Zustand store
│ └── types/ # TypeScript types
├── bot/ # Telegram bot (coming soon)
├── docker-compose.yml
└── nginx.conf
API Documentation
When backend is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
How to Play
- Create Marathon - Set title, description, and duration
- Invite Friends - Share the invite code
- Add Games - Everyone adds their favorite games
- Generate Challenges - AI creates challenges for each game
- Start Marathon - Begin the competition
- Spin & Play - Spin the wheel, get a challenge, complete it
- Upload Proof - Submit screenshot/video as evidence
- Earn Points - Build streaks for bonus points!
Point System
| Difficulty | Base Points |
|---|---|
| Easy | 30-50 |
| Medium | 60-100 |
| Hard | 120-200 |
Streak Bonus:
- 2 in a row: +10%
- 3 in a row: +20%
- 4 in a row: +30%
- 5+ in a row: +40%
Drop Penalties:
- 1st drop: Free (streak resets)
- 2nd drop: -10 points
- 3rd drop: -25 points
- 4th+ drop: -50 points
License
MIT
Description
Languages
TypeScript
52%
Python
42.8%
HTML
2.1%
CSS
1.6%
JavaScript
0.8%
Other
0.6%