- C# 93.2%
- Shell 6.3%
- Dockerfile 0.5%
| .claude | ||
| .config | ||
| .github/workflows | ||
| deploy | ||
| docs | ||
| src | ||
| tools | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitignore | ||
| Alerting.sln | ||
| Directory.Build.props | ||
| Directory.Build.targets | ||
| Directory.Packages.props | ||
| global.json | ||
| README.md | ||
| TODO.txt | ||
urgentsms
Emergency SMS alerts for a school. Start with the documentation index for the architecture, requirements and deployment guides.
Build
Install the .NET 10 SDK (including the ASP.NET Core runtime and targeting pack):
dotnet build Alerting.sln
Migrations: dotnet tool restore, then dotnet ef migrations add <Name> --project src/Alerting.Server --output-dir Data/Migrations. A new synced table also needs ChangeSequence.AddTriggers in its migration (docs/03-data-model.md, Sync columns).
The mobile heads need their workloads. Without one, the head builds as an empty stub and the build prints a message:
| Head | Built when | Force with |
|---|---|---|
Alerting.UI.Android |
the android workload is installed |
-p:BuildAndroidHead=true (needs a JDK and the Android SDK) |
Alerting.UI.iOS |
building on macOS | -p:BuildIosHead=true (needs the ios workload and Xcode) |
Alerting.UI.Desktop |
always (Windows target, builds on any OS) | — |
Spike build: -c Spike replaces the main screen with the M1 developer screen: unlock the encrypted database and send test SMS to a local staff list. See docs/spike/m1-device-checklist.md. It is never shipped.
iOS on Linux or Windows: dotnet build tools/IosTypeCheck compiles the iOS head against the iOS reference assembly, so iOS type errors show without a Mac.
Directory.Build.targets enforces the project layering from docs/01-architecture.md. A forbidden ProjectReference fails the build with ALERT001.
Host stack
cd deploy
cp .env.example .env
./init-secrets.sh --dev
docker compose up -d --build --wait
curl -k https://localhost/health # Healthy
migrate applies the database migrations and exits, then api starts and creates the root account from secrets/root_initial_password. Sign in as root with that password to set a new password.
Local test server
The repository provides a local server override for manual app checks. It runs the API in Development, exposes HTTP only on 127.0.0.1:8080, and sets SMSAPI test mode. It is not a description of any shared test or staging server. Do not use the override for staging or production.
cd deploy
docker compose -f docker-compose.yml -f docker-compose.test-server.yml up -d --build --wait
curl -fsS http://127.0.0.1:8080/health
cd ..
tools/seed-test-server.sh
The seed script creates local accounts and sample school data on a fresh stack and prints the resulting login details. It needs the root password from deploy/secrets/root_initial_password; an existing database whose root password has changed may need manual setup. The sample data uses fictional phone numbers. SMSAPI test mode applies to host sends; an Android phone can still send through its SIM during fallback, so use only safe test recipients.
For a Debug Android build over USB, build with -p:AlertingHostUrl=http://localhost:8080, run adb reverse tcp:8080 tcp:8080, and install the resulting APK. The local HTTP address is accepted only by Debug builds. See the test-server Compose override for the exact settings.
Staging and production: deploy/staging-setup.md, deploy/production-setup.md. Releases: deploy/scripts/release.sh <tag>; tools/scan-images.sh <version> checks the images for known vulnerabilities.
Release (M9): what is left before production, and who does it, is in docs/release/checklist.md.
Operations (M8): backups and restore tests in deploy/backup-and-restore.md, monitoring and alert emails in deploy/monitoring.md, app updates in deploy/app-updates.md, iPhones in deploy/ios-adhoc.md, and phone provisioning with deploy/scripts/provision-android.sh. A local rehearsal of backups and alerts uses deploy/docker-compose.rehearsal.yml.
Import dry run of a file kept outside the repository, as Root or an Admin: tools/import-dry-run.sh https://<host> <file> [Upsert|FullSync] (docs/06-import.md).
Drills on staging (Root or an Admin): deploy/scripts/test-dispatch.sh https://<host> sends a preset to every parent with SMSAPI's test=1. deploy/scripts/staff-live-send.sh https://<host> staff.txt sends live, only if every parent's number is a staff number (docs/10-deployment-and-operations.md).