Symfony/API Platform backend for device identity, fall-alert persistence, caregiver linking, push notification delivery, and alert acknowledgement.
- Register protected-person and caregiver devices.
- Authenticate device API calls with bearer device tokens.
- Persist fall alerts submitted by the protected-person phone app.
- Link caregiver devices through short-lived invite codes.
- Store caregiver push tokens.
- Dispatch backend-owned push notifications for linked caregivers.
- Persist push delivery attempts for auditability.
- Track caregiver acknowledgement of alerts.
Caregiver escalation is push-notification based.
watch detects fall
-> phone owns countdown through AlertCoordinator
-> timeout submits /api/v1/fall-alerts
-> backend persists FallAlert
-> backend dispatches SendFallAlertPushMessage
-> Messenger handler sends push to linked caregiver devices
-> caregiver can acknowledge the alert
Backend business code is organized by domain under src/Domain.
src/
├── Domain/
│ ├── Alert/
│ │ ├── Handler/
│ │ ├── Message/
│ │ ├── Port/
│ │ ├── Processor/
│ │ ├── Provider/
│ │ ├── Request/
│ │ ├── Response/
│ │ └── Service/
│ ├── Caregiver/
│ ├── Debug/
│ ├── Device/
│ ├── Healthcheck/
│ └── Push/
├── Entity/
├── Enum/
└── Infrastructure/
Common flow:
Request/*InputDTO
-> Processor or Provider
-> Service or Handler
-> Port
-> Infrastructure adapter
-> Entity / database / gateway
-> Response/*OutputDTO
POST /api/v1/devices/registerPOST /api/v1/fall-alertsGET /api/v1/fall-alerts/{id}POST /api/v1/fall-alerts/{clientAlertId}/cancelPOST /api/v1/invitesPOST /api/v1/invites/{code}/acceptPOST /api/v1/caregiver/push-tokenGET /api/v1/caregiver/alertsPOST /api/v1/fall-alerts/{id}/acknowledgeGET /health
Development/debug:
GET /debug/fake-pushis available outside production when the fake push provider is configured.
make up
make test-unit
make test-integration
make test-behat
make analyse
make lint-dryUseful direct commands:
vendor/bin/phpunit --testsuite=unit
vendor/bin/phpunit --testsuite=integration
vendor/bin/behat --config behat.yaml.dist --colors
vendor/bin/phpstan analyse --no-progress --memory-limit=-1
vendor/bin/php-cs-fixer fix --dry-run --diff --verbose --sequentialCore environment variables:
APP_SECRETDATABASE_URLMESSENGER_TRANSPORT_DSNAPP_SHARE_DIRPUSH_PROVIDER(fakeorfcm)FCM_PROJECT_IDFCM_SERVICE_ACCOUNT_JSON
The fake push provider writes messages under var/share/fake_push_inbox.jsonl.