cd backend
npm installnpm startServer runs on http://localhost:3000
Simply open index.html in your browser
- ✅ Create unlimited leagues
- ✅ Switch between leagues instantly
- ✅ Each league has its own teams and matches
- ✅ Delete leagues (except the last one)
- ✅ Dark blue/black color scheme
- ✅ Better for viewing
- ✅ Modern professional look
- ✅ Node.js + Express server
- ✅ RESTful endpoints
- ✅ File-based storage (JSON)
- ✅ CORS enabled
- Select a league from the dropdown
- View standings and recent matches
- Auto-refreshes every 10 seconds
- Create League: Click "New League" button
- Switch League: Select from dropdown
- Add Teams: Enter team name and click "Add Team"
- Record Matches: Select teams, enter scores, click "Record Match"
- Delete League: Click "Delete League" (must have 2+ leagues)
GET /api/leagues # Get all leagues
POST /api/leagues # Create league
DELETE /api/leagues/:id # Delete league
GET /api/leagues/:id/teams # Get teams
POST /api/leagues/:id/teams # Add team
DELETE /api/leagues/:id/teams/:teamId # Delete team
GET /api/leagues/:id/matches # Get matches
POST /api/leagues/:id/matches # Record match
- Background: Dark blue/black gradient (#1a1a2e, #16213e)
- Sidebar: Dark (#0f1419)
- Header: Blue gradient (#1e3a8a, #1e40af)
- Accents: Blue (#3b82f6, #60a5fa)
- Success: Green (#10b981)
- Danger: Red (#ef4444)
├── backend/
│ ├── server.js # Express server
│ ├── package.json # Dependencies
│ └── data/
│ └── leagues.json # Stored data
├── index.html # Viewer page
├── admin.html # Admin panel
├── styles.css # Dark theme styles
├── api.js # API service
├── viewer.js # Viewer logic
└── admin.js # Admin logic
- Sports League: Track your local football league
- Fantasy League: Manage fantasy team standings
- Tournament: Run a knockout or round-robin tournament
- Multiple Divisions: Have separate leagues for different divisions
- Historical Data: Keep old seasons as separate leagues
Enjoy! ⚽