Build and customize your own ChatGPT-like web app using Next.js and the OpenAI API. The provided code serves as a foundation, and you can customize it to fit your specific use case.
- Node.js and npm or yarn installed
- An OpenAI API key
- Clone the repository and navigate to the project directory.
- Install the required dependencies:
npm install
or
yarn
- Create a
.env.local
file in the project root and add your ChatGPT API key:
CHATGPT_API_KEY=your_chatgpt_api_key
- Start the development server:
npm run dev
or
yarn dev
- Open your browser and navigate to http://localhost:3000 to access the application.
- You can now interact with the chatbot using the input field at the bottom of the screen.
The application uses the following components:
- Next.js for the frontend and backend server
- The OpenAI API for chat interactions
- Tailwind CSS for styling
- Customization