A full‑stack ticket management system with AI‑assisted triage. The backend (Node.js/Express + MongoDB) exposes REST APIs and background jobs via Inngest; the frontend is a React app (Vite + Tailwind CSS + DaisyUI).
IT-Ticket/
ai-ticket-assistant/ # Backend (Express, MongoDB, Inngest)
ai-ticket-frontend/ # Frontend (React + Vite + Tailwind)
- Node.js 18+ and npm
- A MongoDB connection string
- Mailtrap (or SMTP) credentials for email
- Google Gemini API key for AI triage (via Inngest Agent Kit)
- Install dependencies
cd ai-ticket-assistant
npm install- Create a
.envfile
# Server
PORT=5000
MONGO_URI=mongodb+srv://<username>:<password>@<cluster>/<db>?retryWrites=true&w=majority
JWT_SECRET=replace-with-a-strong-secret
# AI (Gemini)
GEMINI_API_KEY=your-gemini-api-key
# Mail (Mailtrap or SMTP)
MAILTRAP_SMTP_HOST=smtp.mailtrap.io
MAILTRAP_SMTP_PORT=2525
MAILTRAP_SMTP_USER=your-user
MAILTRAP_SMTP_PASS=your-pass- Run the server
npm run dev # with nodemon
# or
npm start # node index.jsThe API will be available at http://localhost:5000 by default.
Key routes:
POST /api/auth/signupPOST /api/auth/loginPOST /api/auth/logoutGET /api/auth/users(requires Bearer token)POST /api/auth/update-user(requires Bearer token)CRUD /api/tickets/*
Background functions are exposed for Inngest at POST /api/inngest.
- Install dependencies
cd ai-ticket-frontend
npm install- Start the dev server
npm run devBy default Vite runs on http://localhost:5173.
- Backend
npm run dev— start Express with nodemonnpm start— start Express with Nodenpm run inngest-dev— run Inngest local dev server
- Frontend
npm run dev— start Vite dev servernpm run build— production buildnpm run preview— preview production build
PORT: Backend HTTP port (default 5000)MONGO_URI: MongoDB connection stringJWT_SECRET: Secret for signing auth tokensGEMINI_API_KEY: Google Gemini API key used by AI triageMAILTRAP_SMTP_HOST,MAILTRAP_SMTP_PORT,MAILTRAP_SMTP_USER,MAILTRAP_SMTP_PASS: SMTP configuration for email
Run both apps in two terminals:
# Terminal 1
cd ai-ticket-assistant && npm run dev
# Terminal 2
cd ai-ticket-frontend && npm run devLogin/Signup via the frontend will call the backend APIs. Tickets created in the frontend will be analyzed by the AI triage helper and stored in MongoDB.
- Ensure the backend is running before the frontend to avoid CORS/connection issues.
- If using a different SMTP provider, update the SMTP env vars accordingly.
- For Inngest local development, you can run
npm run inngest-devinai-ticket-assistant.
ISC