Skip to main content

Deployment

Requirements

  • Node.js 18 or later
  • npm 9 or later

Setup

git clone <repo-url>
cd rotifex
npm install

Running in Development

# Default port 3000
npx rotifex start

# Custom port
npx rotifex start --port 4000

# Custom host
npx rotifex start --host 127.0.0.1

# Verbose (debug) logging
npx rotifex start --verbose

Build the Admin Dashboard

npm run build:admin

Output is written to admin/dist/. The server automatically serves it at / when the directory exists.

Production Setup

1. Set secrets in environment:

export JWT_SECRET="$(openssl rand -hex 32)"
export JWT_REFRESH_SECRET="$(openssl rand -hex 32)"
export ROTIFEX_STORAGE_SIGNED_URL_SECRET="$(openssl rand -hex 32)"
export ROTIFEX_CORS_ORIGIN="https://yourfrontend.com"

2. Build the admin dashboard:

npm run build:admin

3. Use a process manager:

npm install -g pm2
pm2 start "npx rotifex start" --name rotifex
pm2 save
pm2 startup

4. Reverse proxy (Nginx example):

server {
listen 80;
server_name api.yourapp.com;

location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

5. Backup the database:

# SQLite database file — copy it regularly
cp rotifex.db rotifex.db.backup