Skip to content

File Index

Quick-reference index of key files in the project. One-line descriptions for fast navigation.

Root

FilePurpose
main.config.jsonCentral configuration for all services
main.config.sample.jsonExample configuration template
package.jsonMonorepo scripts (build, release, test)
tsconfig.jsonRoot TypeScript configuration

Server (server/)

FilePurpose
src/server.tsEntry point — loads config, starts all subsystems
src/routes/http.tsAll HTTP route definitions (~3800 lines)
src/routes/ws.tsWebSocket subscription handlers
src/mqtt.tsMQTT message dispatcher to bridge/devices/events
src/tracking.tsZone prediction from RSSI data, tracking logs
src/events.tsPanic buttons, SOS, sensor alerts, KISS, ntfy.sh
src/cache.tsIn-memory beacon state (active, KISS, last-seen)
src/devices.tsDevice sync from MQTT to database
src/bridge.tsZabbix/LLD bridge mode
src/guard.tsJWT auth guards (admin, auth, db)
src/schemas.tsValibot schemas for DB query results
src/validate.tsRequest validation helpers
src/static_embeds.tsEmbedded web UI files (generated)
src/migration_embeds.tsEmbedded migrations (generated)
src/algs/tracking_alg_zone_voting.tsZone voting tracking algorithm
src/algs/tracking_alg_trilateration.tsTrilateration tracking algorithm
src/algs/tracking_alg_brutus.tsBrutus (enhanced) tracking algorithm
migrations/001-029_*.tsDatabase migration files

Web (web/)

FilePurpose
src/web.tsEntry point — router (login vs dashboard)
build.tsBuild script with config injection
src/pages/dashboard.tsMain dashboard (logs, events, status, QR)
src/pages/login.tsLogin form and JWT auth
src/pages/beacons.tsBeacon CRUD management
src/pages/gateways.tsGateway CRUD management
src/pages/users.tsUser account management
src/pages/locations.tsLocation management
src/pages/maps.tsMap image management
src/pages/zones.tsZone editor + live tracking (Pixi.js)
src/pages/navigation.tsNavigation graph editor (Pixi.js)
src/lib/contracts.tsValibot API schemas for all endpoints
src/lib/socket.tsWebSocket client
src/lib/canvas.tsPixi.js canvas for zones and tracking
src/lib/util.tsDOM helpers, auth, notifications
src/lib/image.tsImage loading utilities
src/templates/HTML template files by feature

Mobile (mobile/)

FilePurpose
lib/main.dartEntry point — MaterialApp with HomeScreen
lib/screens/home_screen.dartServer connection, bundle sync, QR scanning
lib/screens/qr_scanner_screen.dartQR code scanner UI
lib/screens/navigation_screen.dartMain navigation UI with map and controls
lib/services/api_client.dartHTTP client (auth, bundle, pathfinding)
lib/services/ble_scanner.dartBLE beacon scanning with RSSI buffer
lib/models/navigation_data.dartDomain models (Bundle, Floor, Node, Edge, Beacon)
lib/core/navigation_graph.dartDijkstra pathfinding and spatial queries
lib/core/positioning.dartBLE RSSI → 2D position (trilateration)
lib/game/navigation_game.dartFlame map renderer (pan, zoom, player, path)
pubspec.yamlFlutter dependencies
test/contract_test.dartServer ↔ mobile API contract tests

Lib (lib/)

FilePurpose
src/schemas.tsValibot schemas (MQTT, KISS, LLD, WebSocket)
src/db.tsSQLite init and migrations
src/http.tsBun HTTP server setup
src/mqtt.tsMQTT client (connect, subscribe, parse)
src/jose.tsJWT key generation, signing, verification
src/rs.tsHTTP response helpers with CORS
src/generic.tsBeacon validation, JSON parse, dev mode
src/kiss.tsKISS API integration
src/zabbix.tsZabbixSender class
src/beacon.tsBeacon UUID validation
src/ip.tsIP/subnet utilities
src/server.tsServer response helpers
src/client.tsFrontend assertion helpers
src/types/query.d.tsAll database entity types
src/types/enums.tsShared enumerations

Scripts (scripts/)

FilePurpose
build/all.shFull build (server + mobile)
build/server.shServer build only
build/mobile.shMobile build only
build/generators/embeds.tsEmbed web build into server
build/generators/installer.tsGenerate installer script
build/templates/installer.shInstaller template
release/server.tsServer release pipeline (test, bump, build, commit)
release/mobile.tsMobile release pipeline
test/contracts.tsContract test orchestrator
test/binary.shCompiled binary smoke tests
test/vm.shFull VM integration test suite
cli/main.tsCLI entry point
cli/config.tsConfig commands
cli/setup.tsSetup wizard
cli/system.tsSystem commands (service, nginx, cron)
cli/user.tsUser management commands
cli/selftest.tsDeployment health checks
cli/monit.tsMonit monitoring setup