From bb1a05af070d8f8b15249c7f2ea0b2578f46deae Mon Sep 17 00:00:00 2001 From: SAAC Daemon Date: Wed, 18 Feb 2026 16:48:02 +0100 Subject: [PATCH] Add nodemon.json for full hot-reload (backend + frontend) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nodemon now watches both server.js and client/src/. On any change, it rebuilds the React app and restarts Express — so git push makes both backend AND frontend changes visible on the hot domain. - dev script simplified to "nodemon" (reads nodemon.json config) - dev:local added for human developers who want Vite HMR --- README.md | 5 ++++- nodemon.json | 5 +++++ package.json | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 nodemon.json diff --git a/README.md b/README.md index ef1b5d7..1b4c513 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,12 @@ React + shadcn/ui + Express + PostgreSQL + Redis scaffold for SAAC deployment. # Install all dependencies (postinstall auto-installs client deps) npm install -# Run backend + frontend concurrently (nodemon + Vite HMR) +# Run in dev mode (watches server.js + client/src, auto-rebuilds on changes) npm run dev +# Or for local development with Vite HMR (browser hot-reload): +npm run dev:local # Express :3000 + Vite :5173 concurrently + # Or run separately: npm run dev:server # Express on :3000 (with nodemon auto-restart) npm run dev:client # Vite on :5173 (proxies /api to :3000) diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 0000000..ceac23d --- /dev/null +++ b/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": ["server.js", "client/src"], + "ext": "js,ts,tsx,jsx,css,json", + "exec": "npm run build && node server.js" +} diff --git a/package.json b/package.json index 76f1d2c..a83c5dc 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,10 @@ "main": "server.js", "scripts": { "start": "node server.js", - "dev": "concurrently \"nodemon server.js\" \"cd client && npm run dev\"", + "dev": "nodemon", "build": "cd client && npm run build", "postinstall": "[ -d client ] && cd client && npm install || true", + "dev:local": "concurrently \"nodemon server.js\" \"cd client && npm run dev\"", "dev:server": "nodemon server.js", "dev:client": "cd client && npm run dev" },