How pragadheeshpandian1906/gate-security-system works
SmartGuard AI combines a role-based security dashboard, a main FastAPI service for identity and access decisions, and an independent IoT service that dispatches commands to an ESP32. The principal workflow is dashboard request → backend verification and access decision → IoT command → controller acknowledgement; reported state does not verify physical gate position. The README and source index establish the service boundaries and major capabilities, but many route and service implementations were not excerpted, so their internal links are omitted or marked unverified.
Main entry points: main.py API and routes · access_decision_service.py Access decisions · SecurityDashboard.tsx Role dashboards · client.ts HTTP client
Components 20
Security dashboard
- Role dashboards
frontend/src/pages/security/SecurityDashboard.tsx - Session and roles
frontend/src/context/AuthContext.tsx - HTTP client
frontend/src/api/client.ts
Main backend
- API and routes
backend/app/main.py - Identity and accounts
backend/app/services/account_service.py - Face and vehicle checks
backend/app/api/routes/ai_verify.py - Access decisions
backend/app/services/access_decision_service.py - Schedules and watchlists
backend/app/services/schedule_service.py - Visitor passes
backend/app/services/visitor_service.py - Alerts and reports
backend/app/api/routes/alerts.py - Notifications
backend/app/services/notification_service.py - Gate service bridge
backend/app/services/gate_service.py - Database sessions
backend/app/db/session.py - Security records
backend/app/models/access.py - File storage
backend/app/services/storage_service.py
IoT controller
- Command and status API
iot-service/app/api/routes.py - Device manager
iot-service/app/services/device_manager.py
Other components
- Security staff
- Supabase services
- ESP32 controller
Connections 21
- Security staff → Role dashboards: uses
README.md - Role dashboards → HTTP client: requests data
frontend/src/pages/security/SecurityDashboard.tsx - Role dashboards → Session and roles: reads session
frontend/src/pages/security/SecurityDashboard.tsx - Session and roles → HTTP client: stores bearer token
- HTTP client → API and routes: HTTP requests
README.md - API and routes → Identity and accounts: routes auth
backend/app/main.py - API and routes → Face and vehicle checks: routes verification
backend/app/main.py - API and routes → Access decisions: routes access
backend/app/main.py - API and routes → Visitor passes: routes visitors
backend/app/main.py - Access decisions → Schedules and watchlists: checks policies
backend/app/services/access_decision_service.py - Access decisions → Gate service bridge: requests gate action
backend/app/services/access_decision_service.py - Access decisions → Alerts and reports: raises alerts
backend/app/services/access_decision_service.py - API and routes → Alerts and reports: routes alerts
backend/app/main.py - Notifications → Supabase services: emails via provider
- Gate service bridge → Command and status API: HTTP commands
README.md - Command and status API → Device manager: dispatches commands
iot-service/app/api/routes.py - Device manager → ESP32 controller: WebSocket commands
README.md - ESP32 controller → Device manager: reports state
README.md - Database sessions → Security records: persists records
- Database sessions → Supabase services: PostgreSQL connection
README.md - File storage → Supabase services: uploads files
backend/app/services/storage_service.py