You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## What is an LLM React Node App Javascript Template?
4
4
5
-
This a template project for a simple chat app connected to a Large Language Model (LLM). This is built on top of [the React template app from nano-react-app](https://github.com/nano-react-app/template-js). To connect the React app to an LLM, a Node server has been added to the project.
5
+
This template is an example project for a simple Large Language Model (LLM) application built on top of React and Node. This template was built on top of [the React template app from nano-react-app](https://github.com/nano-react-app/template-js) and updated with a Node server that uses [LangChain.js](https://github.com/hwchase17/langchainjs) to connect to supported large language models, e.g. OpenAI and Hugging Face. Use this template to easily build and run an LLM app, like the screenshot below:
6
+
7
+

6
8
7
9
These are the available commands:
8
10
9
-
-`npm start-server` — This will start a development node backend server with a default port of `3100`.
10
-
-`npm start` — This will start a development server for the react frontend app with a default port of `5173`.
11
-
-`npm run build` — This will output a production build in the `dist` directory.
12
-
-`npm run preview` — This will run the production build locally with a default port of `5173` (this will not work if you haven't generated the production build yet).
11
+
-`npm start` — This will start a React development server for the frontend app, with a default port of `5173`.
12
+
-`npm start-server` — This will start a Node development server for the backend app, with a default port of `3100`.
13
+
14
+
-`npm run build` — This will output a production build of the frontend app in the `dist` directory.
15
+
-`npm run preview` — This will run the production build of the frontend app locally with a default port of `5173` (_note_: this will not work if you haven't generated the production build yet).
13
16
14
17
## Getting Started
15
18
@@ -29,37 +32,3 @@ Or edit the `start` script directly:
29
32
```bash
30
33
vite --port 3000
31
34
```
32
-
33
-
## Adding styles
34
-
35
-
You can use CSS files with simple ES2015 `import` statements anywhere in your Javascript:
36
-
37
-
```js
38
-
import"./index.css";
39
-
```
40
-
41
-
## Babel transforms
42
-
43
-
The Babel preset [babel-preset-nano-react-app](https://github.com/nano-react-app/babel-preset-nano-react-app) is used to support the same transforms that Create React App supports.
44
-
45
-
The Babel configuration lives inside `package.json` and will override an external `.babelrc` file, so if you want to use `.babelrc` remember to delete the `babel` property inside `package.json`.
46
-
47
-
## Deploy to GitHub Pages
48
-
49
-
You can also deploy your project using GitHub pages.
50
-
First install the `gh-pages`[package](https://github.com/tschaub/gh-pages):
51
-
52
-
`npm i -D gh-pages`
53
-
54
-
Use the following scripts for deployment:
55
-
56
-
```js
57
-
"scripts": {
58
-
"start":"vite",
59
-
"build":"vite build",
60
-
"predeploy":"rm -rf dist && vite build",
61
-
"deploy":"gh-pages -d dist"
62
-
},
63
-
```
64
-
65
-
Then follow the normal procedure in GitHub Pages and select the `gh-pages` branch.
0 commit comments