Skip to content

This is a template repository which hosts the code for a front-end and backend to build a chatbot that talks to OpenAI

Notifications You must be signed in to change notification settings

azure-template-resources/chatbot-react-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About this Chatbot app

This is a sample Chatbot application based on the Open AI cookbook example from here. It's been adapted to work as a 2-tier application with a React Front-end and a backend built using Fastify on a Node.js server.

Running the Todo app locally

Prerequisites:

  • Node 16+

Installing dependencies

Run the following from both the /client and /server folders:

npm install

Running it locally

First let's start the client which will run on port 3000.

cd client
npm start

Then let's add a .env file under the /server folder which contains the OpenAI API key to talk to OpenAI. If you're not sure how to get one, the app itself will explain how to get this information if you've forgotten to set this. NOTE: This file is explicitly ignored in .gitignore so it won't accidentally be commited and pushed to GitHub. It's for local use only.

.env file example

OPENAI_API_KEY="<PUT YOUR OPEN AI API KEY HERE>"

Then let's start the server which will run on port 3001.

cd server
npm run build
npm start

Once both the client and server are running, http://localhost:4280

About

This is a template repository which hosts the code for a front-end and backend to build a chatbot that talks to OpenAI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published