diff --git a/README.md b/README.md index 120b2bf8..dd3397d3 100644 --- a/README.md +++ b/README.md @@ -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://: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//.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