Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/yocxy2/2a/llms.txt

Use this file to discover all available pages before exploring further.

The fastest path to a running instance of the AI Ticket Support System is Docker Compose. A single command spins up PostgreSQL with pgvector, Redis, the Node.js backend, and the React frontend — fully wired together. All you need before starting is Docker Desktop and an OpenAI API key.
1

Clone the repository

Clone the project to your local machine and navigate into the project root:
git clone <repository-url>
cd test-pruebatec
2

Set up environment variables

Copy the example environment file and open it to add your credentials:
cp .env.example .env
The .env.example file contains the following defaults:
.env.example
PORT=3001
NODE_ENV=development
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/ticket_system
OPENAI_API_KEY=your_openai_api_key_here
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
Replace your_openai_api_key_here with your actual OpenAI API key. All other values work out of the box for local development with Docker Compose.
OPENAI_API_KEY is the only value you must change. The system cannot classify or respond to tickets without a valid key.
3

Start with Docker Compose

From the project root, bring up all services:
docker-compose up
Docker Compose will build the backend and frontend images and start the following services:
ServicePortNotes
PostgreSQL (pgvector)5432Waits for health check before backend starts
Redis6379Waits for health check before backend starts
Backend API3001Runs prisma generate then npm run dev on startup
Frontend (nginx)80Depends on the backend service
The backend container automatically runs npx prisma generate && npm run dev on startup, so database migrations are applied before the API begins accepting requests.
The database migration must complete before the backend can start accepting requests. If you see connection errors immediately after docker-compose up, wait a few seconds for Prisma migrations to finish applying.
4

Access the application

Once all containers are running and healthy, open the following URLs:
URLDescription
http://localhostReact frontend (ticket submission + admin dashboard)
http://localhost:3001Backend API root
http://localhost:3001/api/healthHealth check endpoint
The admin dashboard is accessible via the Admin Dashboard link in the frontend navigation. The RAG Visualizer shows real-time retrieval scores, and the Knowledge Base manager lets you adjust article importance weights.

Manual setup (without Docker)

If you prefer to run services directly on your machine, follow the steps below for each component.
Install dependencies and run database migrations before starting the dev server:
cd backend
npm install
npx prisma generate
npx prisma migrate dev
npm run dev
The backend starts on port 3001 by default. The entity extraction worker starts automatically because index.ts imports ./workers/entityExtractionWorker directly.
You can also run the worker in isolation for debugging with npm run worker.
You will also need a running PostgreSQL instance with the pgvector extension. The quickest way is to start it with Docker while keeping the rest of the stack running natively:
docker run -d -p 5432:5432 \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=ticket_system \
  pgvector/pgvector:pg16

Verify it works

Once the stack is running, create a test ticket using curl to confirm the full AI pipeline is functional:
curl -X POST http://localhost:3001/api/v1/tickets \
  -H "Content-Type: application/json" \
  -d '{"user_description": "I cannot log into my account"}'
A successful response includes the AI-generated category, suggested response, confidence score, and resolved status:
{
  "id": 1,
  "user_description": "I cannot log into my account",
  "category": "Account",
  "ai_suggested_response": "Try resetting your password via the login page...",
  "confidence_score": 0.85,
  "status": "ai_resolved",
  "created_at": "2024-01-01T00:00:00Z"
}
If the confidence score is 0.85 (≥ 0.7), the ticket is automatically marked ai_resolved. A score below 0.7 produces a pending_agent status and routes the ticket to the human queue.

Build docs developers (and LLMs) love