|
| 1 | +# BenchMesh System Startup Guide |
| 2 | + |
| 3 | +## Quick Start |
| 4 | + |
| 5 | +To start the entire BenchMesh system (Backend, Frontend, and Node-RED): |
| 6 | + |
| 7 | +```bash |
| 8 | +./start.sh |
| 9 | +``` |
| 10 | + |
| 11 | +This will launch: |
| 12 | +- **BenchMesh API & Frontend** on `http://localhost:57666` |
| 13 | +- **Node-RED Automations** on `http://localhost:1880` |
| 14 | + |
| 15 | +Press `Ctrl+C` to stop all services. |
| 16 | + |
| 17 | +## First Time Setup |
| 18 | + |
| 19 | +### 1. Install Python Dependencies |
| 20 | + |
| 21 | +```bash |
| 22 | +cd benchmesh-serial-service |
| 23 | +pip install -r requirements.txt |
| 24 | +cd .. |
| 25 | +``` |
| 26 | + |
| 27 | +### 2. Install Node.js Dependencies |
| 28 | + |
| 29 | +```bash |
| 30 | +npm install |
| 31 | +``` |
| 32 | + |
| 33 | +### 3. Install Frontend Dependencies |
| 34 | + |
| 35 | +```bash |
| 36 | +cd benchmesh-serial-service/frontend |
| 37 | +npm ci |
| 38 | +cd ../.. |
| 39 | +``` |
| 40 | + |
| 41 | +## Individual Services |
| 42 | + |
| 43 | +### Start Backend Only |
| 44 | + |
| 45 | +```bash |
| 46 | +cd benchmesh-serial-service |
| 47 | +PYTHONPATH=src uvicorn benchmesh_service.api:app --host 0.0.0.0 --port 57666 |
| 48 | +``` |
| 49 | + |
| 50 | +### Start Node-RED Only |
| 51 | + |
| 52 | +```bash |
| 53 | +npm run start:nodered |
| 54 | +``` |
| 55 | + |
| 56 | +### Start Frontend Development Server |
| 57 | + |
| 58 | +```bash |
| 59 | +cd benchmesh-serial-service/frontend |
| 60 | +npm run dev |
| 61 | +``` |
| 62 | + |
| 63 | +## Service Ports |
| 64 | + |
| 65 | +| Service | Port | URL | |
| 66 | +|---------|------|-----| |
| 67 | +| Frontend | 57666 | http://localhost:57666 | |
| 68 | +| API | 57666 | http://localhost:57666/docs | |
| 69 | +| Node-RED | 1880 | http://localhost:1880 | |
| 70 | + |
| 71 | +## Node-RED Data |
| 72 | + |
| 73 | +Node-RED configuration and flows are stored in `.node-red/` directory in the repository root. |
| 74 | + |
| 75 | +## Troubleshooting |
| 76 | + |
| 77 | +### Port Already in Use |
| 78 | + |
| 79 | +If you get "address already in use" errors: |
| 80 | + |
| 81 | +```bash |
| 82 | +# Check what's using port 57666 |
| 83 | +lsof -i :57666 |
| 84 | + |
| 85 | +# Check what's using port 1880 |
| 86 | +lsof -i :1880 |
| 87 | + |
| 88 | +# Kill the process |
| 89 | +kill <PID> |
| 90 | +``` |
| 91 | + |
| 92 | +### Node-RED Not Starting |
| 93 | + |
| 94 | +```bash |
| 95 | +# Check Node-RED logs |
| 96 | +cat .node-red/nodered.log |
| 97 | + |
| 98 | +# Test Node-RED manually |
| 99 | +./node_modules/.bin/node-red --userDir ./.node-red --port 1880 |
| 100 | + |
| 101 | +# Check if Node-RED is installed |
| 102 | +ls -la node_modules/.bin/node-red |
| 103 | +``` |
| 104 | + |
| 105 | +### Frontend Not Building |
| 106 | + |
| 107 | +```bash |
| 108 | +cd benchmesh-serial-service/frontend |
| 109 | +rm -rf node_modules |
| 110 | +npm ci |
| 111 | +npm run build |
| 112 | +``` |
0 commit comments