A full-stack, production-ready chatbot web application built using:
- Backend: Node.js, TypeScript, Express, JWT Auth, OpenAI API
- Frontend: Next.js App Router, TypeScript, ShadCN UI
.
└── ignis/ # Node.js + TypeScript API (Express)
└── .env.example # Example environment variables for backend
│
└── chatbot_ui/ # Next.js 14 App Router frontend
└── .env.example # Example environment variables for frontend
Define the .env files, .env.example
files left for reference.
- Node.js ≥ 18
- Yarn or npm
- OpenAI API Key (for chatbot responses)
cp .env.example .env
Add values for:
PORT=5000
JWT_SECRET=your_jwt_secret
OPENAI_API_KEY=your_openai_api_key
cd chatbot_ui
cp .env.example .env
Add:
NEXT_PUBLIC_API_URL=http://localhost:5050/api/v1
cd backend
npm install
npm run dev
cd chatbot_ui
npm install
npm run dev
Visit: http://localhost:3000
curl -X POST http://localhost:5050/api/auth/register \
-H "Content-Type: application/json" \
-d '{"username": "user@example.com", "password": "pass123"}'
curl -X POST http://localhost:5050/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "user@example.com", "password": "pass123"}'
curl -X POST http://localhost:5050/api/chat \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"username":"user@example.com", "message": "Hi, How can you help me?"}'
curl -X POST http://localhost:5050/api/chat/history/user@example.com\
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
cd ignis
npm run build
cd chatbot_ui
npm run build
// Build and Run with Docker Compose
docker-compose up --build
// Install new npm packages inside container:
docker-compose exec ignis npm install some-package
// Rebuild when dependencies change:
docker-compose up --build
TODO: Dockerize client side
MIT – Free to use and modify.
Built with ❤️ by FAHAD