How soumyodipto68/live-location-tracker works
Live Location Tracker authenticates users with OIDC, accepts validated location updates over Socket.IO, and publishes them to Kafka. Kafka is the source of truth: one consumer deduplicates and rejects stale events before updating Redis and publishing broadcasts; the server relays those broadcasts to connected clients. A separate consumer handles location persistence/logging. The README documents the UI/map and consumer roles; unsampled UI behavior and deployment details are not inferred beyond that.
Main entry points: index.ts HTTP and Socket server · location-consumer.ts Broadcast consumer · redis.ts Redis clients · socket-handlers.ts Socket handlers
Components 18
Authentication
- Auth routes
src/routes/auth.ts - OIDC service
src/services/oidc.ts - Session middleware
src/lib/session.ts - Configuration
src/config.ts
Realtime location
- HTTP and Socket server
src/index.ts - Socket handlers
src/lib/socket-handlers.ts - Location validation
src/lib/location-validation.ts
State and processing
- Kafka client
src/lib/kafka-client.ts - Broadcast consumer
src/lib/location-consumer.ts - History processor
src/lib/database-processor.ts - Stale-user cleanup
src/lib/stale-user-cleanup.ts - Redis clients
src/lib/redis.ts
Client experience
- Map client
src/public/script.js
Other components
- User
- OIDC provider
- Kafka
- Redis
- Location database
Connections 26
- User → Map client: uses map
README.md - Map client → HTTP and Socket server: sends updates
README.md - HTTP and Socket server → Auth routes: mounts routes
src/index.ts - HTTP and Socket server → Session middleware: installs middleware
src/index.ts - Auth routes → OIDC service: requests OIDC
src/routes/auth.ts - OIDC service → Configuration: reads settings
src/services/oidc.ts - OIDC service → OIDC provider: discovers and exchanges
src/services/oidc.ts - HTTP and Socket server → Socket handlers: attaches handlers
src/index.ts - Socket handlers → Location validation: validates payload
src/lib/socket-handlers.ts - Socket handlers → Kafka client: publishes updates
- Socket handlers → Redis clients: reads and clears metadata
src/lib/socket-handlers.ts - HTTP and Socket server → Kafka client: creates consumers
src/index.ts - HTTP and Socket server → Broadcast consumer: starts consumer
src/index.ts - Broadcast consumer → Location validation: checks events
src/lib/location-consumer.ts - Broadcast consumer → Redis clients: deduplicates and updates
src/lib/location-consumer.ts - Broadcast consumer → Kafka: consumes updates
README.md - Broadcast consumer → Redis: stores state
src/lib/location-consumer.ts - Broadcast consumer → Redis clients: publishes broadcasts
src/lib/location-consumer.ts - HTTP and Socket server → Redis clients: subscribes to broadcasts
src/index.ts - HTTP and Socket server → Map client: relays location events
README.md - HTTP and Socket server → Stale-user cleanup: starts cleanup
src/index.ts - Stale-user cleanup → Redis clients: removes stale users
src/lib/stale-user-cleanup.ts - Stale-user cleanup → HTTP and Socket server: signals disconnect
src/index.ts - History processor → Kafka client: creates consumer
src/lib/database-processor.ts - History processor → Kafka: consumes updates
README.md - History processor → Location database: persists location history