2dba6c3597529cc4f37446f529853c8c9bc820c1
A lightweight Express service that schedules and sends Firebase Cloud Messaging (FCM) push notifications to wake up registered devices.
Dev
cp .env.example .env
Edit .env — set FIREBASE_SERVICE_ACCOUNT_JSON
Here is one way to generate the contents: cat your-downloaded-key.json | jq -c .
pnpm install
pnpm run dev
The server starts on http://localhost:3000 (or the port in PORT). Hot-reloads on file changes.
Set NODE_ENV=test-local in .env to bypass JWT expiry verification during local development.
Production
Runs TypeScript directly via tsx (no compile step).
pnpm install --prod
pnpm start
Or with Docker:
docker build -t notification-wakeup-service .
docker run -e FIREBASE_SERVICE_ACCOUNT_JSON='...' -p 3000:3000 notification-wakeup-service
Required environment variables:
| Variable | Description |
|---|---|
FIREBASE_SERVICE_ACCOUNT_JSON |
Inline service account JSON (one line). If unset, falls back to Application Default Credentials. |
PORT |
HTTP port (default: 3000). |
FCM_TOKEN_DATA_DIR |
Directory for persisting registered FCM tokens (default: ./data). |
Description
Languages
TypeScript
99.2%
Dockerfile
0.8%