Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 78 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,125 @@
# WEJAY
# Wejay

En demokratisk Spotify-jukebox där alla får bidra med låtar. Låtordningen bestäms av D'Hondt-metoden för rättvis fördelning.
A democratic Spotify jukebox where everyone gets to contribute songs. Track order is determined by the D'Hondt method for fair distribution.

## FUNKTIONER
## Features

- **Demokratisk kö** - Låtar fördelas rättvist mellan användare med D'Hondt-algoritmen
- **Spotify-integration** - Sök och lägg till låtar från Spotify
- **Realtidsuppdateringar** - Se vad andra lägger till i kön
- **Rumsbaserat** - Skapa rum och bjud in kollegor
- **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

## TEKNISK STACK
## Tech Stack

- **Frontend:** React, TypeScript, Vite, Tailwind CSS
- **UI:** Shadcn/ui komponenter med neumorfisk design
- **Font:** Futura PT (versaler för labels)
- **Backend:** Kräver Lovable Cloud eller Supabase
- **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

## LOKAL UTVECKLING
## Local Development

```bash
# Klona projektet
git clone <repo-url>
cd wejay
# Clone the repository
git clone https://github.com/Iteam1337/wejay-2025.git
cd wejay-2025

# Installera dependencies
# Install dependencies
npm install

# Skapa .env fil
# Create environment file
cp .env.example .env
# Lägg till dina Spotify credentials
# Add your Spotify credentials to .env

# Starta dev server
# Start development server
npm run dev
```

## MILJÖVARIABLER
## Environment Variables

```env
CLIENT_ID=din_spotify_client_id
CLIENT_SECRET=din_spotify_client_secret
# 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=development
```
Comment on lines 42 to 54
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variables documentation is missing VITE_SPOTIFY_REDIRECT_URI, which is present in .env.example and appears to be a required configuration for Spotify OAuth integration. This variable should be documented here with appropriate examples for different environments (development, production).

Copilot uses AI. Check for mistakes.

Skapa en app [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) för att få credentials.
Create an app on the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) to get your credentials.

## DOCKER
## Scripts

```bash
# Bygg image
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
```

## Docker

```bash
# Build the image
docker build -t wejay .

# Kör container
# Run the container
docker run -p 8080:8080 \
-e CLIENT_ID=xxx \
-e VITE_SPOTIFY_CLIENT_ID=xxx \
-e CLIENT_SECRET=xxx \
wejay
```

## KUBERNETES
## Kubernetes

Se `/k8s` mappen för deployment-konfiguration:
See the `/k8s` directory for deployment configurations:
- `deployment.yaml` - Kubernetes deployment
- `service.yaml` - ClusterIP service
- `ingress.yaml` - Ingress med TLS via cert-manager
- `external-dns.yaml` - Automatisk DNS för wejay.org
- `ingress.yaml` - Ingress with TLS via cert-manager
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation references external-dns.yaml as a separate file, but this file doesn't exist in the /k8s directory. The external-dns configuration is actually just an annotation in ingress.yaml.

Either:

  1. Remove this line as external-dns is configured via annotation in ingress.yaml, not a separate file, or
  2. Update to accurately describe what's in the k8s directory (e.g., mention secrets.yaml, namespace.yaml, etc.)
Suggested change
- `ingress.yaml` - Ingress with TLS via cert-manager
- `ingress.yaml` - Ingress with TLS via cert-manager (also includes external-dns configuration via annotation)

Copilot uses AI. Check for mistakes.
- `redis.yaml` - Redis cluster configuration

## ARKITEKTUR
## Architecture

```
┌─────────────────┐ ┌──────────────────┐
│ React App │────▶│ Spotify Web API │
│ (Vite/TS) │ │ (OAuth 2.0) │
└─────────────────┘ └──────────────────┘
┌─────────────────┐ ┌──────────────────┐
Lovable Cloud / │────▶│ PostgreSQL
Supabase │ │ (Rooms, Users)│
Express.js │────▶│ Redis
+ Socket.IO │ │ (Sessions/Caching)│
└─────────────────┘ └──────────────────┘
```

## D'HONDT-METODEN
## The D'Hondt Method

The algorithm ensures fair play in the queue:

1. Each user gets "votes" based on their number of contributions
2. Songs are ranked by `votes / (already_played + 1)`
3. Result: No user can dominate the queue

This ensures that even users who contribute fewer songs get fair representation in the playlist.

Algoritmen fördelar spelordningen rättvist:
## Contributing

1. Varje användare får "röster" baserat på antal bidrag
2. Låtar rankas efter `röster / (redan_spelade + 1)`
3. Resultatet: ingen användare dominerar kön
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## LICENS
## License

MIT
MIT License - see the [LICENSE](LICENSE) file for details.
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!doctype html>
<html lang="sv" class="dark">
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Wejay - Kollaborativ Musik</title>
<meta name="description" content="Dela musik tillsammans med D'Hondt-fördelning för rättvis spelordning" />
<title>Wejay - Democratic Spotify Jukebox</title>
<meta name="description" content="A democratic Spotify jukebox where everyone gets to contribute songs. Track order is determined by the D'Hondt method for fair distribution." />
<meta name="author" content="Wejay" />
<meta property="og:title" content="Wejay - Kollaborativ Musik" />
<meta property="og:description" content="Dela musik tillsammans med D'Hondt-fördelning för rättvis spelordning" />
<meta property="og:title" content="Wejay - Democratic Spotify Jukebox" />
<meta property="og:description" content="A democratic Spotify jukebox where everyone gets to contribute songs. Track order is determined by the D'Hondt method for fair distribution." />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="preconnect" href="https://fonts.cdnfonts.com" crossorigin />
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "vite_react_shadcn_ts",
"name": "wejay",
"private": true,
"version": "0.0.0",
"version": "1.0.0",
"description": "A democratic Spotify jukebox where everyone gets to contribute songs. Track order is determined by the D'Hondt method for fair distribution.",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down Expand Up @@ -85,7 +86,7 @@
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^15.15.0",
"lovable-tagger": "^1.1.11",

Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the lovable-tagger dependency left an empty line. This line should be removed entirely to maintain clean formatting in the devDependencies section.

Suggested change

Copilot uses AI. Check for mistakes.
"postcss": "^8.5.6",
"tailwindcss": "^3.4.17",
"typescript": "^5.8.3",
Expand Down
Loading