Init multiplayer
All checks were successful
Deploy Feature / deploy-feature (push) Successful in 28s

This commit is contained in:
Johnny322
2026-02-24 20:54:14 +01:00
parent 6dde7eedb6
commit 9945f8163e
14 changed files with 2027 additions and 53 deletions

25
deploy/SETUP.md Normal file
View File

@@ -0,0 +1,25 @@
# Production Setup
## 1) Install systemd service
```bash
sudo cp /repos/music-jeopardy/deploy/systemd/music-jeopardy-realtime.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now music-jeopardy-realtime.service
sudo systemctl status music-jeopardy-realtime.service
```
## 2) Install nginx config
```bash
sudo cp /repos/music-jeopardy/deploy/nginx/jeopardy.toppit.net.conf /etc/nginx/sites-available/jeopardy.toppit.net
sudo ln -sf /etc/nginx/sites-available/jeopardy.toppit.net /etc/nginx/sites-enabled/jeopardy.toppit.net
sudo nginx -t
sudo systemctl reload nginx
```
## 3) Verify
1. Open `https://jeopardy.toppit.net`
2. Create a session in the app (`Game ID`)
3. Open a second browser/device and join by same `Game ID`

View File

@@ -0,0 +1,27 @@
server {
listen 443 ssl;
server_name jeopardy.toppit.net;
root /www/jeopardy;
index index.html;
# SPA routing for Vue Router / client-side routes
location / {
try_files $uri $uri/ /index.html;
}
# Realtime session API + websocket
location /realtime/ {
proxy_pass http://127.0.0.1:8787/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
ssl_certificate /etc/letsencrypt/live/jeopardy.toppit.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/jeopardy.toppit.net/privkey.pem;
}

View File

@@ -0,0 +1,16 @@
[Unit]
Description=Music Jeopardy Realtime Server
After=network.target
[Service]
Type=simple
User=www-data
WorkingDirectory=/repos/music-jeopardy
Environment=NODE_ENV=production
Environment=REALTIME_PORT=8787
ExecStart=/usr/bin/npm run realtime:server
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target