Skip to content

Commit 22e82d9

Browse files
authored
Merge pull request #104 from langchain-ai/brace/use-next
refactor: Use next.js instead of vite
2 parents aaee53e + 518483a commit 22e82d9

22 files changed

+2591
-2137
lines changed

.env.example

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# LangGraph Configuration
2-
VITE_API_URL=http://localhost:2024
3-
VITE_ASSISTANT_ID=agent
4-
VITE_LANGSMITH_API_KEY=
2+
NEXT_PUBLIC_API_URL=http://localhost:2024
3+
NEXT_PUBLIC_ASSISTANT_ID=agent
4+
# Do NOT prefix this with "NEXT_PUBLIC_" as we do not want this exposed in the client.
5+
LANGSMITH_API_KEY=

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ dist-ssr
2525

2626
# LangGraph API
2727
.langgraph_api
28-
.env
28+
.env
29+
.next/
30+
next-env.d.ts

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Agent Chat UI
22

3-
Agent Chat UI is a Vite + React application which enables chatting with any LangGraph server with a `messages` key through a chat interface.
3+
Agent Chat UI is a Next.js application which enables chatting with any LangGraph server with a `messages` key through a chat interface.
44

55
> [!NOTE]
66
> 🎥 Watch the video setup guide [here](https://youtu.be/lInrwVnZ83o).
@@ -36,7 +36,7 @@ Run the app:
3636
pnpm dev
3737
```
3838

39-
The app will be available at `http://localhost:5173`.
39+
The app will be available at `http://localhost:3000`.
4040

4141
## Usage
4242

@@ -52,10 +52,9 @@ After entering these values, click `Continue`. You'll then be redirected to a ch
5252

5353
You can bypass the initial setup form by setting the following environment variables:
5454

55-
```
56-
VITE_API_URL=http://localhost:2024
57-
VITE_ASSISTANT_ID=agent
58-
VITE_LANGSMITH_API_KEY=your_api_key_if_needed
55+
```bash
56+
NEXT_PUBLIC_API_URL=http://localhost:2024
57+
NEXT_PUBLIC_ASSISTANT_ID=agent
5958
```
6059

6160
To use these variables:

index.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

next.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {};
3+
4+
export default nextConfig;

package.json

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,25 @@
1010
"version": "0.0.0",
1111
"type": "module",
1212
"scripts": {
13-
"dev": "vite",
14-
"build": "tsc -b && vite build",
15-
"lint": "eslint .",
13+
"dev": "next dev",
14+
"build": "next build",
15+
"start": "next start",
16+
"lint": "next lint",
17+
"lint:fix": "next lint --fix",
1618
"format": "prettier --write .",
17-
"format:check": "prettier --check .",
18-
"preview": "vite preview"
19+
"format:check": "prettier --check ."
1920
},
2021
"dependencies": {
21-
"@langchain/core": "^0.3.41",
22-
"@langchain/langgraph": "^0.2.54",
23-
"@langchain/langgraph-api": "^0.0.15",
24-
"@langchain/langgraph-cli": "^0.0.15",
25-
"@langchain/langgraph-sdk": "^0.0.53",
22+
"@langchain/core": "^0.3.44",
23+
"@langchain/langgraph": "^0.2.63",
24+
"@langchain/langgraph-sdk": "^0.0.66",
2625
"@radix-ui/react-avatar": "^1.1.3",
2726
"@radix-ui/react-dialog": "^1.1.6",
2827
"@radix-ui/react-label": "^2.1.2",
2928
"@radix-ui/react-separator": "^1.1.2",
3029
"@radix-ui/react-slot": "^1.1.2",
3130
"@radix-ui/react-switch": "^1.1.3",
3231
"@radix-ui/react-tooltip": "^1.1.8",
33-
"@tailwindcss/postcss": "^4.0.9",
34-
"@tailwindcss/vite": "^4.0.9",
3532
"class-variance-authority": "^0.7.1",
3633
"clsx": "^2.1.1",
3734
"date-fns": "^4.1.0",
@@ -47,7 +44,6 @@
4744
"react": "^19.0.0",
4845
"react-dom": "^19.0.0",
4946
"react-markdown": "^10.0.1",
50-
"react-router-dom": "^6.17.0",
5147
"react-syntax-highlighter": "^15.5.0",
5248
"recharts": "^2.15.1",
5349
"rehype-katex": "^7.0.1",
@@ -62,23 +58,25 @@
6258
},
6359
"devDependencies": {
6460
"@eslint/js": "^9.19.0",
61+
"@tailwindcss/postcss": "^4.0.13",
6562
"@types/lodash": "^4.17.16",
6663
"@types/node": "^22.13.5",
6764
"@types/react": "^19.0.8",
6865
"@types/react-dom": "^19.0.3",
6966
"@types/react-syntax-highlighter": "^15.5.13",
70-
"@vitejs/plugin-react": "^4.3.4",
7167
"autoprefixer": "^10.4.20",
7268
"dotenv": "^16.4.7",
7369
"eslint": "^9.19.0",
70+
"eslint-config-next": "15.2.2",
7471
"eslint-plugin-react-hooks": "^5.0.0",
7572
"eslint-plugin-react-refresh": "^0.4.18",
7673
"globals": "^15.14.0",
74+
"next": "^15.2.3",
75+
"postcss": "^8.5.3",
7776
"tailwind-scrollbar": "^4.0.1",
78-
"tailwindcss": "^4.0.6",
77+
"tailwindcss": "^4.0.13",
7978
"typescript": "~5.7.2",
80-
"typescript-eslint": "^8.22.0",
81-
"vite": "^6.1.0"
79+
"typescript-eslint": "^8.22.0"
8280
},
8381
"overrides": {
8482
"react-is": "^19.0.0-rc-69d4b800-20241021",

0 commit comments

Comments
 (0)