AI Movie Character Chatbot 🎭
This backend project allows users to chat with famous movie characters. Based on the user’s message, it mimics the selected character’s speech style and provides a response. If an exact dialogue is not found in the database, the system generates a response that matches the character’s personality using Gemini AI.
Follow these steps to set up the project on your local machine.
git clone https://github.com/Ajit33/DharmalQ-assignment.git
cd DharmalQ-assignment
npm install
Copy .env.example to .env
and modify them
npx prisma migrate dev --name init
npx prisma generate
# Start ChromaDB
docker run -d -p 8000:8000 --name chromadb ghcr.io/chroma-core/chroma:0.6.3
# Start Redis
docker run -d --name redis-server -p 6379:6379 redis
# Start Prometheus
docker run -d --name prometheus -p 9090:9090 prom/prometheus
# Start Grafana
docker run -d --name grafana -p 3000:3000 grafana/grafana
npm run migrate
# seed to postgres
npm run seed
#seed to chroma
npm run seed-chroma
#npm run dev
The server will start on http://localhost:3000
Endpoint: ws://localhost:5000/api/v1/chat Request Body:
json
{
"character": "Darth Vader",
"user_message": "Are you my father?"
}
Response (From Database):
{
"response": "I am your father."
}
Response (Generated by AI if no match is found):
{
"response": "Join me, and together we can rule the galaxy!"
}
http://localhost:5000/api-docs/
✅ Fast & Scalable Backend using Node.js + Express
✅ Stores Real Movie Dialogues using PostgreSQL + Prisma
✅ Mimics Character Speech Styles
✅ Uses Gemini AI for Fallback Responses
✅ RESTful API for Seamless Integration\
Express.js - API Handling
PostgreSQL - Database
Prisma ORM - Database Management
ChromaDB - Vector Database
Google Gemini AI - Character Response Generation
Redis - Caching and Queue Management
Prometheus & Grafana - Metrics and Monitoring
K6 - Load test




