Automatically sends FCM push notifications when matches go live.
- Install dependencies:
npm install-
Add Firebase service account:
- Copy your Firebase service account JSON file to this folder
- Rename it to
firebase-service-account.json
-
Configure environment:
- Copy
.env.exampleto.env - Add your Supabase URL and service role key
- Copy
-
Run locally:
npm start- Go to https://railway.app
- Sign up/login with GitHub
- Click "New Project" → "Deploy from GitHub repo"
- Select this repository
- Add environment variables:
SUPABASE_URLSUPABASE_SERVICE_KEY
- Upload
firebase-service-account.jsonas a file - Deploy!
The server will run 24/7 and automatically send notifications when matches go live.
- Checks every minute for matches that just started
- Sends FCM notification to all users with tokens
- Marks matches as "جارية الآن" (Live Now)
- Auto-updates match status to "انتهت" (Ended) after 2 hours