This sample shows a Next.js and OpenAI application deployed using Defang. It uses the OpenAI API for its chatbot functionality.
- Download Defang CLI
- (Optional) If you are using Defang BYOC authenticate with your cloud provider account
- (Optional for local development) Docker CLI
To run the application locally, you can use the following command:
docker compose -f compose.dev.yaml up --buildFor this sample, you will need to provide the following configuration:
Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.
An API key for Open AI.
defang config set OPENAI_API_KEYNote
Download Defang CLI
Deploy your application to the Defang Playground by opening up your terminal and typing:
defang compose upIf you want to deploy to your own cloud account, you can use Defang BYOC.
Title: Next.js & OpenAI
Short Description: A fun chatbot created with Next.js and OpenAI.
Tags: Next.js, TypeScript, React, JavaScript, Chatbot, OpenAI, AI
Languages: TypeScript
