Project information

  • Category: Front-end
  • Project date: third Semester
  • Language: Next.js

Develop a chatbot using Next.js

This individual project for a web application course involved creating a chatbot web application. The task was to build a chatbot that communicated with ChatGPT to generate responses. MongoDB served as the database for storing and managing data. Initially, a MongoDB collection was established, and user credentials were added. Upon entering their username and password, users gained access to the chatbot interface.

The chatbot operated by sending user messages to the ChatGPT API via a POST method and fetching responses, which were then displayed within the chat interface. Additionally, the chatbot was equipped with a feature to save chat history to MongoDB, enabling users to review past conversations upon subsequent logins.

Furthermore, I implemented a loading functionality to enhance user experience. This feature displayed a loading indicator while awaiting a response from the ChatGPT API, ensuring users were aware that the system was processing their query.