How githubtron/venueflow works
1. This is a TypeScript/Python monorepo for a real-time venue operations platform.
The repository is split into frontend apps, many small backend services, shared type definitions, and local infrastructure. Most backend services are independently deployable and each owns a narrow domain: auth, entry, notifications, wayfinding, analytics, emergency, staff, vendors, rewards, compliance, incidents, and ML/simulation.
2. The core event-data pipeline starts at the edge and fans out through Kafka.
The main operational flow is: IoT sensors send telemetry over MQTT into services/iot-gateway, which validates/normalizes payloads and publishes to Kafka. From there, downstream consumers like heatmap-engine, entry-router, rewards-service, and other event-driven services react to the same stream.
3. Heat and crowd intelligence is a dedicated real-time subsystem.
services/heatmap-engine is a Python FastAPI service with a Kafka consumer, an in-memory/Redis-backed store, aggregation/classification logic, and HTTP routes for reading computed heatmap state. The README’s architecture shows its output feeds Redis and then a WebSocket gateway, which is how live crowd state reaches clients.
4. Entry management is a separate transactional boundary.
services/entry-router handles ticket validation/scoring and writes entry events to PostgreSQL. It also has a Redis client and a red-zone subscriber, so it combines stateful checks with near-real-time gating decisions rather than relying only on the central telemetry stream.
5. Authentication and authorization are isolated in their own service.
services/auth-service owns login, JWT/keys, and RBAC middleware with a PostgreSQL migration. Frontends use auth-specific hooks/providers and guard components, so access control is enforced both in UI and at the API boundary.
6. Attendee and staff experiences are split into two client applications.
apps/mobile is a React Native app scaffold with screens for ticketing, navigation, kiosks, rewards, incident reporting, evacuation, and SOS. apps/dashboard is a React/Vite ops console with live maps, staff management, vendor views, compliance, emergency, and analytics pages. Both apps include WebSocket hooks for live updates.
7. Notifications are delivered through multiple channels behind one service.
services/notification-service centralizes delivery logic for WebSocket push, BLE mesh, staff radio, and segmented channels. That makes it the broadcast layer for alerts such as anomalies, emergencies, and targeted operational messages rather than embedding delivery logic in each domain service.
8. Operational domains are modeled as small services with their own storage.
There are dedicated services for staff management, vendor intelligence, kiosk orders, rewards, compliance, incidents, emergency coordination, and wayfinding. Most of these use PostgreSQL migrations and expose a narrow HTTP API; a few also consume Kafka or publish events. This keeps each business area independently evolvable.
9. Analytics and ML are isolated from the live control plane.
services/analytics-service, queue-predictor, sponsor-analytics, ml-pipeline, and simulation-service are separate Python FastAPI services for reporting, prediction, training, and synthetic event generation. services/threat-detection and services/external-integration extend the platform with risk detection and external feeds like traffic/weather. These services inform the product but are not in the critical ingress/egress path.
10. Shared contracts and infra are first-class parts of the architecture.
packages/shared-types holds cross-service TypeScript types, reducing drift across frontend and backend boundaries. infra/docker-compose.yml provides local Kafka/Postgres/Redis-style infrastructure, while infra/cdk contains planned cloud deployment stacks. The repo is therefore structured for local composition now, with a clear migration path to AWS-style managed infrastructure.
11. State is intentionally decentralized by domain.
PostgreSQL is used for transactional service-owned data, Redis for low-latency live state, Kafka for event distribution, and WebSockets for client push. The architecture avoids a single central application server; instead, it connects specialized services through well-defined data flows and shared event contracts.
12. Testing mirrors the service boundaries.
Most services include unit/property tests near the logic they own, and the Python services add Hypothesis-based property tests. That’s a signal that correctness is expected to be enforced per subsystem rather than through a single end-to-end test layer.
Main entry points: docker-compose.yml Compose infra · dashboard Dashboard · init-topics.sh Kafka bus · notification-service Notifications
Components 26
Client apps
End-user and operator interfaces
- Dashboard · Operations web console for maps, staff, vendors, compliance, emergencies, and analytics
apps/dashboard - Mobile app · Attendee and staff mobile app for tickets, navigation, rewards, incidents, and SOS
apps/mobile
Platform services
Domain services and event processors
- Auth service · Login, keys, JWT, and authorization middleware backed by PostgreSQL
services/auth-service - Event service · Event and venue event API with its own PostgreSQL schema
services/event-service - IoT gateway · Validates sensor telemetry and publishes normalized events to Kafka
services/iot-gateway - Heatmap engine · Consumes telemetry, aggregates heat state, stores live state, and serves heatmap reads
services/heatmap-engine - Entry router · Ticket validation and scoring with PostgreSQL entry events and Redis-backed gating state
services/entry-router - Notifications · Multi-channel alert delivery over WebSocket, BLE mesh, staff radio, and segmented channels
services/notification-service - Rewards · Rewards processing driven by Kafka event consumption
services/rewards-service - Staff management · Staff shifts, redeployment, incidents, and location operations with PostgreSQL storage
services/staff-management - Vendor intelligence · Vendor analytics, pricing, inventory, and SLA management with PostgreSQL storage
services/vendor-intelligence - Compliance · Capacity and compliance checks with its own schema
services/compliance-service - Incidents · Incident prioritization and incident data storage
services/incident-service - Emergency · Emergency and medical coordination plus Kafka event publication
services/emergency-coordinator - Kiosk orders · Kiosk ordering API backed by PostgreSQL
services/kiosk-service - Wayfinding · Pathfinding and navigation API over venue graphs
services/wayfinding-engine - External feeds · Adapts traffic and weather inputs into the platform
services/external-integration
Analytics and ML
Reporting, prediction, simulation, and risk analysis
- Analytics · Operational analytics, replay, and trend reporting
services/analytics-service - Queue predictor · Predicts queue behavior and schedules forecast runs
services/queue-predictor - Threat detection · Detects threats from platform and external signals
services/threat-detection - ML pipeline · Model training and pipeline orchestration
services/ml-pipeline - Simulation · Generates simulated venue events for testing and planning
services/simulation-service
Shared and infra
Cross-cutting contracts and local infrastructure
- Kafka bus · Shared event distribution layer for telemetry and downstream consumers
infra/kafka/init-topics.sh - Shared types · Cross-service TypeScript event and domain contracts
packages/shared-types - Compose infra · Local Kafka, PostgreSQL, and Redis-style development environment
infra/docker-compose.yml - CDK stacks · Planned AWS deployment and failover infrastructure
infra/cdk/stacks/ecs-autoscaling.ts
Connections 29
- Dashboard → Auth service: login/guards · Dashboard authenticates and authorizes via the auth service
- Mobile app → Auth service: login/guards · Mobile app uses auth for identity and access control
- Dashboard → Notifications: live updates · Dashboard receives pushed operational alerts and state changes
- Mobile app → Notifications: push/live · Mobile app receives live operational messages and alerts
- Dashboard → Heatmap engine: heatmap reads · Dashboard reads live crowd state for map visualizations
- Mobile app → Wayfinding: navigation · Mobile app requests navigation and routing guidance
- Mobile app → Kiosk orders: orders · Mobile app places and tracks kiosk orders
- Dashboard → Staff management: staff ops · Dashboard manages staff operations and redeployments
- Dashboard → Vendor intelligence: vendor ops · Dashboard views vendor intelligence and operations
- Dashboard → Compliance: compliance · Dashboard uses compliance and capacity views
- IoT gateway → Kafka bus: publish · Normalized telemetry is published to Kafka
- Kafka bus → Heatmap engine: consume · Heatmap engine consumes telemetry events from Kafka
- Kafka bus → Rewards: consume · Rewards service reacts to shared event streams
- Entry router → Shared types: contracts · Entry routing uses shared domain contracts
- Entry router → Compose infra: local deps · Entry routing depends on local database and cache infrastructure
- Heatmap engine → Notifications: state push · Computed crowd state can be forwarded to client push channels
- Entry router → Notifications: alerts · Entry decisions can trigger operational notifications
- Emergency → Notifications: broadcast · Emergency coordination uses the notification broadcast layer
- External feeds → Threat detection: feeds · External traffic and weather signals inform threat detection
- Analytics → Shared types: contracts · Analytics shares domain contracts with other services
- Queue predictor → Kafka bus: signals · Prediction inputs and outputs align with the event backbone
- Simulation → Kafka bus: synthetic events · Simulation can generate event traffic for downstream consumers
- Auth service → Compose infra: postgres · Auth service uses local database infrastructure
- Staff management → Compose infra: postgres · Staff service uses local database infrastructure
- Vendor intelligence → Compose infra: postgres · Vendor service uses local database infrastructure
- Compliance → Compose infra: postgres · Compliance service uses local database infrastructure
- Incidents → Compose infra: postgres · Incident service uses local database infrastructure
- Kiosk orders → Compose infra: postgres · Kiosk service uses local database infrastructure
- CDK stacks → Compose infra: migration path · CDK stacks represent the cloud deployment evolution of local infrastructure