Git Product home page Git Product logo

aadrianleo / codelib Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 66 KB

CodeLib is an ai that generates answers related to programming and it even help you by generating specific code or syntax that will help you in you development. CodeLib even understand code and it can even explain you the given input code by the user. CodeLib is build in Javascript (Vanilla Js) using OpenAI API

Home Page: https://codelib.vercel.app

HTML 9.47% JavaScript 52.77% CSS 37.76%
ai chatai chatbot codex cors cors-proxy cors-request dotenv express javascript js nodejs nodemon nodemon-express openai openai-code-generation openai-codex vanilla-javascript vanilla-js vite

codelib's Introduction

CodeLib

CodeLib is an ai that generates answers related to programming and it even help you by generating specific code or syntax that will help you in you developement. CodeLib even understand code and it can even explain you the given input code by the user. Users can ask step-by-step methods to solve any programming query. Users can ask for even easy to understand code or steps like asking anything and ending with explain it to me like i am 5 years old . CodeLib is build in Javascript (Vanilla Js) using OpenAI API that helps generating the response to the questions and requests.

codelib

Documentaion for users to edit and use it at local server.

To run the server in local server.

create an .env file in server folder and enter :

OPENAI_API_KEY = "YOUR_OPENAI_API_KEY"

You can get the api key from openai officail wesite : OpenAI API

After implementing the changes in server folder go to terminal > go to the server folder in the project > Type Command :

  npm install or npm i
  npm run server

your server is running and will be available on localhost:5000

To run the Frontend / Client side :

Do some changes first :

Go to file : client > script.js

change the server link to the local host link

// fetch data from server -> bot's response

  const response = await fetch('http://localhost:5000', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      prompt: data.get('prompt')
    })
  })

Then open terminal > Go into the client folder in the project > Type the command :

 npm install or npm i
 npm run dev 

Now the client site is running no local server too

it may be runnig no this local host http://127.0.0.1:5173/ or can be another

The scroll feature in OpenAi may be having some bug or glitch. if you find any thing regarding this share. will be a great help.

Have Fun ๐Ÿ˜‰

codelib's People

Contributors

aadrianleo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.