docs: add Development Hosts & Ports section to README

This commit is contained in:
2026-07-08 23:27:35 -04:00
parent f52b1b03ba
commit b49877af52

View File

@@ -273,6 +273,65 @@ Two shortcuts will appear on your desktop:
---
## 🌐 Development Hosts & Ports
This section defines the default host and port used by each app/service in this turborepo. Update it whenever a new service is added or a port is changed. (Full copy also kept in [docs/ports.md](docs/ports.md).)
### Frontend (React + Vite)
- **Host:** `localhost` (default) — use `0.0.0.0` if you need LAN access (phone/other device on same Wi-Fi)
- **Port:** `3000`
- **Access URLs:**
- Local: http://localhost:3000
- LAN: `http://<your-ip>:3000` (only if `HOST=0.0.0.0`)
- **Current setup:** Frontend runs on `0.0.0.0` and is accessible via the device IP.
`.env` file (`apps/Frontend/.env`):
```env
NODE_ENV=development
HOST=0.0.0.0
PORT=3000
VITE_API_BASE_URL_BACKEND=http://192.168.1.8:5000
```
`VITE_API_BASE_URL_BACKEND` should point at the Backend's `HOST`/`PORT` as seen from the browser — use `localhost` for single-device access, or the machine's LAN IP for access from other devices.
### Backend (Express.js)
- **Host:** `0.0.0.0` (all interfaces)
- **Port:** `5000`
- **Access URL:** http://localhost:5000
- **Current setup:** Runs for all network interfaces and allows the configured `FRONTEND_URLS` via CORS.
`.env` file (`apps/Backend/.env`):
```env
NODE_ENV="development"
HOST=0.0.0.0
PORT=5000
FRONTEND_URLS=http://localhost:3000,http://192.168.1.8:3000
```
### 🧾 Patient Data Extractor Service
- **Host:** `localhost`
- **Port:** `5001`
- **Access URL:** http://localhost:5001
### 🌐 Selenium Service
- **Host:** `localhost`
- **Port:** `5002`
- **Access URL:** http://localhost:5002
### 💳 Payment OCR Service
- **Host:** `0.0.0.0`
- **Port:** `5003`
- **Access URL:** http://localhost:5003
### 📖 Notes
- These values come from per-app `.env` files (`apps/<App>/.env`).
- `HOST` controls binding — `localhost` = loopback only, `0.0.0.0` = all interfaces.
- `PORT` controls the service's port.
- Frontend uses variables prefixed with `VITE_` for client-side access (e.g. `VITE_API_BASE_URL_BACKEND`).
- In production, ports and hosts may differ — traffic is instead routed through the [Cloudflare Tunnel](#cloudflare-tunnel-setup-remote-access-per-office).
---
## This is a Turborepo. What's inside?
### Apps and Packages