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:
25
src/esp32_web/config.py
Normal file
25
src/esp32_web/config.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Application configuration."""
|
||||
import os
|
||||
|
||||
|
||||
class Config:
|
||||
"""Base configuration."""
|
||||
SECRET_KEY = os.environ.get('SECRET_KEY', 'dev-key-change-me')
|
||||
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite:///esp32.db')
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
|
||||
# Network
|
||||
UDP_LISTEN_PORT = int(os.environ.get('UDP_PORT', 5500))
|
||||
SENSOR_CMD_PORT = int(os.environ.get('CMD_PORT', 5501))
|
||||
SENSOR_TIMEOUT = int(os.environ.get('SENSOR_TIMEOUT', 60))
|
||||
|
||||
|
||||
class TestConfig(Config):
|
||||
"""Testing configuration."""
|
||||
TESTING = True
|
||||
SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:'
|
||||
|
||||
|
||||
class ProdConfig(Config):
|
||||
"""Production configuration."""
|
||||
pass
|
||||
Reference in New Issue
Block a user