Skip to content

Latest commit

 

History

History
127 lines (91 loc) · 3.16 KB

File metadata and controls

127 lines (91 loc) · 3.16 KB

Deployment Guide

Quick Reference

Deploy from local machine

./scripts/deploy.sh              # pull + rebuild frontend/agent + restart
./scripts/deploy.sh quick        # pull + restart only (no rebuild, fastest)
./scripts/deploy.sh full         # pull + rebuild everything including Docker image
./scripts/deploy.sh reset        # hard reset + full rebuild (destructive)
./scripts/deploy.sh logs         # tail production logs
./scripts/deploy.sh status       # check service + docker status
./scripts/deploy.sh ssh          # SSH into VPS
./scripts/deploy.sh setup        # first-time systemd service install

When to use which

Command When Speed
quick Prompt/config changes, backend-only code changes ~5s
deploy Frontend + agent code changes (default) ~2min
full Dockerfile changes, container dependency changes ~10min
reset Something is broken, need clean slate ~15min

First-Time Setup

# 1. Set up systemd service on VPS
./scripts/deploy.sh setup

# 2. Deploy
./scripts/deploy.sh full

Managing the Service (on VPS)

Start / Stop / Restart

sudo systemctl start construct
sudo systemctl stop construct
sudo systemctl restart construct
sudo systemctl status construct

Logs

# Tail live (Ctrl+C to stop)
sudo journalctl -u construct -f

# Last N lines
sudo journalctl -u construct -n 200

# Last 5 minutes
sudo journalctl -u construct --since "5m ago"

# Today's logs
sudo journalctl -u construct --since today

# Errors only
sudo journalctl -u construct -p err

# Between times
sudo journalctl -u construct --since "2025-03-27 14:00" --until "2025-03-27 15:00"

Docker Containers

# List running containers
docker ps

# Container logs
docker logs construct-dev

# Exec into container
docker exec -it construct-dev bash

# Supervisor status inside container
docker exec construct-dev supervisorctl status

Grant Pro Access

cd backend

# List all users
bun run scripts/grant-pro.ts

# Grant pro by email/username
DB_PATH=/opt/construct/data/construct.db bun run scripts/grant-pro.ts ankush4singh

Architecture

Local Machine                    VPS (vps.ankush.one)
─────────────                    ────────────────────
./scripts/deploy.sh ──SSH──→     ~/construct/
                                   ├── backend/     → bun (systemd: construct.service)
                                   ├── frontend/    → static files served by backend
                                   ├── agent/       → compiled binary in Docker containers
                                   └── container/   → Dockerfile + browser-use-service

                                 nginx (:443) → backend (:3000) → Docker containers

Config Files

File Purpose
.env.production Production environment variables (on VPS)
.env Local development environment
nginx.conf Nginx reverse proxy config
/etc/systemd/system/construct.service Systemd service (created by deploy.sh setup)