update readme install

This commit is contained in:
larssand
2026-08-30 22:04:49 +02:00
parent 5ed193cdeb
commit c2bfa97d30
3 changed files with 509 additions and 56 deletions

261
README.md
View File

@@ -10,6 +10,45 @@ RC RaceCore is an RC timing and race-control system with support for sponsor eve
- Security and performance audit: `docs/security-performance-audit.md`
- Swedish operational guide: `README.sv.md`
## Windows Quick Start
For a new Windows 11 computer, open **PowerShell** and follow these steps.
1. Check whether Git is installed:
```powershell
git --version
```
2. If `git` is not recognized, install it and reopen PowerShell:
```powershell
winget install --id Git.Git --exact --source winget
```
3. Download RC RaceCore and enter the project directory:
```powershell
Set-Location $HOME
git clone https://git.dio.nu/Public/Live_RC.git Live_RC
Set-Location .\Live_RC
```
4. Run the complete installer. It installs/checks Node.js, installs npm dependencies, verifies SQLite and starts the server in the background:
```powershell
.\windows\install.bat
```
5. Verify the server and open `http://localhost:8081`:
```powershell
npm.cmd run status
Invoke-RestMethod -Uri "http://127.0.0.1:8081/api/health"
```
If `winget` is missing, install [Git for Windows](https://git-scm.com/download/win). You can also download the repository as a ZIP without Git. See the complete [Installation](#installation) section for ZIP installation, LAN access, updates and troubleshooting.
## Screenshots
Current layouts for race operation, live presentation, training and system configuration. Click an image to open the full-resolution version.
@@ -413,46 +452,212 @@ Example:
- Retain the current system voice and passing beep as offline fallbacks.
- Support uploaded or prerecorded WAV/MP3 clips for fixed start and finish announcements.
## Windows installation
Use 64-bit Windows 11 and Node.js 22 or 24 LTS. The easiest supported setup is:
## Installation
1. Clone or extract the complete repository, preferably to `C:\\Live_RC`.
2. Double-click `windows\\install.bat`.
3. The installer runs `npm.cmd restart` and leaves the backend running.
4. Open `http://localhost:8081`.
RC RaceCore runs on 64-bit Windows 11 and Linux. Use Node.js 22 or 24 LTS and npm 10 or newer. The repository includes `package-lock.json`, so use `npm ci` rather than `npm install` for repeatable installations.
The setup script can install Node.js LTS through `winget`, runs locked dependency installation with `npm.cmd ci`, verifies SQLite/Express, and checks the bundled AMMC runtime. Full instructions and troubleshooting: [`windows/README.md`](windows/README.md).
### Windows 11 - new computer
#### 1. Install Git
Open PowerShell and check whether Git is available:
```powershell
git --version
```
If Windows reports that `git` is not recognized, install Git with Windows Package Manager:
```powershell
winget install --id Git.Git --exact --source winget
```
Close and reopen PowerShell after installation, then run `git --version` again. If `winget` is unavailable, install Git for Windows from [git-scm.com](https://git-scm.com/download/win).
#### 2. Download RC RaceCore
Clone the public repository from a normal PowerShell prompt:
```powershell
Set-Location $HOME
git clone https://git.dio.nu/Public/Live_RC.git Live_RC
Set-Location .\Live_RC
```
Enter the raw URL exactly as shown. Do not paste Markdown syntax such as `[https://...](https://...)` into PowerShell.
If you do not want to install Git, open [the public repository](https://git.dio.nu/Public/Live_RC), download its ZIP archive, and extract the complete archive. Make sure `package.json`, `server.js`, `src\`, and `windows\` are all in the same project directory.
#### 3. Run the Windows installer
From the project directory:
```powershell
.\windows\install.bat
```
You can also double-click `windows\install.bat` in Explorer. The installer:
- installs Node.js LTS through `winget` when Node is missing or unsupported
- installs/checks the Microsoft Visual C++ runtime used by AMMC
- runs `npm.cmd ci` using the locked dependency versions
- verifies Express, SQLite, and bundled AMMC files
- creates `data\` and `logs\`
- runs `npm.cmd restart` and leaves RC RaceCore running in the background
If the installer cannot install Node automatically, install Node.js 22 or 24 LTS from [nodejs.org](https://nodejs.org/en/download), reopen PowerShell, and run the installer again.
#### 4. Verify and open the application
```powershell
npm.cmd run status
Invoke-RestMethod -Uri "http://127.0.0.1:8081/api/health"
```
Open:
```text
http://localhost:8081
```
To open RC RaceCore from another computer on the race LAN, run `ipconfig` on the server and use:
```text
http://<windows-server-ip>:8081
```
Use `npm.cmd` in PowerShell. This bypasses the common `npm.ps1 cannot be loaded because running scripts is disabled` error. Plain `npm` normally works in Command Prompt.
#### Windows manual installation
If you do not use `install.bat`:
```powershell
node --version
npm.cmd --version
npm.cmd ci
npm.cmd run verify
npm.cmd start
```
Do not use `npm.cmd ci --ignore-scripts`. The native SQLite dependency needs its install script.
### Linux - Ubuntu/Debian
#### 1. Install Git and basic tools
```bash
sudo apt update
sudo apt install -y git curl build-essential
git --version
```
#### 2. Install Node.js 22 LTS when needed
Check the installed version:
```bash
node --version
npm --version
```
If Node is missing or older than version 22, install Node.js 22 from NodeSource:
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
node --version
npm --version
```
Node.js 22 or 24 LTS is recommended. Node.js 18 and 20 are not supported by the current native SQLite dependency.
#### 3. Clone, install, and start
```bash
mkdir -p ~/git
cd ~/git
git clone https://git.dio.nu/Public/Live_RC.git Live_RC
cd Live_RC
npm ci
npm run verify
chmod +x AMMC/linux_x86-64/ammc-amb
npm start
npm run status
curl http://127.0.0.1:8081/api/health
```
`npm start` launches RC RaceCore in the background. Open `http://localhost:8081`, or find the Linux server address with `hostname -I` and open `http://<linux-server-ip>:8081` from another computer.
If the bundled Linux AMMC binary reports a missing `GLIBC` version, use an AMMC build compatible with the host distribution. Do not manually replace the operating system's glibc.
### Runtime commands
Windows PowerShell:
Common commands:
```powershell
npm.cmd start
npm.cmd stop
npm.cmd restart
npm.cmd run status
npm.cmd restart
npm.cmd stop
npm.cmd run start:fg
```
- `npm.cmd start` starts the backend in the background
- `npm.cmd stop` stops the process via `data/server.pid`
- `npm.cmd restart` restarts the backend
- `npm.cmd run status` shows whether the backend is running
- `npm.cmd run start:fg` runs in foreground for troubleshooting
Linux:
### Windows scripts
The `windows/` folder includes:
- `windows\\install.bat` installs dependencies and runs `npm.cmd restart`
- `windows\\start_ammc.bat` starts AMMC in the background
- `windows\\start_backend.bat` starts `npm.cmd start` in the background
- `windows\\restart_backend.bat` runs `npm.cmd restart` after updates
- `windows\\start_all.bat` starts both AMMC + backend and opens the web page
- `windows\\stop_all.bat` stops the managed backend and `ammc-amb.exe`
```bash
npm start
npm run status
npm restart
npm stop
npm run start:fg
```
Backend logs:
- `logs\\server.out.log`
- `logs\\server.err.log`
- `start` runs the backend in the background
- `status` reports whether the PID in `data/server.pid` is running
- `restart` reloads backend changes
- `stop` stops the managed process
- `start:fg` runs in the current terminal and displays startup errors directly
- stdout is written to `logs/server.out.log`
- stderr is written to `logs/server.err.log`
- SQLite data is stored in `data/rc_timing.sqlite`
SQLite database file:
- `data\\rc_timing.sqlite`
### Windows helper scripts
- `windows\install.bat`: install dependencies, verify, and restart
- `windows\start_backend.bat`: start the backend in the background
- `windows\restart_backend.bat`: restart after copied or pulled updates
- `windows\start_ammc.bat`: start bundled AMMC manually
- `windows\start_all.bat`: start AMMC and backend, then open the browser
- `windows\stop_all.bat`: stop the backend and `ammc-amb.exe`
### Update an existing installation without losing data
The SQLite database and local configuration are in `data/`. Do not delete or replace this directory during an update.
Windows:
```powershell
npm.cmd stop
git pull --ff-only
npm.cmd ci
npm.cmd run verify
npm.cmd restart
npm.cmd run status
```
Linux:
```bash
npm stop
git pull --ff-only
npm ci
npm run verify
npm restart
npm run status
```
If the installation came from a ZIP archive instead of Git, back up `data/`, extract the new application files, restore/retain the existing `data/` directory, run `npm ci`, and restart. Never copy `node_modules/` between Windows and Linux.
## Connect to AMMC
There are two supported modes.