Introduces WebSocket connectivity for live data updates and a new subscription model for events. Key changes: - Integrated WebSocketService to handle open, message, and close events via the /ws endpoint. - Added EventSubscribeService APIs to manage user subscriptions to specific events (matchId) via REST endpoints (`/api/subscribe-event` and `/api/subscribe-event/:matchId`). - Implemented custom message protocol (JSON format) for WebSocket communication with defined topics (ONLINE_MEMBER_CHANGE, etc.). - Updated database schema to include the `EventSubs` model for storing subscriptions. - Refactored Dockerfile to use `bun prisma db push` for database migrations on startup. - UI Updates: - Replaced the Rate component in FavButton with Star icons for better UX. - Adjusted layout of FavButton to be absolute positioned. - Added debounce to ClubSummary data fetching. - Removed unused `isMobile` import from ClubSummary. - Utilities: Added helper functions `toCustomMessage` and `fromCustomMessage` for parsing WebSocket messages.
8 lines
222 B
SQL
8 lines
222 B
SQL
-- CreateTable
|
|
CREATE TABLE `EventSubs` (
|
|
`logto_uid` VARCHAR(191) NOT NULL,
|
|
`event_id` VARCHAR(191) NOT NULL,
|
|
|
|
PRIMARY KEY (`logto_uid`, `event_id`)
|
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|