Testing and debugging¶
This page is the operational test and triage playbook for the current stack.
When to use this page¶
Use this page when validating local changes, checking runtime health, or diagnosing user-facing failures across API, telemetry, and monitoring.
Audience¶
- Developers debugging service behaviour.
- Operators triaging local or cluster-like environments.
Test commands¶
Backend¶
Expected result: lint exits with status 0, and tests complete without failures.
Frontend¶
Expected result: no lint errors, passing tests, and a successful production build.
Repository pre-commit gate¶
Runtime health checks¶
docker compose exec mqtt-proxy wget -qO- http://localhost:8010/health
docker compose exec mqtt-proxy wget -qO- http://localhost:8010/ready
docker compose exec mqtt-proxy wget -qO- http://localhost:8010/ready/bridge
docker compose exec db-sync wget -qO- http://localhost:8009/health
docker compose exec db-sync wget -qO- http://localhost:8009/ready/schema
/ready/bridge reflects the configured bridge mode; a disabled bridge is not the same as a broken ingestion service.
Log inspection¶
Tail critical services:
Inspect recent output for one service:
Debug flows by symptom¶
Frontend loads but charger data is empty¶
- Confirm that
VITE_API_URLis reachable from the frontend runtime. - Check Gateway liveness at http://localhost:8000/health.
- Check TACTIC readiness at http://localhost:8001/ready.
- Inspect Gateway and TACTIC logs for the upstream error.
Monitoring start fails¶
-
Confirm that the model registry is populated:
-
List existing services and look for sensors already claimed:
-
Confirm TACTIC readiness.
- Inspect TACTIC logs for validation, Docker API, image, or network failures.
Telemetry is not arriving¶
- Verify that the source publisher or simulator is active.
- Confirm that its topic matches
device/evCharger/<charger_id>/<telemetry_type>and theMQTT_SOURCE_TOPICSfilter. - Check proxy health and readiness.
- Inspect proxy logs for parsing, authentication, or database-write errors.
- Query the Gateway telemetry endpoint.
Evidence or anomalies are missing¶
- Verify that the monitor workload exists.
- Confirm that data reaches its EMQX topic.
- Allow static calibration or adaptive warm-up to complete.
-
Query evidence and anomaly counts:
-
Inspect RADAR logs for model or persistence errors.
Service addresses — local default¶
| Component | Address or port |
|---|---|
| Frontend | 5173 |
| API Gateway | 8000 |
| TACTIC | 8001 |
| DB Sync | Internal 8009 |
| MQTT Proxy health | Internal 8010 |
| PostgreSQL/TimescaleDB | 5432 |
| EMQX MQTT | 1883 |
| Source broker MQTT | 1884, host loopback |
| EMQX dashboard | 18083 |
| Mailpit UI / SMTP | 8025 / 1025 |