Skip to content

yuval1337/openai-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI App

Powered by

react,js,bootstrap,nodejs,express,mongodb

Table of Contents

About

This is a toy app submitted as a final product for a web-development course.
It provides a "chatting" experience with the text-davinci-003 language model using OpenAI's public API.
Every such correspondence is saved as a log document in the backend's noSQL database.

Prerequisites

Download MongoDB Community Server first.
In the setup wizard, de-check the Compass installation option.
When finished, download and install Compass separately.

Setup

In ./server/ create a new file "secret.js" with the following content and all placeholders replaced to appropriate values:

const user = 'PLACEHOLDER'; // username to login into administrative section
const pass = 'PLACEHOLDER'; // password to login ...
const secret = 'PLACEHOLDER'; // some secret, could be a random string
const org = 'PLACEHOLDER'; // OpenAI personal organization string
const key = 'PLACEHOLDER'; // OpenAI API key

module.exports = {
  user,
  pass,
  secret,
  org,
  key
}

*Note: you can find your account's API key here, and your organization ID here.

Run the following commands by order:

git clone https://github.com/yuval-ro/openai-app.git
npm upgrade
npm install
npm start
nodemon ./server/index.js

The React app will run on port 3000, while the server on 3001.

In a web browser, navigate to http://localhost:3000/ and test the app.

*Note: if you receive a status code 429 from the API, that means you have exhausted the request limit.

Demo

Contributions

Refer to table below before opening any new issues / PRs:

Type of Cont. Accepted
Pull requests ✔️
Security issues ✔️
Other issues

License

Licensed under the GPLv3, Copyright (c) 2023 yuval-ro. All rights reserved.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published