How anshuman2810/ai-ticketing-system works
Project Type and Purpose
• This is a full-stack web application composed of:
• A React-based frontend (located in the frontend/ folder)
• A Node.js/Express backend (in backend/)
• An event-driven extensions layer using Inngest functions
• The app manages users and support tickets, triggering asynchronous workflows (e.g., sending emails, AI processing) on signup and ticket creation.
Main Components
a. Frontend (React + Vite + Tailwind)
b. Backend API (Express controller-route-model structure)
c. Database (e.g., MongoDB or SQL – implied by models/)
d. Inngest event bus and serverless functions
e. External services:
• Email service (via utils/mailer.js)
• AI service (via utils/ai.js)
• Any network calls (via utils/network.js)
Relationships and Data Flows
1. User/browser → Frontend UI
• Pages: login, signup, tickets list, ticket detail, admin
2. Frontend → Backend REST API
• Endpoints under /user and /ticket routes
• Auth middleware protects routes
3. Backend → Database
• models/user.js and models/ticket.js interact with DB
4. Backend → Inngest
• After database writes (signup or ticket creation), backend enqueues events to Inngest client
5. Inngest → Functions
• on-signup.js and on-ticket-create.js consume events
• Functions use AI and mailer utils to send emails or perform follow-up
6. External Services
• Mailer and AI utilities make outbound HTTP calls
Architectural Patterns and Design Principles
• MVC-style separation in backend:
• Models (backend/models)
• Controllers (backend/controllers)
• Routes (backend/routes)
• Middleware for authentication (backend/middlewares/auth.js)
• Event-driven asynchronous processing with Inngest (decouples side effects from core API)
• React component hierarchy with pages and shared components
4. Inside Backend, subdivide into:
– Routes layer (user.js, ticket.js)
– Controllers (user.js, ticket.js)
– Models (user.js, ticket.js)
– Middleware (auth)