How fastbit-ljb/traffic_detection_core works
This is a web-based intelligent traffic detection and task-management system. Users interact with a React dashboard to submit detection work and manage traffic-related resources; the FastAPI backend runs detection and manages persistent history, video, dataset, training, and model operations. The README documents account-scoped records, real-time updates, adaptive signal management, and model comparison. Those are represented as capabilities, but some route and frontend wiring was not sampled, so uncertain links are omitted or marked dashed.
Main entry points: main.py FastAPI routes · TrafficDashboard.tsx Traffic dashboard · project_service.py Project repository · middleware.py Request middleware
Components 22
Web interface
- Traffic dashboard
frontend/src/components/TrafficDashboard.tsx - Pill navigation
frontend/src/components/PillNav.tsx - Device switch
frontend/src/components/ui/GooeyDeviceSwitch.tsx - Elastic slider
frontend/src/components/ui/ElasticSlider.tsx
API and security
- FastAPI routes
backend/app/main.py - Request middleware
backend/app/middleware.py - Authentication and security
backend/app/core/security.py - Traffic data models
backend/app/models/traffic_models.py
Traffic intelligence
- Vehicle detector
backend/app/services/intelligent_vehicle_detector.py - Adaptive signal manager
backend/app/services/adaptive_traffic_manager.py - Traffic analytics
backend/app/services/analytics_service.py
Projects and persistence
- Project repository
backend/app/services/project_service.py - Dataset import
backend/app/services/project_service.py - Training and validation
backend/app/services/project_service.py - Video detection jobs
backend/app/services/project_service.py - Detection history
backend/app/services/project_service.py
Runtime support
- Application configuration
backend/app/core/config.py - Application logging
backend/app/core/logger.py - Prometheus metrics
backend/app/core/metrics.py
Other components
- Traffic operator
- YOLO model weights
backend/models/trained_28068449.pt - Browser client
Connections 26
- Traffic operator → Traffic dashboard: uses
README.md - Traffic dashboard → Pill navigation: renders
frontend/src/components/TrafficDashboard.tsx - Traffic dashboard → Device switch: renders
frontend/src/components/TrafficDashboard.tsx - Traffic dashboard → Elastic slider
frontend/src/components/TrafficDashboard.tsx - Traffic dashboard → FastAPI routes: sends requests
- Browser client → FastAPI routes: connects
README.md - FastAPI routes → Request middleware: processes requests
backend/app/main.py - FastAPI routes → Vehicle detector: calls detection
backend/app/main.py - FastAPI routes → Project repository: reads and writes
backend/app/main.py - FastAPI routes → Prometheus metrics: serves metrics
backend/app/main.py - FastAPI routes → Authentication and security: authenticates users
backend/app/main.py - FastAPI routes → Adaptive signal manager: dispatches traffic operations
backend/app/main.py - FastAPI routes → Traffic analytics: requests analytics
backend/app/main.py - Vehicle detector → Traffic data models: produces detection data
backend/app/services/intelligent_vehicle_detector.py - Adaptive signal manager → Traffic data models: uses traffic models
backend/app/services/adaptive_traffic_manager.py - Vehicle detector → YOLO model weights: loads weights
- Project repository → Detection history: stores records
backend/app/services/project_service.py - Project repository → Dataset import: imports datasets
backend/app/services/project_service.py - Project repository → Training and validation: manages jobs
backend/app/services/project_service.py - Project repository → Video detection jobs: manages jobs
backend/app/services/project_service.py - Video detection jobs → Vehicle detector: runs detection
backend/app/services/project_service.py - Request middleware → Authentication and security: checks rate limits
backend/app/middleware.py - Request middleware → Application logging: logs requests
backend/app/middleware.py - Request middleware → Prometheus metrics: records metrics
backend/app/middleware.py - Application logging → Application configuration: reads settings
backend/app/core/logger.py - Authentication and security → Application configuration: reads settings
backend/app/core/security.py