|
@@ -16,16 +16,18 @@ The web application now uses a Next.js API proxy by default instead of direct cl
|
|
|
### For Local Development
|
|
### For Local Development
|
|
|
|
|
|
|
|
1. **Update your `.env.local` file**:
|
|
1. **Update your `.env.local` file**:
|
|
|
|
|
+
|
|
|
```bash
|
|
```bash
|
|
|
cd apps/web
|
|
cd apps/web
|
|
|
# Remove or comment out the old direct API URL
|
|
# Remove or comment out the old direct API URL
|
|
|
# NEXT_PUBLIC_WATCH_FINISHED_API=http://localhost:3001
|
|
# NEXT_PUBLIC_WATCH_FINISHED_API=http://localhost:3001
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
# Add the backend API URL for the Next.js server
|
|
# Add the backend API URL for the Next.js server
|
|
|
API_URL=http://localhost:3001
|
|
API_URL=http://localhost:3001
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
2. **Restart the development servers**:
|
|
2. **Restart the development servers**:
|
|
|
|
|
+
|
|
|
```bash
|
|
```bash
|
|
|
# From project root
|
|
# From project root
|
|
|
pnpm run dev
|
|
pnpm run dev
|
|
@@ -38,6 +40,7 @@ The web application now uses a Next.js API proxy by default instead of direct cl
|
|
|
### For Docker Deployment
|
|
### For Docker Deployment
|
|
|
|
|
|
|
|
1. **Rebuild your Docker images**:
|
|
1. **Rebuild your Docker images**:
|
|
|
|
|
+
|
|
|
```bash
|
|
```bash
|
|
|
docker-compose build
|
|
docker-compose build
|
|
|
```
|
|
```
|
|
@@ -54,10 +57,12 @@ The web application now uses a Next.js API proxy by default instead of direct cl
|
|
|
### For Remote Access
|
|
### For Remote Access
|
|
|
|
|
|
|
|
**Before** (didn't work remotely):
|
|
**Before** (didn't work remotely):
|
|
|
|
|
+
|
|
|
- Web UI at `http://192.168.1.100:3000`
|
|
- Web UI at `http://192.168.1.100:3000`
|
|
|
- Tried to connect to API at `http://localhost:3001` (failed from remote)
|
|
- Tried to connect to API at `http://localhost:3001` (failed from remote)
|
|
|
|
|
|
|
|
**After** (works remotely):
|
|
**After** (works remotely):
|
|
|
|
|
+
|
|
|
- Web UI at `http://192.168.1.100:3000`
|
|
- Web UI at `http://192.168.1.100:3000`
|
|
|
- API requests automatically proxied through the web server
|
|
- API requests automatically proxied through the web server
|
|
|
- WebSocket connections also proxied
|
|
- WebSocket connections also proxied
|
|
@@ -73,6 +78,7 @@ API_URL=http://localhost:3001
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
This is useful for:
|
|
This is useful for:
|
|
|
|
|
+
|
|
|
- Development across multiple machines
|
|
- Development across multiple machines
|
|
|
- Custom API server locations
|
|
- Custom API server locations
|
|
|
- Debugging proxy issues
|
|
- Debugging proxy issues
|
|
@@ -80,18 +86,21 @@ This is useful for:
|
|
|
## Architecture Changes
|
|
## Architecture Changes
|
|
|
|
|
|
|
|
### Before
|
|
### Before
|
|
|
|
|
+
|
|
|
```
|
|
```
|
|
|
Browser → http://localhost:3001/api/* (direct)
|
|
Browser → http://localhost:3001/api/* (direct)
|
|
|
Browser → ws://localhost:3001/socket.io (direct)
|
|
Browser → ws://localhost:3001/socket.io (direct)
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### After (Default)
|
|
### After (Default)
|
|
|
|
|
+
|
|
|
```
|
|
```
|
|
|
Browser → http://localhost:3000/api/* → Next.js Proxy → http://localhost:3001/*
|
|
Browser → http://localhost:3000/api/* → Next.js Proxy → http://localhost:3001/*
|
|
|
Browser → ws://localhost:3000/socket.io → Next.js Proxy → ws://localhost:3001/socket.io
|
|
Browser → ws://localhost:3000/socket.io → Next.js Proxy → ws://localhost:3001/socket.io
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### After (With NEXT_PUBLIC_WATCH_FINISHED_API set)
|
|
### After (With NEXT_PUBLIC_WATCH_FINISHED_API set)
|
|
|
|
|
+
|
|
|
```
|
|
```
|
|
|
Browser → http://localhost:3001/api/* (direct, bypasses proxy)
|
|
Browser → http://localhost:3001/api/* (direct, bypasses proxy)
|
|
|
Browser → ws://localhost:3001/socket.io (direct, bypasses proxy)
|
|
Browser → ws://localhost:3001/socket.io (direct, bypasses proxy)
|