Implement tournament pairing functionality and enhance participant management

- Introduced new endpoints for managing tournament pairings, including creating, updating, and deleting pairings.
- Updated the tournament service to handle pairing logic, ensuring validation for participants and preventing duplicate pairings.
- Enhanced participant management by adding class-based checks for gender and age restrictions when adding participants.
- Updated the tournament controller and routes to support the new pairing features and improved participant handling.
- Added localization support for new UI elements related to pairings in the frontend, enhancing user experience.
This commit is contained in:
Torsten Schulz (local)
2025-11-29 00:15:01 +01:00
parent bdbbb88be9
commit dc2c60cefe
23 changed files with 4613 additions and 1100 deletions

View File

@@ -322,25 +322,40 @@ app.use((err, req, res, next) => {
// Erstelle HTTPS-Server für Socket.IO (direkt mit SSL)
const httpsPort = process.env.HTTPS_PORT || 3051;
try {
const httpsOptions = {
key: fs.readFileSync('/etc/letsencrypt/live/tt-tagebuch.de/privkey.pem'),
cert: fs.readFileSync('/etc/letsencrypt/live/tt-tagebuch.de/fullchain.pem')
};
const httpsServer = https.createServer(httpsOptions, app);
// Initialisiere Socket.IO auf HTTPS-Server
initializeSocketIO(httpsServer);
httpsServer.listen(httpsPort, '0.0.0.0', () => {
console.log(`🚀 HTTPS-Server für Socket.IO läuft auf Port ${httpsPort}`);
});
} catch (err) {
console.error('⚠️ HTTPS-Server konnte nicht gestartet werden:', err.message);
console.log(' → Socket.IO läuft auf HTTP-Server (nur für Entwicklung)');
// Fallback: Socket.IO auf HTTP-Server
let socketIOInitialized = false;
// Prüfe, ob SSL-Zertifikate vorhanden sind
const sslKeyPath = '/etc/letsencrypt/live/tt-tagebuch.de/privkey.pem';
const sslCertPath = '/etc/letsencrypt/live/tt-tagebuch.de/fullchain.pem';
if (fs.existsSync(sslKeyPath) && fs.existsSync(sslCertPath)) {
try {
const httpsOptions = {
key: fs.readFileSync(sslKeyPath),
cert: fs.readFileSync(sslCertPath)
};
const httpsServer = https.createServer(httpsOptions, app);
// Initialisiere Socket.IO auf HTTPS-Server
initializeSocketIO(httpsServer);
socketIOInitialized = true;
httpsServer.listen(httpsPort, '0.0.0.0', () => {
console.log(`🚀 HTTPS-Server für Socket.IO läuft auf Port ${httpsPort}`);
});
} catch (err) {
console.error('⚠️ HTTPS-Server konnte nicht gestartet werden:', err.message);
console.log(' → Socket.IO läuft auf HTTP-Server (nur für Entwicklung)');
}
} else {
console.log(' SSL-Zertifikate nicht gefunden - Socket.IO läuft auf HTTP-Server (nur für Entwicklung)');
}
// Fallback: Socket.IO auf HTTP-Server (wenn noch nicht initialisiert)
if (!socketIOInitialized) {
initializeSocketIO(httpServer);
console.log(' ✅ Socket.IO erfolgreich auf HTTP-Server initialisiert');
}
} catch (err) {
console.error('Unable to synchronize the database:', err);