Go to file
kyuuseiryuu defd95c218 refactor(push): unify notification payload structure and handling
Refactor the notification handling logic to use a unified `topic` based payload structure. This change replaces the flat `NotificationData` interface with a typed `topic` and `data` separation, enabling stricter type checking for different notification types (e.g., `SERVER_PUSH`).

Key changes:
- Updated `NotificationData` type to include `topic` and `data` fields, referencing `TopicPayload`.
- Modified `sw.js` to parse incoming `MessagePayload` using `fromMessagePayload`, ensuring the topic is `SERVER_PUSH` before extracting `title` and `options`.
- Renamed internal types in `utils/common.ts` to `ServerSendTopicPayload` and `Topics` for clarity.
- Updated `firebase-admin.ts` to wrap data in a `payload` JSON string before sending to Firebase Cloud Messaging, and added logic to clean up unregistered tokens.
- Added backward compatibility support for older clients by sending a secondary legacy-formatted message when a `SERVER_PUSH` topic is detected.
- Moved `NOTIFICATION_TOKEN_KEY` constant to `utils/constants.ts` and updated related hooks to use it for consistency.
- Updated `logger.ts` to comment out file logging during development/testing to reduce disk I/O.

This refactor improves type safety, reduces code duplication in payload handling, and ensures better compatibility between the web client and the service worker.
2026-03-27 01:05:01 +09:00
__test__ refactor(service, routes, types): extract match summary and link to club 2026-03-25 23:20:33 +09:00
.vscode feat(global): find user 2026-02-10 11:11:08 +09:00
assets feat(app): add push notification support and event management logic 2026-03-24 17:21:50 +09:00
prisma feat(app): add push notification support and event management logic 2026-03-24 17:21:50 +09:00
src refactor(push): unify notification payload structure and handling 2026-03-27 01:05:01 +09:00
.env.example feat: implement user favorite player system with Logto sync 2026-03-09 10:16:27 +09:00
.gitignore chore: add .continue directory to gitignore 2026-03-24 21:11:49 +09:00
bun-env.d.ts init 2026-01-29 22:00:49 +09:00
bun.lock feature: logger 2026-03-26 17:40:44 +09:00
bunfig.toml init 2026-01-29 22:00:49 +09:00
docker-compose.yml chore(docker): mount local time and timezone to container 2026-03-24 20:26:14 +09:00
dockerfile chore(docker): switch base image to dhi.io/bun:1-debian13-dev 2026-03-25 01:17:25 +09:00
package.json feature: logger 2026-03-26 17:40:44 +09:00
prisma.config.ts feat: implement user favorite player system with Logto sync 2026-03-09 10:16:27 +09:00
README.md chore(README): update readme 2026-03-26 20:06:40 +09:00
tsconfig.json refactor(global): import alias @ 2026-03-26 15:54:42 +09:00

My-Kaiqiuwang

To install dependencies:

bun install

To start a development server:

bun dev

To run for production:

bun start

This project was created using bun init in bun v1.2.21. Bun is a fast all-in-one JavaScript runtime.

Database

Prisma

设计阶段

bun --env-file=.env.development prisma db push

开发阶段, 生成代码

bun --env-file=.env.development prisma generate

在开发环境生成 migration 文件

bun --env-file=.env.development prisma migrate dev --name=<name>

同步到测试环境,跑测试用例用(如果需要的话)

bun --env-file=.env.test prisma migrate deploy