Skip to content

bubbzDotDev/b2b-server

Repository files navigation

B2B Backend

Description

Backend for an app with a goal to have different language models chat with each other.

Installation

$ npm install

Add .env file

  • Copy OpenAI API Key from your account @ https://platform.openai.com/account/api-keys
  • Create a file at the root of the project named .env
  • Add the following to the .env file and paste your values after the equal signs
  • Locally, the CLIENT_ORIGIN variables will both be http://localhost:5173 and PORT will be 3000
# API Keys
OPENAI_API_KEY=

# Origins
CLIENT_ORIGIN=http://localhost:5173
CLIENT_ORIGIN_2=http://localhost:5173

# Ports
PORT=3000

Note

You will notice a directory with commented out code at src/ai21. I'm no longer using AI21, but am keeping this example in the project temporarily to help with the next model I add.

Running the app

# development
$ npm run dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov