Appearance
File Index
Quick-reference index of key files in the project. One-line descriptions for fast navigation.
Root
| File | Purpose |
|---|---|
main.config.json | Central configuration for all services |
main.config.sample.json | Example configuration template |
package.json | Monorepo scripts (build, release, test) |
tsconfig.json | Root TypeScript configuration |
Server (server/)
| File | Purpose |
|---|---|
src/server.ts | Entry point — loads config, starts all subsystems |
src/routes/http.ts | All HTTP route definitions (~3800 lines) |
src/routes/ws.ts | WebSocket subscription handlers |
src/mqtt.ts | MQTT message dispatcher to bridge/devices/events |
src/tracking.ts | Zone prediction from RSSI data, tracking logs |
src/events.ts | Panic buttons, SOS, sensor alerts, KISS, ntfy.sh |
src/cache.ts | In-memory beacon state (active, KISS, last-seen) |
src/devices.ts | Device sync from MQTT to database |
src/bridge.ts | Zabbix/LLD bridge mode |
src/guard.ts | JWT auth guards (admin, auth, db) |
src/schemas.ts | Valibot schemas for DB query results |
src/validate.ts | Request validation helpers |
src/static_embeds.ts | Embedded web UI files (generated) |
src/migration_embeds.ts | Embedded migrations (generated) |
src/algs/tracking_alg_zone_voting.ts | Zone voting tracking algorithm |
src/algs/tracking_alg_trilateration.ts | Trilateration tracking algorithm |
src/algs/tracking_alg_brutus.ts | Brutus (enhanced) tracking algorithm |
migrations/001-029_*.ts | Database migration files |
Web (web/)
| File | Purpose |
|---|---|
src/web.ts | Entry point — router (login vs dashboard) |
build.ts | Build script with config injection |
src/pages/dashboard.ts | Main dashboard (logs, events, status, QR) |
src/pages/login.ts | Login form and JWT auth |
src/pages/beacons.ts | Beacon CRUD management |
src/pages/gateways.ts | Gateway CRUD management |
src/pages/users.ts | User account management |
src/pages/locations.ts | Location management |
src/pages/maps.ts | Map image management |
src/pages/zones.ts | Zone editor + live tracking (Pixi.js) |
src/pages/navigation.ts | Navigation graph editor (Pixi.js) |
src/lib/contracts.ts | Valibot API schemas for all endpoints |
src/lib/socket.ts | WebSocket client |
src/lib/canvas.ts | Pixi.js canvas for zones and tracking |
src/lib/util.ts | DOM helpers, auth, notifications |
src/lib/image.ts | Image loading utilities |
src/templates/ | HTML template files by feature |
Mobile (mobile/)
| File | Purpose |
|---|---|
lib/main.dart | Entry point — MaterialApp with HomeScreen |
lib/screens/home_screen.dart | Server connection, bundle sync, QR scanning |
lib/screens/qr_scanner_screen.dart | QR code scanner UI |
lib/screens/navigation_screen.dart | Main navigation UI with map and controls |
lib/services/api_client.dart | HTTP client (auth, bundle, pathfinding) |
lib/services/ble_scanner.dart | BLE beacon scanning with RSSI buffer |
lib/models/navigation_data.dart | Domain models (Bundle, Floor, Node, Edge, Beacon) |
lib/core/navigation_graph.dart | Dijkstra pathfinding and spatial queries |
lib/core/positioning.dart | BLE RSSI → 2D position (trilateration) |
lib/game/navigation_game.dart | Flame map renderer (pan, zoom, player, path) |
pubspec.yaml | Flutter dependencies |
test/contract_test.dart | Server ↔ mobile API contract tests |
Lib (lib/)
| File | Purpose |
|---|---|
src/schemas.ts | Valibot schemas (MQTT, KISS, LLD, WebSocket) |
src/db.ts | SQLite init and migrations |
src/http.ts | Bun HTTP server setup |
src/mqtt.ts | MQTT client (connect, subscribe, parse) |
src/jose.ts | JWT key generation, signing, verification |
src/rs.ts | HTTP response helpers with CORS |
src/generic.ts | Beacon validation, JSON parse, dev mode |
src/kiss.ts | KISS API integration |
src/zabbix.ts | ZabbixSender class |
src/beacon.ts | Beacon UUID validation |
src/ip.ts | IP/subnet utilities |
src/server.ts | Server response helpers |
src/client.ts | Frontend assertion helpers |
src/types/query.d.ts | All database entity types |
src/types/enums.ts | Shared enumerations |
Scripts (scripts/)
| File | Purpose |
|---|---|
build/all.sh | Full build (server + mobile) |
build/server.sh | Server build only |
build/mobile.sh | Mobile build only |
build/generators/embeds.ts | Embed web build into server |
build/generators/installer.ts | Generate installer script |
build/templates/installer.sh | Installer template |
release/server.ts | Server release pipeline (test, bump, build, commit) |
release/mobile.ts | Mobile release pipeline |
test/contracts.ts | Contract test orchestrator |
test/binary.sh | Compiled binary smoke tests |
test/vm.sh | Full VM integration test suite |
cli/main.ts | CLI entry point |
cli/config.ts | Config commands |
cli/setup.ts | Setup wizard |
cli/system.ts | System commands (service, nginx, cron) |
cli/user.ts | User management commands |
cli/selftest.ts | Deployment health checks |
cli/monit.ts | Monit monitoring setup |