Appearance
Project Overview
SafeCall is a comprehensive indoor location tracking and safety system for enterprises. It consists of four main components organized as a monorepo.
Architecture
┌─────────────────┐
│ main.config │
│ .json │
└────────┬────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ lib/ │◄──│ server/ │ │ web/ │
│ (shared TS) │ │ (Bun API) │ │ (Frontend) │
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘
│ │ │
│ └─────────┬─────────┘
│ │
│ ┌────────▼────────┐
│ │ Web embedded │
│ │ in server bin │
│ └─────────────────┘
│
▼
┌───────────────┐
│ mobile/ │
│ (Flutter) │ ← Contract tests validate API ↔ Dart models
└───────────────┘Components
| Component | Directory | Tech Stack | Purpose |
|---|---|---|---|
| Server | server/ | Bun, TypeScript, SQLite | Backend API, MQTT bridge, tracking algorithms |
| Web | web/ | TypeScript, Bulma, Pixi.js | Admin UI for management and monitoring |
| Mobile | mobile/ | Flutter, Flame, Dart | Indoor navigation app with BLE positioning |
| Lib | lib/ | TypeScript, Valibot | Shared schemas, DB, HTTP, MQTT, JWT utilities |
| Scripts | scripts/ | Bash, TypeScript | Build, release, install, and CLI tooling |
Data Flow
- BLE Beacons broadcast advertisement packets (adv1/adv4/adv8)
- Gateways receive beacon signals and forward them via MQTT
- Server processes MQTT messages for tracking, events, and device sync
- Web UI displays real-time tracking, manages infrastructure via HTTP/WebSocket
- Mobile App scans BLE beacons directly for indoor navigation and pathfinding
Monorepo Scripts
All scripts are run from the project root with bun:
| Command | Description |
|---|---|
bun commit | Server release pipeline (version bump, test, build, commit, push) |
bun release:mobile | Mobile release pipeline (test, bump, build, commit, push) |
bun build | Build everything (server binaries + mobile apps) |
bun build:server | Build server binaries only |
bun build:mobile | Build mobile apps only (AAB + IPA) |
bun test:contracts | Run contract tests (server ↔ mobile API validation) |
bun docs:dev | Start docs dev server |
bun docs:build | Build docs static site |
Configuration
The project uses a single main.config.json file at the root. Each service uses its directory name as a prefix for its configuration keys. See the Configuration page for details.