## Backend Changes - Add new API endpoints: combustible, pois, mantenimiento, video, configuracion - Fix vehiculos endpoint to return paginated response with items array - Add /vehiculos/all endpoint for non-paginated list - Add /geocercas/all endpoint - Add /alertas/configuracion GET/PUT endpoints - Add /viajes/activos and /viajes/iniciar endpoints - Add /reportes/stats, /reportes/templates, /reportes/preview endpoints - Add /conductores/all and /conductores/disponibles endpoints - Update router.py to include all new modules ## Frontend Changes - Fix authentication token handling (snake_case vs camelCase) - Update vehiculosApi.listAll to use /vehiculos/all - Fix FuelGauge component usage in Combustible page - Fix chart component exports (named + default exports) - Update API client for proper token refresh ## Infrastructure - Rename services from ADAN to ATLAS - Configure Cloudflare tunnel for atlas.consultoria-as.com - Update systemd service files - Configure PostgreSQL with TimescaleDB - Configure Redis, Mosquitto, Traccar, MediaMTX ## Documentation - Update installation guides - Update API reference - Rename all ADAN references to ATLAS Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
198 lines
7.3 KiB
Plaintext
198 lines
7.3 KiB
Plaintext
# =============================================================================
|
|
# Atlas Fleet Monitor - Environment Variables
|
|
# =============================================================================
|
|
# Copy this file to .env and fill in your values
|
|
# NEVER commit the .env file to version control
|
|
# =============================================================================
|
|
|
|
# =============================================================================
|
|
# Application Settings
|
|
# =============================================================================
|
|
APP_NAME="Atlas Fleet Monitor"
|
|
APP_VERSION="1.0.0"
|
|
ENVIRONMENT=development # development, staging, production
|
|
DEBUG=true
|
|
HOST=0.0.0.0
|
|
PORT=8000
|
|
WORKERS=4 # Number of workers for production
|
|
|
|
# =============================================================================
|
|
# API Settings
|
|
# =============================================================================
|
|
API_V1_PREFIX=/api/v1
|
|
|
|
# =============================================================================
|
|
# Database (PostgreSQL with TimescaleDB)
|
|
# =============================================================================
|
|
# Format: postgresql+asyncpg://user:password@host:port/database
|
|
DATABASE_URL=postgresql+asyncpg://atlas:your_password_here@localhost:5432/atlas_fleet
|
|
|
|
# Database pool settings
|
|
DB_POOL_SIZE=20
|
|
DB_MAX_OVERFLOW=10
|
|
DB_POOL_TIMEOUT=30
|
|
|
|
# =============================================================================
|
|
# Redis (Caching & Real-time)
|
|
# =============================================================================
|
|
# Format: redis://[:password@]host:port/db
|
|
REDIS_URL=redis://localhost:6379/0
|
|
|
|
# =============================================================================
|
|
# JWT Authentication
|
|
# =============================================================================
|
|
# Generate with: openssl rand -hex 32
|
|
SECRET_KEY=your_super_secret_key_change_this_in_production_minimum_32_characters
|
|
JWT_ALGORITHM=HS256
|
|
ACCESS_TOKEN_EXPIRE_MINUTES=30
|
|
REFRESH_TOKEN_EXPIRE_DAYS=7
|
|
|
|
# =============================================================================
|
|
# Password Hashing
|
|
# =============================================================================
|
|
PASSWORD_MIN_LENGTH=8
|
|
|
|
# =============================================================================
|
|
# CORS Settings
|
|
# =============================================================================
|
|
# Comma-separated list of allowed origins
|
|
CORS_ORIGINS=http://localhost:3000,http://localhost:5173,http://127.0.0.1:3000
|
|
CORS_ALLOW_CREDENTIALS=true
|
|
CORS_ALLOW_METHODS=GET,POST,PUT,PATCH,DELETE,OPTIONS
|
|
CORS_ALLOW_HEADERS=*
|
|
|
|
# =============================================================================
|
|
# Traccar GPS Server Integration
|
|
# =============================================================================
|
|
TRACCAR_URL=http://localhost:8082
|
|
TRACCAR_API_URL=http://localhost:8082/api
|
|
TRACCAR_USERNAME=admin
|
|
TRACCAR_PASSWORD=admin
|
|
TRACCAR_ENABLED=true
|
|
|
|
# =============================================================================
|
|
# MediaMTX Video Streaming Server
|
|
# =============================================================================
|
|
MEDIAMTX_URL=http://localhost:8554
|
|
MEDIAMTX_API_URL=http://localhost:9997
|
|
MEDIAMTX_ENABLED=false
|
|
|
|
# =============================================================================
|
|
# MQTT Broker (IoT Communication)
|
|
# =============================================================================
|
|
MQTT_BROKER=localhost
|
|
MQTT_PORT=1883
|
|
MQTT_USERNAME=
|
|
MQTT_PASSWORD=
|
|
MQTT_ENABLED=false
|
|
|
|
# Meshtastic MQTT Topic
|
|
MESHTASTIC_TOPIC=meshtastic/#
|
|
|
|
# =============================================================================
|
|
# Email (SMTP)
|
|
# =============================================================================
|
|
SMTP_HOST=smtp.gmail.com
|
|
SMTP_PORT=587
|
|
SMTP_USERNAME=
|
|
SMTP_PASSWORD=
|
|
SMTP_FROM_EMAIL=noreply@example.com
|
|
SMTP_FROM_NAME="Atlas Fleet Monitor"
|
|
SMTP_TLS=true
|
|
SMTP_ENABLED=false
|
|
|
|
# =============================================================================
|
|
# Push Notifications (Firebase)
|
|
# =============================================================================
|
|
FIREBASE_CREDENTIALS_PATH=
|
|
FIREBASE_ENABLED=false
|
|
|
|
# =============================================================================
|
|
# Geocoding & Maps
|
|
# =============================================================================
|
|
# OpenStreetMap Nominatim (free, rate-limited)
|
|
NOMINATIM_USER_AGENT=atlas-fleet-monitor
|
|
|
|
# Google Maps API (optional, for premium geocoding)
|
|
GOOGLE_MAPS_API_KEY=
|
|
|
|
# =============================================================================
|
|
# File Storage
|
|
# =============================================================================
|
|
UPLOAD_DIR=./uploads
|
|
MAX_UPLOAD_SIZE_MB=50
|
|
|
|
# AWS S3 (optional, for cloud storage)
|
|
AWS_ACCESS_KEY_ID=
|
|
AWS_SECRET_ACCESS_KEY=
|
|
AWS_S3_BUCKET=
|
|
AWS_S3_REGION=us-east-1
|
|
|
|
# =============================================================================
|
|
# Logging
|
|
# =============================================================================
|
|
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL
|
|
LOG_FORMAT=json # json, text
|
|
LOG_FILE=./logs/atlas.log
|
|
|
|
# =============================================================================
|
|
# Sentry (Error Tracking)
|
|
# =============================================================================
|
|
SENTRY_DSN=
|
|
SENTRY_ENVIRONMENT=development
|
|
SENTRY_ENABLED=false
|
|
|
|
# =============================================================================
|
|
# Rate Limiting
|
|
# =============================================================================
|
|
RATE_LIMIT_REQUESTS=100
|
|
RATE_LIMIT_PERIOD_SECONDS=60
|
|
|
|
# =============================================================================
|
|
# Background Tasks (Celery)
|
|
# =============================================================================
|
|
CELERY_BROKER_URL=redis://localhost:6379/1
|
|
CELERY_RESULT_BACKEND=redis://localhost:6379/2
|
|
CELERY_ENABLED=false
|
|
|
|
# =============================================================================
|
|
# Alert Settings
|
|
# =============================================================================
|
|
# Default speed limit (km/h) for new vehicles
|
|
DEFAULT_SPEED_LIMIT=120
|
|
|
|
# Time without signal before generating alert (seconds)
|
|
NO_SIGNAL_THRESHOLD_SECONDS=300
|
|
|
|
# Battery level threshold for low battery alert (%)
|
|
LOW_BATTERY_THRESHOLD=20
|
|
|
|
# Minimum stop duration to register as a stop (seconds)
|
|
MIN_STOP_DURATION_SECONDS=120
|
|
|
|
# =============================================================================
|
|
# Trip Detection
|
|
# =============================================================================
|
|
# Minimum movement to start a trip (meters)
|
|
TRIP_START_DISTANCE_METERS=100
|
|
|
|
# Minimum idle time to end a trip (seconds)
|
|
TRIP_END_IDLE_SECONDS=300
|
|
|
|
# =============================================================================
|
|
# WebSocket Settings
|
|
# =============================================================================
|
|
WS_HEARTBEAT_INTERVAL=30
|
|
WS_MAX_CONNECTIONS=1000
|
|
|
|
# =============================================================================
|
|
# Report Settings
|
|
# =============================================================================
|
|
REPORTS_OUTPUT_DIR=./reports
|
|
REPORTS_RETENTION_DAYS=90
|
|
|
|
# =============================================================================
|
|
# Timezone
|
|
# =============================================================================
|
|
TIMEZONE=America/Mexico_City
|