confidence
From 0.0 to 1.0. How far to trust the level.
How it works
Nayki turns real-world signals into a risk level you can read, with the reasons beside it. This page explains the rules the backend follows and the shape of the system.
The risk model
Every route and area gets one of these, plus the numbers that explain it.
Fig. 3 How one route's level is built. Four signals fill the bars and the level and a confidence value follow. With no data at all the result is unknown, never safe. The values shown are examples, not real data.
Every answer carries its evidence
From 0.0 to 1.0. How far to trust the level.
How many records stand behind the answer.
unavailable, limited, moderate or strong.
The named reasons behind the level, from a fixed list.
When no evidence exists, the backend must return coverage_status: "unavailable", low confidence and a null score. It must never invent a high-safety claim to fill the gap.
Architecture
Kotlin and Jetpack Compose. Search, compare routes, see help nearby, report, trigger SOS.
Python 3.12, Pydantic v2, SQLAlchemy 2. Auth, routes, places, safety, incidents, SOS and privacy endpoints.
Spatial data on an H3 grid at resolution 9, with Redis for caching.
Clients for Google Places and Routes, GraphHopper, OpenStreetMap Overpass and Firebase push.
Privacy rules in the code
Exact latitude and longitude are stripped by log processors. Only H3 cells or general regions may be logged.
Client IP addresses are hashed with SHA-256 before they reach the audit table.
Nearby incidents are grouped onto H3 cells, so people who report a hazard are not pinpointed.
Endpoints for exporting your data and deleting your account, with device tokens revoked.
API surface
| Area | Path | Purpose |
|---|---|---|
| Health | /health | Service status. |
| Auth | /auth | Sign-in with Firebase tokens. A mock bypass exists for local development only. |
| Profile | /me | Profile, emergency contacts and devices. |
| Places | /places/search, /places/help | Destination search and nearby help. |
| Routes | /routes | Evaluate and compare routes. |
| Safety | /safety | Risk analysis and aggregated nearby data. |
| Reports | /reports | Crowd-sourced incident reports. |
| SOS | /sos | Create, cancel, respond to and close alerts. |
| Privacy | /privacy | Data export and account deletion. |