diff --git a/CHANGELOG.md b/CHANGELOG.md index 98ab860..e0cbc66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to OpenHamClock will be documented in this file. - `.env` is auto-created from `.env.example` on first run - Settings won't be overwritten by git updates - Supports: CALLSIGN, LOCATOR, PORT, HOST, UNITS, TIME_FORMAT, THEME, LAYOUT +- **Auto-build on start** - `npm start` automatically builds the React frontend if needed - **Update script** - Easy updates for local/Pi installations (`./scripts/update.sh`) - Backs up config, pulls latest, rebuilds, preserves settings - **Network access configuration** - Set `HOST=0.0.0.0` to access from other devices diff --git a/README.md b/README.md index 2013040..e81ed0a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A modern, modular amateur radio dashboard built with React and Vite. This is the # Install dependencies npm install -# Start the server (auto-creates .env on first run) +# Start the server (auto-builds frontend and creates .env on first run) npm start # Edit .env with your callsign and grid locator @@ -18,14 +18,17 @@ npm start # Open http://localhost:3000 ``` -**That's it!** On first run, the server automatically creates a `.env` file from `.env.example`. Just edit it with your callsign and locator. +**That's it!** On first run: +- Frontend is automatically built (React app compiled to `dist/`) +- `.env` file is created from `.env.example` +- Just edit `.env` with your callsign and locator For development with hot reload: ```bash # Terminal 1: Backend API server node server.js -# Terminal 2: Frontend dev server +# Terminal 2: Frontend dev server with hot reload npm run dev ``` diff --git a/package.json b/package.json index ed16391..d91f39a 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "openhamclock", - "version": "3.7.0", + "version": "3.10.0", "description": "Amateur Radio Dashboard - A modern web-based HamClock alternative", "main": "server.js", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview", + "prestart": "node -e \"const fs=require('fs'); if(!fs.existsSync('dist/index.html')){console.log('Building frontend...'); require('child_process').execSync('npm run build',{stdio:'inherit'})}\"", "start": "node server.js", "server": "node server.js", "test": "echo \"Tests passing\" && exit 0" diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..8d6a48c --- /dev/null +++ b/public/index.html @@ -0,0 +1,82 @@ + + +
+ + +The frontend needs to be built before running.
+ +npm install
+ npm run build
+ npm start
+ Or use the quick start:
+npm install && npm start
+
+ If you're seeing this page, the build step was skipped.
+ Running npm start should auto-build if needed.
+