Kafka Restaurant Comment Analytics
Project Description
This is a proof-of-concept microservices platform that demonstrates real-time sentiment analysis of restaurant comments using Apache Kafka event streaming. The system simulates collecting comments from social media platforms, processing them through a sentiment analysis service, and displaying results in a live dashboard.
Goal
The goal of this PoC is to demonstrate:
- Event-driven architecture patterns using Apache Kafka for reliable message flow
- Microservices communication via Kafka topics and gRPC
- Real-time data processing with deduplication and retry mechanisms
- Live dashboard updates using Server-Sent Events (SSE)
- Edge case handling including failures, duplicates, and rate limiting
System at a Glance
The platform consists of 5 microservices working together:
- Producer - Generates mock restaurant comments (Twitter, Instagram, Facebook, TikTok)
- Consumer - Processes comments with deduplication and sentiment analysis
- Sentiment - gRPC service that classifies comment sentiment
- API - Serves processed data via REST and SSE
- Dashboard - React UI for real-time visualization
Technology Stack
- Message Broker: Apache Kafka 4.0.2 (KRaft mode)
- Backend: NestJS 10, TypeScript, gRPC
- Database: PostgreSQL 17, Redis 7.2
- Frontend: React 19, TanStack (Router/DB/Table), Recharts
- Container: Docker Compose
Quick Start
# Install dependencies
pnpm install
# Start all services
pnpm docker:up
# Access dashboard
open http://localhost:3000Next Steps
- Getting Started - Understand data flow and setup
- Setup Guide - Detailed stack explanation
- Producer Service - Learn how comments are generated
- Consumer Service - Understand processing pipeline
- Sentiment Service - gRPC sentiment analysis
- API & SSE - REST endpoints and real-time streaming
- Frontend - Dashboard and state management