Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI Chatbot (Node.js) πŸ€–πŸ’¬

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.

πŸš€ Features

  • ⚑ 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

πŸ› οΈ Tech Stack

  • Backend: Node.js, Express.js
  • Frontend: HTML, CSS, JavaScript
  • AI Model: OpenAI GPT (via API)

πŸ§ͺ Getting Started

Follow these steps to run the chatbot locally:

1. Clone the Repository

git clone https://github.com/Coderxrohan/OpenAi-Chatbot-NodeJs
cd OpenAi-Chatbot-NodeJs

2. Install Dependencies

npm install

3. Add Your OpenAI API Key

Create a .env file in the root directory and add:

OPENAI_API_KEY=your_openai_api_key_here

4. Run the Server

node index.js

5. Access the Chatbot

Open your browser and go to:
πŸ‘‰ http://localhost:3000


πŸ“ Project Structure

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

🧠 Future Plans

  • Save chat history locally or to database
  • Add user authentication
  • Theme customization (dark/light mode)
  • Mobile-friendly improvements

🀝 Contributing

Contributions are welcome!
Feel free to fork this repo and submit a pull request.


πŸ“œ License

This project is licensed under the MIT License.


πŸ™‹β€β™‚οΈ Author

Made with ❀️ by Rohan Sarkar

Have questions or suggestions? Open an issue or drop a star ⭐!

About

πŸ€– OpenAI Chatbot (Node.js) is a server-side chatbot application built using Node.js and the OpenAI API. This project allows users to interact with an AI model through a simple web interface, sending and receiving conversational responses in real time. It demonstrates how to set up API routes, handle user input, and integrate OpenAI'.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages