# Create a backup to take to dev machine
scripts\backup.bat# Make scripts executable
chmod +x scripts/*.sh
# Deploy (first time setup)
./scripts/deploy.sh
# Update from git
./scripts/update.sh
# Create backup
./scripts/backup.sh
# Restore from backup
./scripts/restore.sh dash_backup_20240123_120000.tar.gz| Script | Platform | Purpose |
|---|---|---|
deploy.sh |
Linux | Full deployment: installs Node, deps, builds, creates systemd service |
update.sh |
Linux | Pull latest from git, rebuild, restart service |
backup.sh |
Linux | Create timestamped backup of database and config |
restore.sh |
Linux | Restore from a backup file |
setup-backup.sh |
Linux | Configure automated daily backups |
backup.bat |
Windows | Windows backup script (batch) |
backup.ps1 |
Windows | Windows backup script (PowerShell) |
git clone <your-repo-url> dash
cd dashchmod +x scripts/deploy.sh
./scripts/deploy.shThis will:
- Detect your OS (Ubuntu, Debian, Fedora)
- Install Node.js 20 LTS if needed
- Install system dependencies
- Create data directories
- Generate
.envfiles with secure defaults - Install npm packages
- Setup database with Prisma
- Build client and server
- Create and start systemd service
http://localhost:3001
After making changes and pushing to git:
./scripts/update.shThis will:
- Pull latest changes
- Install any new dependencies
- Run database migrations
- Rebuild client and server
- Restart the service
./scripts/backup.sh
# Output: data/backups/dash_backup_20240123_120000.tar.gz./scripts/restore.sh dash_backup_20240123_120000.tar.gz# On source machine
scp data/backups/dash_backup_*.tar.gz user@newmachine:/path/to/dash/
# On target machine
./scripts/restore.sh /path/to/dash_backup_*.tar.gz# Enable daily backups at 2 AM
./scripts/setup-backup.sh --daily
# With SSH transfer to remote server
./scripts/setup-backup.sh --daily --ssh user@backup-server:/backups/dash
# Check status
./scripts/setup-backup.sh --status
# Disable
./scripts/setup-backup.sh --disable# Start
sudo systemctl start dash
# Stop
sudo systemctl stop dash
# Restart
sudo systemctl restart dash
# View status
sudo systemctl status dash
# View logs
journalctl -u dash -fPORT=3001
DATABASE_URL=file:/path/to/data/dash.db
JWT_SECRET=your-secret-key
NODE_ENV=productionVITE_API_URL=http://localhost:3001dash/
├── client/ # React frontend
│ └── dist/ # Built frontend (generated)
├── server/ # Express backend
│ └── dist/ # Built backend (generated)
├── data/ # Runtime data
│ ├── dash.db # SQLite database
│ ├── uploads/ # Uploaded files
│ └── backups/ # Local backups
└── scripts/ # Deployment scripts
For production deployments, you can use nginx as a reverse proxy to serve Dash on port 80 with WebSocket support.
# Deploy with nginx reverse proxy
./scripts/deploy.sh --nginx
# With a custom domain
./scripts/deploy.sh --nginx --domain=dash.example.comIf Dash is already running and you just want to add nginx:
# Add nginx reverse proxy without re-running full deployment
./scripts/deploy.sh --nginx-only
# With a custom domain
./scripts/deploy.sh --nginx-only --domain=dash.example.comIf you prefer to configure nginx manually:
# Install nginx
sudo apt install nginx # Ubuntu/Debian
sudo dnf install nginx # Fedora
# Copy the configuration
# Ubuntu/Debian:
sudo cp nginx/dash.conf /etc/nginx/sites-available/dash
sudo ln -sf /etc/nginx/sites-available/dash /etc/nginx/sites-enabled/dash
sudo rm -f /etc/nginx/sites-enabled/default
# Fedora:
sudo cp nginx/dash.conf /etc/nginx/conf.d/dash.conf
# Test and reload
sudo nginx -t
sudo systemctl enable nginx
sudo systemctl restart nginx# Install certbot
sudo apt install certbot python3-certbot-nginx # Ubuntu/Debian
sudo dnf install certbot python3-certbot-nginx # Fedora
# Get certificate (replace with your domain)
sudo certbot --nginx -d dash.example.com
# Certificate auto-renews via systemd timer
sudo systemctl status certbot.timer# Status
sudo systemctl status nginx
# Reload config (after changes)
sudo systemctl reload nginx
# View logs
tail -f /var/log/nginx/dash_access.log
tail -f /var/log/nginx/dash_error.log| File | Purpose |
|---|---|
nginx/dash.conf |
Main configuration (HTTP, port 80) |
nginx/dash-ssl.conf.example |
Template for manual HTTPS setup |
# Check logs
journalctl -u dash -n 100
# Check if port is in use
sudo lsof -i :3001
# Try running manually
cd /path/to/dash
node server/dist/index.js# Reset database (WARNING: deletes all data)
cd server
rm prisma/dev.db
npx prisma migrate deploy
npx prisma db seed# Fix ownership
sudo chown -R $USER:$USER /path/to/dash