feat: Initial project scaffold

Flask API backend for ESP32 sensor fleet:
- App factory pattern with blueprints
- SQLAlchemy 2.x models (Sensor, Device, Sighting, Alert, Event, Probe)
- UDP collector for sensor data streams
- REST API endpoints for sensors, devices, alerts, events, probes, stats
- pytest setup with fixtures
- Containerfile for podman deployment
- Makefile for common tasks
This commit is contained in:
user
2026-02-05 20:56:52 +01:00
commit a676136f5d
34 changed files with 1054 additions and 0 deletions

View File

@@ -0,0 +1 @@
"""API tests."""

View File

@@ -0,0 +1,21 @@
"""Sensor API tests."""
def test_list_sensors_empty(client):
"""Test listing sensors when empty."""
response = client.get('/api/v1/sensors')
assert response.status_code == 200
assert response.json == {'sensors': []}
def test_get_sensor_not_found(client):
"""Test getting non-existent sensor."""
response = client.get('/api/v1/sensors/nonexistent')
assert response.status_code == 404
def test_health_check(client):
"""Test health endpoint."""
response = client.get('/health')
assert response.status_code == 200
assert response.json == {'status': 'ok'}