feat: add lottery results display page

- Add LOTTERY_RESULTS system phase
- Add /screen/lottery-results route
- Add LotteryResultsView component
- Add database connection management (db.ts)
- Update DrawResult schema to remove User relation
- Add awardIcon field to VoteResultsView

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
empty
2026-01-29 02:13:28 +08:00
parent 57cbaa5728
commit e211bb2130
9 changed files with 555 additions and 7 deletions

View File

@@ -2,6 +2,7 @@ import { createServer } from 'http';
import { app, logger } from './app';
import { config } from './config';
import { connectRedis } from './config/redis';
import { connectDatabase, disconnectDatabase } from './config/db';
import { initializeSocket } from './socket';
import { loadLuaScripts } from './services/vote.service';
import { loadVotingScripts } from './services/voting.engine';
@@ -11,6 +12,10 @@ import { participantService } from './services/participant.service';
async function main(): Promise<void> {
try {
// Connect to Database
logger.info('Connecting to Database...');
await connectDatabase();
// Connect to Redis
logger.info('Connecting to Redis...');
await connectRedis();
@@ -50,6 +55,9 @@ async function main(): Promise<void> {
const shutdown = async (signal: string) => {
logger.info({ signal }, 'Shutdown signal received');
// Disconnect from database
await disconnectDatabase();
httpServer.close(() => {
logger.info('HTTP server closed');
process.exit(0);