A real-time public transportation monitoring and notification system built with modern web technologies. The system tracks transit lines, processes events in real-time, and provides instant notifications about delays, cancellations, and service disruptions.
- Real-time transit event monitoring
- Live service health dashboard
- Station-specific event tracking
- Email notifications for service disruptions
- Incident Reporting
- Node.js + Express
- Apache Kafka for event streaming
- Apache Cassandra for event storage
- Docker & Docker Compose
- Next.js 13+
- Tailwind CSS
- shadcn/ui components
- Server-Sent Events (SSE) for real-time updates
- Docker and Docker Compose
- Node.js 18+ and npm
- Git
- Clone the repository:
git clone <https://github.com/luanled/transit-notification>
cd transit-notification- Create environment files:
Create .env in the root directory:
NODE_ENV=development
CASSANDRA_HOST=cassandra
CASSANDRA_PORT=9042
CASSANDRA_KEYSPACE=transit_system
CASSANDRA_DC=datacenter1
CASSANDRA_USERNAME=cassandra
CASSANDRA_PASSWORD=cassandra- Start the Docker containers:
docker-compose up -dThis will start:
- Kafka broker
- Zookeeper
- Cassandra database
- Kafka UI (available at http://localhost:8989)
- Install backend dependencies:
cd backend
npm install- Install frontend dependencies:
cd frontend
npm install- Start the backend server:
cd backend
npm startThe backend will be available at http://localhost:3000
- Start the frontend development server:
cd frontend
npm run devThe frontend will be available at http://localhost:8080
- Kafka UI: http://localhost:8989
- Monitor Kafka topics, consumers, and messages
- Backend API Documentation: http://localhost:3000
- Lists all available API endpoints
- Events are generated by the mock event generator (in development) or real transit system
- Events are published to Kafka topics based on transit lines (BLUE, GREEN, ORANGE)
- Stream processor consumes events and updates real-time analytics
- Events are stored in Cassandra for persistence
- Frontend receives updates via SSE connection
- Cassandra stores all transit events and subscriber information
- Events are partitioned by transit line for efficient querying
- Subscription data is indexed by station for quick notification processing
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop all services
docker-compose down
# Rebuild services
docker-compose up -d --build
# Remove volumes (will delete all data)
docker-compose down -v


