A simple yet powerful AI chatbot built using Node.js, Express, and the OpenAI API. This project allows users to interact with ChatGPT-like functionality through a clean, browser-based interface.
- β‘ Real-time interaction with OpenAI's GPT API
- π§ Smart conversational AI assistant
- π₯οΈ Minimalistic and responsive frontend
- π Secure API key management via environment variables
- πͺΆ Lightweight and easy to deploy
- Backend: Node.js, Express.js
- Frontend: HTML, CSS, JavaScript
- AI Model: OpenAI GPT (via API)
Follow these steps to run the chatbot locally:
git clone https://github.com/Coderxrohan/OpenAi-Chatbot-NodeJs
cd OpenAi-Chatbot-NodeJsnpm installCreate a .env file in the root directory and add:
OPENAI_API_KEY=your_openai_api_key_here
node index.jsOpen your browser and go to:
π http://localhost:3000
OpenAi-Chatbot-NodeJs/
β
βββ public/
β βββ style.css # Frontend CSS
β βββ script.js # Frontend JS
β
βββ views/
β βββ index.html # Main chatbot UI
β
βββ .env # Environment variables (not committed)
βββ index.js # Express server and OpenAI API logic
βββ package.json # Project metadata and dependencies
βββ README.md # Project documentation
- Save chat history locally or to database
- Add user authentication
- Theme customization (dark/light mode)
- Mobile-friendly improvements
Contributions are welcome!
Feel free to fork this repo and submit a pull request.
This project is licensed under the MIT License.
Made with β€οΈ by Rohan Sarkar
Have questions or suggestions? Open an issue or drop a star β!