TicketFlow is a distributed, microservice-based support ticket ecosystem. It leverages Artificial Intelligence for automated ticket triaging, distributed caching for high performance, and an event-driven architecture (Kafka) to deliver real-time WebSocket notifications to end-users.
The ecosystem consists of a React client and two Spring Boot microservices, heavily integrated with cloud infrastructure hosted on Aiven and AI models provided by Groq.
[ React Frontend ]
β
(HTTP API) β (WebSockets / STOMP)
βββββββββββββββββββββ΄ββββββββββββββββββββ
βΌ βΌ
[ Ticket Backend ] [ Realtime Service ]
(Port 8080 - Main API) (Port 8081 - Notifications)
β β
βββΊ (Prompts) ββββββββΊ [ Groq AI (Llama 3) ]
β β
βββΊ (Publishes) ββββββΊ [ Apache Kafka ] βββΊ (Consumes)
β β
βββΊ (Read/Write) βββββΊ [ PostgreSQL ] βββ€ (Read-Only)
β
βββΊ (Caches Tokens) ββΊ [ Redis/Valkey ]
This monorepo contains three core applications. See their individual README.md files for deeper technical details:
/ticket-backend: The primary API. Handles stateless JWT authentication, AI auto-triaging, CRUD operations, and publishes system events to Kafka./realtime-service: An event-driven microservice. Consumes Kafka topics and pushes live updates to the React frontend via WebSockets./ticket-frontend: The React 19/Vite client interface. Features role-based routing (Admin vs. User), dynamic Recharts dashboards, and dual-Axios configuration.
| Domain | Technologies |
|---|---|
| Frontend | React 19, Vite, Tailwind CSS v4, shadcn/ui, Recharts |
| Backends | Java 21, Spring Boot 3.3, Spring Security, Spring WebSockets |
| Artificial Intelligence | Spring AI, Groq (llama-3.3-70b-versatile) |
| Message Broker | Apache Kafka (Aiven Cloud) |
| Database & Cache | PostgreSQL, Redis/Valkey (Aiven Cloud) |
| Deployment | Docker, Docker Compose |
The entire ecosystem is fully containerized. You do not need to install Java, Node, or databases on your local machine to run the project.
- Docker Desktop installed and running.
- Cloud instances of PostgreSQL, Redis, and Kafka (e.g., via Aiven Free Tier).
- A free API key from Groq.
Create a .env file in this root directory. Docker will automatically inject these variables into your containers.
# --- Frontend URL ---
FRONTEND_URL=http://localhost:3000
VITE_API_BASE_URL=http://localhost:8080/api
VITE_NOTIFICATION_API_URL=http://localhost:8081/api/notifications
VITE_WEBSOCKET_URL=http://localhost:8081/ws
# --- Aiven Database ---
DB_URL=jdbc:postgresql://<your-aiven-db-url>?user=avnadmin&password=<password>&sslmode=require
# --- Aiven Redis Cache ---
REDIS_URL=rediss://default:<password>@<your-aiven-redis-url>
# --- Aiven Kafka Cluster ---
KAFKA_SERVERS=<your-aiven-kafka-url>:25311
KAFKA_USERNAME=avnadmin
KAFKA_API_SECRET=<your-kafka-password>
# --- AI & Security ---
GROQ_API_KEY=<your-groq-key>
JWT_SECRET=<your-secure-random-jwt-secret>
# --- Email Notifications (Optional) ---
MAIL_USERNAME=<your-gmail-address>
MAIL_PASSWORD=<your-gmail-app-password>
Open your terminal in this root folder and run:
docker compose up -d --build
Once Docker indicates all containers are running, the ecosystem is live at:
- π₯οΈ Web Application:
http://localhost:3000 - βοΈ Backend API / Swagger Docs:
http://localhost:8080/swagger-ui.html - π WebSocket Tunnel (Realtime Service):
http://localhost:8081
The application is architected to run seamlessly in the cloud, utilizing a modern, decoupled deployment strategy:
- Frontend: Hosted on Vercel for global CDN edge delivery and native React/Vite support.
- Microservices: Deployed as independent Docker Web Services on Render.
- Infrastructure: PostgreSQL, Redis, and Apache Kafka are managed securely via Aiven.
- WebSockets over HTTPS: The frontend utilizes the secure WebSocket protocol (
wss://) to negotiate connections with the deployed real-time service via SockJS. - Database Connection Pooling: HikariCP is explicitly constrained (
SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=3) to prevent max-connection exhaustion on hobby-tier cloud databases. - Secret Injection: The
.pemcertificates required for Kafka SSL validation are injected securely via Render's Secret Files at runtime, bypassing classpath limitations. - CORS: Spring Boot instances are strictly configured to accept preflight requests and credentials exclusively from the Vercel production domain.
Rehan Naikwadi
GitHub: @rehann07
This project is licensed under the MIT License.
See the LICENSE file for full details.