A democratic Spotify jukebox where everyone gets to contribute songs. Track order is determined by the D'Hondt method for fair distribution.
- Democratic Queue - Songs are distributed fairly between users using the D'Hondt algorithm
- Spotify Integration - Search and add songs from Spotify's catalog
- Real-time Updates - See what others add to the queue instantly
- Room-based - Create rooms and invite colleagues or friends
- Fair Play Algorithm - Prevents any single user from dominating the playlist
- Frontend: React 18, TypeScript, Vite, Tailwind CSS
- UI Components: Shadcn/ui with custom design system
- Backend: Express.js with Socket.IO for real-time features
- Database: Redis for session management and caching
- Authentication: OAuth 2.0 with Spotify
- Deployment: Docker + Kubernetes
# Clone the repository
git clone https://github.com/Iteam1337/wejay-2025.git
cd wejay-2025
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Add your Spotify credentials to .env
# Start development server
npm run dev# Spotify OAuth
VITE_SPOTIFY_CLIENT_ID=your_spotify_client_id
CLIENT_SECRET=your_spotify_client_secret
# Optional: Redis configuration
REDIS_HOST=localhost
REDIS_PORT=6379
# Optional: Server configuration
PORT=8080
NODE_ENV=developmentCreate an app on the Spotify Developer Dashboard to get your credentials.
npm run dev # Start development server
npm run build # Build for production
npm run build:dev # Build in development mode
npm run lint # Run ESLint
npm run preview # Preview production build
npm run start # Start production server# Build the image
docker build -t wejay .
# Run the container
docker run -p 8080:8080 \
-e VITE_SPOTIFY_CLIENT_ID=xxx \
-e CLIENT_SECRET=xxx \
wejaySee the /k8s directory for deployment configurations:
deployment.yaml- Kubernetes deploymentservice.yaml- ClusterIP serviceingress.yaml- Ingress with TLS via cert-managerredis.yaml- Redis cluster configuration
┌─────────────────┐ ┌──────────────────┐
│ React App │────▶│ Spotify Web API │
│ (Vite/TS) │ │ (OAuth 2.0) │
└─────────────────┘ └──────────────────┘
│
▼
┌─────────────────┐ ┌──────────────────┐
│ Express.js │────▶│ Redis │
│ + Socket.IO │ │ (Sessions/Caching)│
└─────────────────┘ └──────────────────┘
The algorithm ensures fair play in the queue:
- Each user gets "votes" based on their number of contributions
- Songs are ranked by
votes / (already_played + 1) - Result: No user can dominate the queue
This ensures that even users who contribute fewer songs get fair representation in the playlist.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see the LICENSE file for details.