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
REPORTS_PORT=3000
REPORTS_TEMPLATES_DIR=/opt/better-reports/templates
REPORTS_ASSETS_DIR=/opt/better-reports/assets
REPORTS_USER=admin
REPORTS_PASS=your-secure-password
REPORTS_CORS_ORIGIN=https://reports.yourdomain.com
LOG_LEVEL=info

Step 3: Create Data Directories ​

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

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