Refacor electron app and add migrations

This commit is contained in:
2026-03-04 01:38:43 +01:00
parent 4e95ae77c5
commit be91b6dfe8
70 changed files with 1824 additions and 923 deletions

Binary file not shown.

View File

@@ -19,7 +19,7 @@ const PORT = process.env.PORT || 3001;
app.use(cors());
app.use(express.json());
// In-memory runtime state (WebSocket connections only not persisted)
// In-memory runtime state (WebSocket connections only - not persisted)
interface ConnectedUser {
oderId: string;
ws: WebSocket;
@@ -49,8 +49,10 @@ import {
JoinRequest
} from './db';
function hashPassword(pw: string) { return crypto.createHash('sha256').update(pw)
.digest('hex'); }
function hashPassword(pw: string) {
return crypto.createHash('sha256')
.update(pw)
.digest('hex'); }
// REST API Routes
@@ -476,6 +478,7 @@ function handleWebSocketMessage(connectionId: string, message: any): void {
serverId: viewSid,
users: viewUsers
}));
break;
}
@@ -514,6 +517,7 @@ function handleWebSocketMessage(connectionId: string, message: any): void {
...message,
fromUserId: user.oderId
}));
console.log(`Successfully forwarded ${message.type} to ${message.targetUserId}`);
} else {
console.log(`Target user ${message.targetUserId} not found. Connected users:`,