Skip to main content

Prerequisites

  • Node.js 20+ (22 LTS recommended) and npm.
  • A Linux host with systemd to exercise systemctl, journalctl, and /sys/class/ features. Windows and macOS work for the frontend and the backend unit tests. On those hosts, unit writes are skipped and return a warning.

Run in development mode

1

Start the backend

npm run dev runs tsx watch src/index.ts. The server listens on PORT (default 3000) and HOST (default 0.0.0.0). The SQLite file is backend/aeros.db unless AEROS_DB_PATH is set.
2

Start the frontend

Vite proxies /api and /ws to the backend dev server.
3

Create the admin account

Open the Vite URL. With an empty database, the panel shows the Initial Admin Setup screen. You can also seed a user from the environment before the first start:
AEROS_ADMIN_PASSWORD only creates a user when the users table is empty.

Backend environment variables

Single-process production build

The backend serves frontend/dist itself. HTML is sent with Cache-Control: no-cache and hashed files under assets/ with a one-year immutable cache. Any non-API GET falls back to index.html. If frontend/dist is missing, those requests return 503 with a hint to build the frontend. Open http://localhost:3000.

Tests and checks

Run these before opening a pull request. All must exit with code 0.
Backend tests use Node’s built-in test runner (node --import tsx --test tests/*.test.ts) and cover alerts, backups, Caddy, crypto, deploy, Git validation, systemd, templates, and webhook signatures. Some alert tests only run on Linux. The frontend is linted with oxlint.

Load tests (k6)

The tests/k6/ suite measures throughput, latency, and memory against a throwaway instance. Each script gets a fresh server and database, so the in-memory login rate limiter starts empty.
ratelimit.js leaves 127.0.0.1 locked out of login for 15 minutes on that server. run.sh starts a fresh server for each script, so this does not affect the next one.
run.sh needs k6 on PATH (or K6=/path/to/k6) and curl. It starts the backend on 127.0.0.1:${PORT:-3099} with --expose-gc and a memory probe, then prints the first and last memory samples for each script. ADMIN_PASSWORD overrides the seeded test password.
Run k6 on the same class of hardware you target. Results from a fast desktop say little about an N3060.

Contribution rules

Read CONTRIBUTING.md before you open a pull request. In short:
  • No Docker, containerd, or PM2 dependencies.
  • No background polling loops. Idle memory should stay around 20 to 30 MB.
  • Do not weaken the guards described in Security.
  • Do not commit *.db, .env, or dist/.