Get the project running in 5 minutes!
- Docker & Docker Compose installed
docker --versionshould work
# 1. Navigate to project root
cd "c:\Users\arora\Desktop\Prompting 2"
# 2. Start all services
docker-compose up -d
# 3. Wait 30 seconds for database to initialize...
# 4. Done! Access:
# Frontend: http://localhost:3000
# Backend: http://localhost:8000
# API Docs: http://localhost:8000/docs
# Database: localhost:5432Stop everything:
docker-compose downView logs:
docker-compose logs -f backend # Backend logs
docker-compose logs -f frontend # Frontend logs- Python 3.10+
- Node.js 18+
- PostgreSQL 13+
- npm or yarn
# 1. Navigate to backend
cd backend
# 2. Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Mac/Linux
# 3. Install dependencies
pip install -r requirements.txt
# 4. Setup database (PostgreSQL must be running)
# Edit .env with your DATABASE_URL
copy .env.example .env
# 5. Start server
uvicorn app.main:app --reload --port 8000
# Visit: http://localhost:8000/docs# 1. Navigate to frontend
cd frontend
# 2. Install dependencies
npm install
# 3. Setup environment
echo NEXT_PUBLIC_API_URL=http://localhost:8000 > .env.local
# 4. Start dev server
npm run dev
# Visit: http://localhost:3000- Go to http://localhost:8000/docs
- Try "POST /api/auth/register"
- Create account:
{ "username": "testuser", "email": "test@example.com", "password": "password123", "state": "PA" } - Click "Execute"
- You should get user data back!
- Go to http://localhost:3000
- You should see the homepage
- (More UI coming in Phase 2)
election-game/
├── backend/ ← Python/FastAPI
│ ├── app/ ← Core application code
│ └── requirements.txt
├── frontend/ ← React/Next.js
│ └── src/ ← React components
├── docker-compose.yml
└── README.md
| Command | What it does |
|---|---|
docker-compose up -d |
Start all services |
docker-compose down |
Stop all services |
docker-compose logs backend |
View backend logs |
npm run dev (frontend) |
Start Next.js dev server |
uvicorn app.main:app --reload (backend) |
Start FastAPI server |
npm run build (frontend) |
Build for production |
✅ Backend (FastAPI)
- User authentication
- Game session management
- Scoring system
- Leaderboard API
- 20+ endpoints ready
✅ Frontend (Next.js)
- State management (Zustand)
- Custom hooks
- UI components
- TypeScript setup
✅ Database
- PostgreSQL with models
- 5 main tables
- Ready for migrations
# Kill process on port 3000
netstat -ano | findstr :3000
taskkill /PID <PID> /F
# Kill process on port 8000
netstat -ano | findstr :8000
taskkill /PID <PID> /F- PostgreSQL must be running
- Check DATABASE_URL in .env
- Verify credentials are correct
rm -rf node_modules package-lock.json
npm installWhen you're ready, check Phase 2 of README.md to start building:
- The voter registration game
- Drag-and-drop mechanics
- Game timer UI
Happy coding! 🎮