Compare commits

...
8 Commits
Author SHA1 Message Date
Honey 5fe9342df7 changed to .md 2026-02-17 23:19:58 +01:00
Honey 6bcf4f704b readme 2026-02-16 00:31:20 +01:00
Honey 3ccc38fd17 Discord Webhook Consollen Log + Frab Fehler angepasst 2026-02-16 00:25:55 +01:00
Honey 81d85a0d68 config.js für Namen und Farbe Variable eingebaut 2026-02-12 14:40:14 +01:00
Honey 22779120b3 Angepasste namne und Nachrichten 2026-02-12 13:01:12 +01:00
Honey 279f910b3e PWA Frabe angepasst + Namen farblich gemacht 2026-02-12 12:40:14 +01:00
Honey a6734c2c86 Favicon added 2026-02-12 09:40:21 +01:00
Honey 60622a1718 fixed spelling 2026-02-11 10:25:09 +01:00
7 changed files with 533 additions and 49 deletions

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
// config.js - Zentrale Konfiguration für WhoPays App
export const CONFIG = {
A: {
name: "Lumpia", // Name Marc
colorHex: "#6495ED", // Farbe: Blau
colorDiscord: 0x6495ed, // Discord Embed
icon: "a.png", // Profilbild
background: "bgA.jpg" // Hintergrundbild
},
B: {
name: "Pierogi", // Name Laila
colorHex: "#3C0061", // Farbe: Lila
colorDiscord: 0x3C0061, // Discord Embed
icon: "b.png", // Profilbild
background: "bgB.jpg" // Hintergrundbild
}
};
// Discord Webhook URL
export const DISCORD_WEBHOOK_URL = process.env.DISCORD_WEBHOOK_URL;
// Server URL (für Discord Thumbnails)
export const PUBLIC_BASE_URL = process.env.PUBLIC_BASE_URL
|| "http://localhost:3000";
// Port
export const PORT = process.env.PORT || 3000;
/*
* ANLEITUNG ZUM ANPASSEN:
*
* 1. Namen ändern:
* name: "DeinName"
*
* 2. Farben ändern (Web und Discord müssen gleich sein):
* colorHex: "#3498db" // Hex-Format für Web
* colorDiscord: 0x3498db // Hex ohne # für Discord
*
* Beispiele:
* Blau: colorHex: "#3498db", colorDiscord: 0x3498db
* Lila: colorHex: "#9b59b6", colorDiscord: 0x9b59b6
* Orange: colorHex: "#e67e22", colorDiscord: 0xe67e22
* Pink: colorHex: "#e91e63", colorDiscord: 0xe91e63
*
* 3. Bilder ändern:
* icon: "mein-bild.png"
* background: "mein-hintergrund.jpg"
* (Dateien müssen in /root/whopays/img/ liegen!)
*/
+3 -3
View File
@@ -3,10 +3,10 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<link rel="icon" type="image/x-icon" href="icons/icon-192.png">
<!-- PWA Meta Tags --> <!-- PWA Meta Tags -->
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#ec4899" />
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<!-- iOS Specific --> <!-- iOS Specific -->
@@ -18,7 +18,7 @@
<!-- Android Specific --> <!-- Android Specific -->
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<title>Wer zahlt?</title> <title>Who Pays?</title>
<script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="style.css" /> <link rel="stylesheet" href="style.css" />
@@ -73,7 +73,7 @@
/> />
<div <div
id="personName" id="personName"
class="text-3xl font-semibold text-blue-800 transition-all duration-500" class="text-3xl font-semibold transition-all duration-500"
> >
Lädt ... Lädt ...
</div> </div>
+4 -4
View File
@@ -1,12 +1,12 @@
{ {
"name": "Wer zahlt? - Who Pays", "name": "WhoPays? Who's turn is it",
"short_name": "WhoPays", "short_name": "WhoPays",
"description": "Entscheide spielerisch, wer zahlt", "description": "Battle on who's gonna pay.",
"start_url": "/", "start_url": "/",
"scope": "/", "scope": "/",
"display": "standalone", "display": "standalone",
"background_color": "#fef3c7", "background_color": "#5F9EA0",
"theme_color": "#ec4899", "theme_color": "#556B2F",
"orientation": "portrait-primary", "orientation": "portrait-primary",
"categories": ["utilities", "lifestyle"], "categories": ["utilities", "lifestyle"],
"icons": [ "icons": [
+52 -9
View File
@@ -6,6 +6,9 @@ const lastReasonBox = document.getElementById("lastReasonBox");
const lastReasonText = document.getElementById("lastReasonText"); const lastReasonText = document.getElementById("lastReasonText");
const mainContent = document.getElementById("mainContent"); const mainContent = document.getElementById("mainContent");
// Config wird vom Server geladen
let CONFIG = null;
// Preload images to prevent flickering // Preload images to prevent flickering
const imageCache = {}; const imageCache = {};
function preloadImage(src) { function preloadImage(src) {
@@ -25,14 +28,44 @@ function preloadImage(src) {
}); });
} }
// Config vom Server laden
async function loadConfig() {
try {
const res = await fetch("/config");
CONFIG = await res.json();
console.log("✅ Config geladen:", CONFIG);
return CONFIG;
} catch (err) {
console.error("❌ Fehler beim Laden der Config:", err);
// Fallback zur alten Konfiguration
CONFIG = {
A: {
name: "Honey",
colorHex: "#2ecc71",
icon: "a.png",
background: "bgA.jpg"
},
B: {
name: "Kirby",
colorHex: "#e74c3c",
icon: "b.png",
background: "bgB.jpg"
}
};
return CONFIG;
}
}
// Preload all images on page load // Preload all images on page load
async function preloadAllImages() { async function preloadAllImages() {
if (!CONFIG) await loadConfig();
try { try {
await Promise.all([ await Promise.all([
preloadImage('img/a.png'), preloadImage(`img/${CONFIG.A.icon}`),
preloadImage('img/b.png'), preloadImage(`img/${CONFIG.B.icon}`),
preloadImage('img/bgA.jpg'), preloadImage(`img/${CONFIG.A.background}`),
preloadImage('img/bgB.jpg') preloadImage(`img/${CONFIG.B.background}`)
]); ]);
console.log("✅ Alle Bilder vorgeladen"); console.log("✅ Alle Bilder vorgeladen");
} catch (err) { } catch (err) {
@@ -41,7 +74,8 @@ async function preloadAllImages() {
} }
async function loadStatus() { async function loadStatus() {
// Preload images first // Config und Bilder laden
await loadConfig();
await preloadAllImages(); await preloadAllImages();
const res = await fetch("/status"); const res = await fetch("/status");
@@ -63,9 +97,16 @@ async function loadStatus() {
} }
function setBackgroundAndImage(person, animate = true) { function setBackgroundAndImage(person, animate = true) {
const file = person === "A" ? "img/a.png" : "img/b.png"; if (!CONFIG) {
const label = person === "A" ? "Lumpa" : "Pierogi"; console.error("Config nicht geladen!");
const bgImage = person === "A" ? "url('img/bgA.jpg')" : "url('img/bgB.jpg')"; return;
}
const personConfig = CONFIG[person];
const file = `img/${personConfig.icon}`;
const label = personConfig.name;
const bgImage = `url('img/${personConfig.background}')`;
const nameColor = personConfig.colorHex;
// Set background immediately (smooth transition via CSS) // Set background immediately (smooth transition via CSS)
document.body.style.backgroundImage = bgImage; document.body.style.backgroundImage = bgImage;
@@ -75,10 +116,11 @@ function setBackgroundAndImage(person, animate = true) {
if (animate) { if (animate) {
img.classList.add("rotate"); img.classList.add("rotate");
// Change image and name in the middle of rotation // Change image, name and color in the middle of rotation
setTimeout(() => { setTimeout(() => {
img.src = file; img.src = file;
nameEl.textContent = label; nameEl.textContent = label;
nameEl.style.color = nameColor;
}, 300); // Half of rotation duration }, 300); // Half of rotation duration
// Remove rotation class after animation // Remove rotation class after animation
@@ -89,6 +131,7 @@ function setBackgroundAndImage(person, animate = true) {
// First load - no animation // First load - no animation
img.src = file; img.src = file;
nameEl.textContent = label; nameEl.textContent = label;
nameEl.style.color = nameColor;
} }
} }
+2 -2
View File
@@ -39,8 +39,8 @@
} }
#personName { #personName {
will-change: opacity; will-change: opacity, color;
transition: opacity 0.3s ease; transition: opacity 0.3s ease, color 0.3s ease;
} }
/* Background transition */ /* Background transition */
+360
View File
@@ -0,0 +1,360 @@
# 💸 WhoPays - Who Pays Next?
Ein einfaches, elegantes Tool um zu entscheiden, wer als nächstes zahlt - mit Discord-Benachrichtigungen und PWA-Support!
![Version](https://img.shields.io/badge/version-1.0.0-blue)
![License](https://img.shields.io/badge/license-MIT-green)
![PWA](https://img.shields.io/badge/PWA-Ready-purple)
## 🎯 Features
- ✅ **Wechsel zwischen zwei Personen** - Einfacher Button-Klick
- 🎨 **Individuelle Farben & Namen** - Komplett anpassbar
- 📝 **Grund-Angabe** - Optional Grund für den Wechsel angeben
- 🔔 **Discord-Benachrichtigungen** - Automatische Webhooks mit farbigen Embeds
- 💾 **Persistenter Speicher** - Letzter Grund bleibt nach Container-Restart erhalten
- 📱 **PWA-Support** - Als App auf Handy & Desktop installierbar
- 🎭 **Animierte Übergänge** - Smooth Hintergrund- und Profilbild-Wechsel
- 🐳 **Docker-Ready** - Einfache Deployment mit Docker Compose
- 🔒 **Reverse-Proxy kompatibel** - Funktioniert mit Nginx, Caddy, Traefik, etc.
---
## 🚀 Quick Start
### Voraussetzungen
- Docker & Docker Compose
- Discord Webhook URL (optional)
- Profilbilder (a.png, b.png)
- Hintergrundbilder (bgA.jpg, bgB.jpg)
### Installation
```bash
# 1. Repository klonen oder Dateien herunterladen
git clone https://github.com/dein-username/whopays.git
cd whopays
# 2. Bilder hinzufügen
cp deine-bilder/* img/
# 3. config.js anpassen (siehe Konfiguration)
nano config.js
# 4. Docker Container starten
docker-compose up -d
# 5. Öffne http://localhost:3000
```
**Das war's!** 🎉
---
## ⚙️ Konfiguration
### config.js - Zentrale Konfiguration
Alle Einstellungen sind in **einer** Datei:
```javascript
// config.js
export const CONFIG = {
A: {
name: "Alice", // Name Person A
colorHex: "#2ecc71", // Farbe im Web (Grün)
colorDiscord: 0x2ecc71, // Farbe in Discord (gleich!)
icon: "a.png", // Profilbild
background: "bgA.jpg" // Hintergrundbild
},
B: {
name: "Bob", // Name Person B
colorHex: "#e74c3c", // Farbe im Web (Rot)
colorDiscord: 0xe74c3c, // Farbe in Discord (gleich!)
icon: "b.png", // Profilbild
background: "bgB.jpg" // Hintergrundbild
}
};
// Discord Webhook (optional)
export const DISCORD_WEBHOOK_URL = "https://discord.com/api/webhooks/...";
// Öffentliche URL (für Discord Thumbnails)
export const PUBLIC_BASE_URL = "https://your-domain.com";
```
### Farben ändern
```javascript
// Blau & Orange
A: { colorHex: "#3498db", colorDiscord: 0x3498db }
B: { colorHex: "#e67e22", colorDiscord: 0xe67e22 }
// Lila & Pink
A: { colorHex: "#9b59b6", colorDiscord: 0x9b59b6 }
B: { colorHex: "#e91e63", colorDiscord: 0xe91e63 }
// Türkis & Gold
A: { colorHex: "#1abc9c", colorDiscord: 0x1abc9c }
B: { colorHex: "#f39c12", colorDiscord: 0xf39c12 }
```
**Wichtig:** Hex-Farbe muss genau 6 Zeichen haben (0-9, A-F)!
---
## 📂 Projektstruktur
```
whopays/
├── config.js # Zentrale Konfiguration
├── server.js # Express Server
├── package.json # Node.js Dependencies
├── Dockerfile # Docker Build Instructions
├── docker-compose.yml # Docker Compose Config
├── state.json # Persistent State (auto-generiert)
│
└── public/ # Statische Dateien
├── index.html # Frontend HTML
├── script.js # Frontend JavaScript
├── style.css # CSS Animationen
├── manifest.json # PWA Manifest
├── service-worker.js # PWA Service Worker
│
└── img/ # Bilder
├── a.png # Profilbild Person A
├── b.png # Profilbild Person B
├── bgA.jpg # Hintergrund Person A
├── bgB.jpg # Hintergrund Person B
├── icon-192.png # PWA Icon (192x192)
└── icon-512.png # PWA Icon (512x512)
```
---
## 🐳 Docker Deployment
### docker-compose.yml
```yaml
version: '3.8'
services:
whopays:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- PORT=3000
- PUBLIC_BASE_URL=https://your-domain.com
- DISCORD_WEBHOOK_URL = "https://discord.com/api/webhooks/...";
volumes:
# Bilder (persistent)
- ./img:/app/public/img
# State (persistent über Neustarts)
- ./state.json:/app/state.json
restart: unless-stopped
```
### Befehle
```bash
# Container starten
docker-compose up -d
# Logs anschauen
docker-compose logs -f
# Container neustarten
docker-compose restart
# Container stoppen
docker-compose down
# Neu bauen (nach Code-Änderungen)
docker-compose down
docker-compose build --no-cache
docker-compose up -d
```
---
## 📱 PWA Installation
### iOS (Safari)
1. Öffne die Website in Safari
2. Tippe auf das **Teilen**-Symbol (⎙)
3. Scrolle und tippe **"Zum Home-Bildschirm"**
4. Tippe **"Hinzufügen"**
### Android (Chrome)
1. Öffne die Website in Chrome
2. Tippe auf **Menü** (⋮)
3. Tippe **"App installieren"**
4. Tippe **"Installieren"**
### Desktop (Chrome/Edge)
1. Öffne die Website
2. Klicke auf das **⊕ Icon** in der Adressleiste
3. Oder: Menü → "WhoPays installieren"
**Wichtig:** PWA funktioniert nur über HTTPS (oder localhost)!
---
## 🔒 Reverse Proxy Setup
### Nginx
```nginx
server {
listen 443 ssl http2;
server_name whopays.your-domain.com;
# PWA Files - NO AUTH
location ~ ^/(service-worker\.js|manifest\.json)$ {
proxy_pass http://localhost:3000;
proxy_set_header X-Forwarded-Proto $scheme;
add_header Service-Worker-Allowed "/" always;
}
# Main app
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
### Caddy (Einfachste Option!)
```caddy
whopays.your-domain.com {
reverse_proxy localhost:3000
}
```
Caddy macht automatisch HTTPS mit Let's Encrypt! ✅
---
## 🔧 API Endpoints
### GET /status
```bash
curl http://localhost:3000/status
```
Response:
```json
{
"current": "A",
"lastReason": "Pizza bestellt"
}
```
### POST /toggle
```bash
curl -X POST http://localhost:3000/toggle \
-H "Content-Type: application/json" \
-d '{"reason":"Kaffee trinken"}'
```
Response:
```json
{
"current": "B",
"name": "Bob",
"lastReason": "Kaffee trinken"
}
```
### GET /config
```bash
curl http://localhost:3000/config
```
---
## 🐛 Troubleshooting
### PWA lässt sich nicht installieren
- Stelle sicher, dass du HTTPS verwendest
- Prüfe ob `manifest.json` erreichbar ist
- Icons müssen existieren: `icon-192.png` und `icon-512.png`
### Discord sendet keine Benachrichtigungen
- Prüfe Webhook URL in `config.js`
- Logs prüfen: `docker-compose logs | grep Discord`
- Stelle sicher `PUBLIC_BASE_URL` ist korrekt
### Bilder werden nicht angezeigt
- Prüfe ob Bilder in `/img/` existieren
- Berechtigungen: `chmod -R 755 img/`
- Container neu starten
### Farbe in Discord ungültig (HTTP 400)
- Hex-Farbe muss genau 6 Zeichen haben
- ✅ Richtig: `0x2ecc71`
- ❌ Falsch: `0x2ecc71c` (extra Buchstabe!)
---
## 📊 Features im Detail
### Persistent Storage
```json
{
"current": "A",
"lastReason": "Restaurant bezahlt"
}
```
Bleibt erhalten durch Docker Volume Mount.
### Smooth Animations
- Rotation-Animation (0.6s)
- Background-Transition (0.6s)
- Farb-Übergang (0.3s)
- Image Preloading
---
## 📜 Lizenz
MIT License - Frei nutzbar!
---
## 💡 Tipps
### Custom Domain mit Let's Encrypt
```bash
sudo certbot --nginx -d whopays.your-domain.com
```
### Mehrere Instanzen
Unterschiedliche Ports in docker-compose.yml für mehrere Apps!
---
**Viel Spaß beim Entscheiden, wer zahlt!** 🎉💸
+62 -31
View File
@@ -2,6 +2,7 @@ import express from "express";
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
import { CONFIG, DISCORD_WEBHOOK_URL, PUBLIC_BASE_URL, PORT } from "./config.js";
const __filename = fileURLToPath(import.meta.url); const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename); const __dirname = path.dirname(__filename);
@@ -37,25 +38,6 @@ app.use(express.static(path.join(__dirname, "public"), {
const stateFile = path.join(__dirname, "state.json"); const stateFile = path.join(__dirname, "state.json");
// --------------------
// Konfiguration
// --------------------
const CONFIG = {
A: {
name: "Marc",
color: 0x2ecc71,
icon: "a.png"
},
B: {
name: "Laila",
color: 0xe74c3c,
icon: "b.png"
}
};
const PUBLIC_BASE_URL = process.env.PUBLIC_BASE_URL || "http://localhost:3000";
const DISCORD_WEBHOOK_URL = process.env.DISCORD_WEBHOOK_URL || "https://discord.com/api/webhooks/1450872860607381515/zRbiXOykKPUfLJ_H87wD2OxQJPLdro6yQzU2T48Pg4fxSNaXEqBFgxdHGTiIDmmKGHIF";
// -------------------- // --------------------
// State Handling - MIT PERSISTENT lastReason // State Handling - MIT PERSISTENT lastReason
// -------------------- // --------------------
@@ -103,21 +85,25 @@ async function sendDiscordEmbed(previousKey, currentKey, reason) {
const previous = CONFIG[previousKey]; const previous = CONFIG[previousKey];
const current = CONFIG[currentKey]; const current = CONFIG[currentKey];
if (!DISCORD_WEBHOOK_URL) return; if (!DISCORD_WEBHOOK_URL) {
console.log("⚠️ DISCORD_WEBHOOK_URL nicht gesetzt, keine Benachrichtigung gesendet");
return;
}
const fields = [ const fields = [
{ {
name: "Von", name: "Paid",
value: previous.name, value: previous.name,
inline: true inline: true
}, },
{ {
name: "Zu", name: "Now's turn",
value: current.name, value: current.name,
inline: true inline: true
} }
]; ];
// Grund hinzufügen falls vorhanden
if (reason) { if (reason) {
fields.push({ fields.push({
name: "📝 Grund", name: "📝 Grund",
@@ -127,9 +113,9 @@ async function sendDiscordEmbed(previousKey, currentKey, reason) {
} }
const embed = { const embed = {
title: "💸 Zahl-Wechsel", title: "💸 Pay-Switch",
description: `**${current.name}** ist jetzt dran zu zahlen`, description: `**${current.name}**'s turn`,
color: current.color, color: current.colorDiscord,
thumbnail: { thumbnail: {
url: `${PUBLIC_BASE_URL}/img/${current.icon}` url: `${PUBLIC_BASE_URL}/img/${current.icon}`
}, },
@@ -139,22 +125,56 @@ async function sendDiscordEmbed(previousKey, currentKey, reason) {
} }
}; };
// Debug-Ausgabe
console.log(`\n📤 Sende Discord Webhook:`);
console.log(` Von: ${previous.name} → Zu: ${current.name}`);
console.log(` Grund: ${reason || '(keiner)'}`);
console.log(` Farbe: 0x${current.colorDiscord.toString(16)}`);
console.log(` Webhook URL: ${DISCORD_WEBHOOK_URL.substring(0, 50)}...`);
try { try {
await fetch(DISCORD_WEBHOOK_URL, { const response = await fetch(DISCORD_WEBHOOK_URL, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ embeds: [embed] }) body: JSON.stringify({ embeds: [embed] })
}); });
console.log("✅ Discord Benachrichtigung gesendet");
if (response.ok) {
console.log(`✅ Discord Benachrichtigung gesendet (HTTP ${response.status})`);
} else {
const errorText = await response.text();
console.error(`❌ Discord Webhook Fehler (HTTP ${response.status}):`, errorText);
}
} catch (err) { } catch (err) {
console.error("❌ Discord Webhook Fehler:", err.message); console.error("❌ Discord Webhook Fehler:", err.message);
} }
console.log(""); // Leerzeile für bessere Lesbarkeit
} }
// -------------------- // --------------------
// API Routes // API Routes
// -------------------- // --------------------
// Config API endpoint - sendet Config an Frontend
app.get("/config", (req, res) => {
// Nur relevante Daten fürs Frontend senden
const frontendConfig = {
A: {
name: CONFIG.A.name,
colorHex: CONFIG.A.colorHex,
icon: CONFIG.A.icon,
background: CONFIG.A.background
},
B: {
name: CONFIG.B.name,
colorHex: CONFIG.B.colorHex,
icon: CONFIG.B.icon,
background: CONFIG.B.background
}
};
res.json(frontendConfig);
});
app.get("/status", (req, res) => { app.get("/status", (req, res) => {
const state = getState(); const state = getState();
res.json(state); res.json(state);
@@ -175,12 +195,12 @@ app.post("/toggle", async (req, res) => {
setState(state); setState(state);
const logMessage = reason const logMessage = reason
? `Zahl-Wechsel: ${CONFIG[previousKey].name} → ${CONFIG[state.current].name} (Grund: ${reason})` ? `Pay-Switch: ${CONFIG[previousKey].name} → ${CONFIG[state.current].name} (Grund: ${reason})`
: `Zahl-Wechsel: ${CONFIG[previousKey].name} → ${CONFIG[state.current].name}`; : `Pay-Switch: ${CONFIG[previousKey].name} → ${CONFIG[state.current].name} (kein Grund)`;
console.log(logMessage); console.log(logMessage);
// Discord Benachrichtigung // Discord Benachrichtigung - IMMER senden, auch ohne Grund!
await sendDiscordEmbed(previousKey, state.current, reason); await sendDiscordEmbed(previousKey, state.current, reason);
res.json({ res.json({
@@ -221,7 +241,6 @@ app.use((err, req, res, next) => {
// -------------------- // --------------------
// Start // Start
// -------------------- // --------------------
const PORT = process.env.PORT || 3000;
app.listen(PORT, "0.0.0.0", () => { app.listen(PORT, "0.0.0.0", () => {
console.log(`\n✅ WhoPays läuft auf http://0.0.0.0:${PORT}\n`); console.log(`\n✅ WhoPays läuft auf http://0.0.0.0:${PORT}\n`);
console.log(`📁 Static files directory: ${path.join(__dirname, "public")}`); console.log(`📁 Static files directory: ${path.join(__dirname, "public")}`);
@@ -233,6 +252,18 @@ app.listen(PORT, "0.0.0.0", () => {
console.log(` 👤 Wer zahlt: ${CONFIG[initialState.current].name}`); console.log(` 👤 Wer zahlt: ${CONFIG[initialState.current].name}`);
console.log(` 📝 Letzter Grund: ${initialState.lastReason || 'Keiner gespeichert'}`); console.log(` 📝 Letzter Grund: ${initialState.lastReason || 'Keiner gespeichert'}`);
console.log(`\n👥 Konfigurierte Personen:`);
console.log(` A: ${CONFIG.A.name} (${CONFIG.A.colorHex})`);
console.log(` B: ${CONFIG.B.name} (${CONFIG.B.colorHex})`);
// Discord Webhook Test
console.log(`\n🔔 Discord Webhook:`);
if (DISCORD_WEBHOOK_URL) {
console.log(` ✅ Konfiguriert: ${DISCORD_WEBHOOK_URL.substring(0, 50)}...`);
} else {
console.log(` ❌ NICHT konfiguriert!`);
}
// Verify critical files exist // Verify critical files exist
const criticalFiles = [ const criticalFiles = [
'public/index.html', 'public/index.html',