aditya-pethe / ui-chat

An natural language interface for frontend development
5 stars 1 forks source link

This is a great website. How can I deploy it on my own server for personal use? #11

Open KAIYI-HSU opened 1 year ago

KAIYI-HSU commented 1 year ago

As I am not familiar with web development, can you please guide me on how to easily deploy a live server on my computer?

aditya-pethe commented 1 year ago

Thanks! I'll add more to the readme, but for now here are some steps to run this locally:

Step 1. Setup codebase locally

Open up a terminal or shell on your machine. You will need node.js and git installed on your machine. If you have a mac, you can install these with homebrew.

brew install git brew install npm

Once these are installed, navigate to the folder you want this project to exist in using the terminal. run the following commands:

git clone https://github.com/aditya-pethe/ui-chat.git cd ui-chat npm install

You will need an open ai api key as well to run this. You can do this two ways:

  1. Run this command in the terminal:

export OPENAI_API_KEY="your-key-here"

OR

  1. Create a .env file in the repository, and follow the template of the .env.example file, i.e write this in the .env: OPENAI_API_KEY="your-key-here"

Step 2. Run the app locally

Then, you will want to create two terminal windows, and navigate to the ui-chat repository. You should be in the directory that contains client, server, and the package.json folder.

In one terminal, run npm run dev:server This will run the backend server that handles user requests In another terminal, runnpm run dev:client This will build the client facing application for the chatbot

Then, navigate to http://localhost:3000/, and the app should be running there!