Skip to content

Manual Deployment

Prerequisites

  • Node.js >= 18
  • Rust toolchain (latest stable)
  • A systemd-compatible Linux distribution (recommended)

Step 1: Build the Application

bash
git clone https://github.com/dlampatricio/better-reports.git
cd better-reports
npm install
npm run build:binary
npm run build:ui

Step 2: Configure

Create a .env file:

bash
NODE_ENV=production
PORT=3000
HOST=0.0.0.0
REPORTS_DATA_DIR=/opt/better-reports/data
REPORTS_USER=admin
REPORTS_PASS=your-secure-password
CORS_ORIGIN=https://reports.yourdomain.com
LOG_LEVEL=info

Step 3: Create Data Directory

bash
mkdir -p /opt/better-reports/data/{templates,assets,packages}

Step 4: Start the Server

bash
node src/server.mjs

Systemd Service

Create /etc/systemd/system/better-reports.service:

ini
[Unit]
Description=Better Reports
After=network.target

[Service]
Type=simple
User=reports
WorkingDirectory=/opt/better-reports
EnvironmentFile=/opt/better-reports/.env
ExecStart=/usr/bin/node src/server.mjs
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
bash
sudo systemctl enable better-reports
sudo systemctl start better-reports

Design and Dev by David Lam