feat: Implement alert creation service with FCM notifications

- Add AlertCreationService to handle alert creation and notifications.
- Implement idempotency key support to prevent duplicate alerts.
- Create alert notification service for sending FCM messages.
- Add tests for alert creation and notification services.
- Document FCM notification flow and alert creation process.
This commit is contained in:
2026-07-11 01:18:18 +03:00
parent 93b266f26d
commit ddd67f438b
18 changed files with 1662 additions and 46 deletions

View File

@@ -5,6 +5,22 @@ DB_PASSWORD=your_secure_password_here
API_KEY_SALT=generate_random_salt_with_openssl
CORS_ORIGIN=http://localhost:3001
# Backend runtime (used when starting backend directly, outside Docker Compose)
PORT=3000
DATABASE_URL=postgresql://transit_admin:your_secure_password_here@localhost:5432/polotsk_transit
REDIS_URL=redis://localhost:6379
JWT_SECRET=replace_with_a_long_random_string
# Firebase Cloud Messaging (server-side alert notifications)
# Keep disabled to run without Firebase credentials.
FCM_ENABLED=false
FCM_TOPIC=route_alerts
FCM_ANDROID_CHANNEL_ID=route_alerts
FIREBASE_PROJECT_ID=
# Standard Application Default Credentials path. Store the JSON file outside
# the repository and leave this empty while FCM_ENABLED=false.
GOOGLE_APPLICATION_CREDENTIALS=
# Bootstrap admin
BOOTSTRAP_ADMIN=true
BOOTSTRAP_ADMIN_RESET_PASSWORD=false