Code Monkey home page Code Monkey logo

ai-chat's Introduction

Simple Chat

A simple chat fullstack web application using Open AI built with React and Node JS.

Prerequisites

Make sure you have installed the following on your machine:

  • Node (at least v18+ or higher)
# install node link: https://nodejs.org/en/download/package-manager
# On a Mac use the following command

# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# download and install Node.js (you may need to restart the terminal)
nvm install 18

# verifies the right Node.js version is in the environment
node -v # should print `v18.20.3`

# verifies the right NPM version is in the environment
npm -v # should print `10.7.0`

Note: if you aren't using Mac, the link above ๐Ÿ‘†๐Ÿฝ provides you various ways to install node on your machine

  • pnpm - is the package manager used in this project
  • bit cli
npx @teambit/bvm install
# you need to reload your bash profile to be able to access

What's inside?

This project used @teambit/bvm (bit) for bootstrapping the monorepo. You can read more about this tool on their documentation page

Up and running

  • Add environment variables
# Add .env at the root folder
OPENAI_API_KEY=xxx
GROQ_API_KEY=xxx
  • Install dependencies
bit install
  • Check if the apps are listed
bit app list # should show 2 apps (chat-ui and chat-service)
  • Run compose file
docker-compose up # -d (dettached mode)
# turn off services
docker-compose down
  • Run the application
# backend
bit run chat-service
# frontend
bit run chat-ui

Note: Whenever the backend service doesn't compile, try to run bit install && bit run chat-service to recompile the service. Then afterwards restart the frontend as well.

Demo

This is how it currently works.

First iteration Current
Screen.Recording.2024-06-24.at.00.57.39.mov
Screen.Recording.2024-06-26.at.02.27.16.mov

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.