Migrated APIs Overview
These APIs have been fully migrated to Cloudflare Workers and are live in production.
Infrastructure
| Component | Technology |
|---|---|
| Runtime | Cloudflare Workers |
| Database | Cloudflare D1 (SQLite) |
| Storage | Cloudflare R2 |
| Framework | Hono + tRPC |
Available APIs
Authentication (auth.*)
Full authentication system with JWT tokens.
| Procedure | Type | Auth Required |
|---|---|---|
auth.login | Mutation | No |
auth.register | Mutation | No |
auth.me | Query | Yes |
auth.changePassword | Mutation | Yes |
auth.logout | Mutation | Yes |
Sensors (sensors.*)
Manage traffic sensors and devices.
| Procedure | Type | Auth Required |
|---|---|---|
sensors.getAllSensors | Query | Yes |
sensors.getSensorById | Query | Yes |
sensors.createSensor | Mutation | Yes |
sensors.updateSensor | Mutation | Yes |
sensors.deleteSensor | Mutation | Yes |
sensors.getSensorStatus | Query | Yes |
Reports (reports.*)
Generate and retrieve traffic reports.
| Procedure | Type | Auth Required |
|---|---|---|
reports.getViolationStats | Query | Yes |
reports.getTrafficFlow | Query | Yes |
reports.getSensorHealth | Query | Yes |
reports.getIncidentSummary | Query | Yes |
reports.exportReport | Mutation | Yes |
System (system.*)
System configuration and health.
| Procedure | Type | Auth Required |
|---|---|---|
system.getLicense | Query | No |
system.timezone.getTimezoneSettings | Query | No |
system.timezone.updateTimezoneSettings | Mutation | Yes |
system.health | Query | No |
system.getSettings | Query | No |
Storage (storage.*)
File upload and management with R2.
| Procedure | Type | Auth Required |
|---|---|---|
storage.getStats | Query | No |
Locations (locations.*)
Manage physical locations and intersections.
| Procedure | Type | Auth Required |
|---|---|---|
locations.getAll | Query | No |
locations.getById | Query | No |
locations.create | Mutation | Yes |
locations.update | Mutation | Yes |
locations.delete | Mutation | Yes |
locations.getTypes | Query | No |
Events (events.*)
Traffic events and violation tracking.
| Procedure | Type | Auth Required |
|---|---|---|
events.ingest | Mutation | API Key |
events.getAll | Query | Yes |
events.getById | Query | Yes |
events.getRecent | Query | Yes |
events.getStats | Query | Yes |
events.delete | Mutation | Yes |
Image Processor (traffic.imageProcessor.*)
ANPR integration, violation detection, and event routing.
| Procedure | Type | Auth Required |
|---|---|---|
traffic.imageProcessor.processImage | Mutation | API Key |
traffic.imageProcessor.getAPIHealth | Query | No |
traffic.imageProcessor.resetAPIHealth | Mutation | Yes |
traffic.imageProcessor.getPendingStats | Query | No |
traffic.imageProcessor.getPendingEvents | Query | Yes |
traffic.imageProcessor.processPendingEvents | Mutation | Yes |
traffic.imageProcessor.retryFailedEvents | Mutation | Yes |
traffic.imageProcessor.getSpeedThreshold | Query | No |
traffic.imageProcessor.setLocationSpeedThreshold | Mutation | Yes |
traffic.imageProcessor.getViolationStats | Query | Yes |
Users (users.*)
User management and access control.
| Procedure | Type | Auth Required |
|---|---|---|
users.getAll | Query | Admin |
users.getById | Query | Yes |
users.create | Mutation | Admin |
users.update | Mutation | Yes |
users.delete | Mutation | Admin |
users.getProfile | Query | Yes |
users.getRoles | Query | Admin |
Settings (settings.*)
System configuration and feature flags.
| Procedure | Type | Auth Required |
|---|---|---|
settings.getAll | Query | Yes |
settings.update | Mutation | Admin |
settings.getPublic | Query | No |
settings.getFeatureFlags | Query | No |
Performance
All migrated APIs benefit from:
- Edge deployment - Runs in 300+ Cloudflare locations worldwide
- Low latency - Typically < 50ms response time
- Auto-scaling - Handles traffic spikes automatically
- DDoS protection - Built-in Cloudflare security