Getting Started
Live Server (VPS) Installation
Deploy ShaDo AI to a production Ubuntu server with Nginx + SSL.
Server Requirements
| Item | Minimum | Notes |
|---|---|---|
| OS | Ubuntu 22.04 LTS | 20.04 works; 24.04 untested |
| RAM | 2 GB | 4 GB recommended for AI generation |
| vCPU | 1 | 2+ for concurrent users |
| Disk | 20 GB | For OS + app + DB |
| Domain | Required | 2 subdomains: app + app-api |
These steps assume a fresh Ubuntu 22.04 VPS with root access. Run all commands as root or prefix with sudo.
Deployment Steps
1
Install system dependencies
# Node.js 20 via NodeSource
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
# PostgreSQL 16
apt-get install -y postgresql postgresql-contrib
# Redis
apt-get install -y redis-server
# Nginx + Certbot
apt-get install -y nginx certbot python3-certbot-nginx
# PM2
npm install -g pm22
Create the database and user
sudo -u postgres psql -c "CREATE DATABASE product_db;"
sudo -u postgres psql -c "CREATE USER product_user WITH PASSWORD 'yourpassword';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE product_db TO product_user;"3
Upload and extract the package
# Upload from your local machine (run locally):
scp shadoapps-mvp-generator-v1.0.zip root@YOUR_SERVER_IP:/var/www/
# On the server:
cd /var/www
unzip shadoapps-mvp-generator-v1.0.zip
cd shadoapps-mvp-generator-v1.04
Configure the backend
cp backend.env.example backend/.env
# Edit backend/.env — set DATABASE_URL, REDIS_URL, JWT secrets, FRONTEND_URL5
Configure the frontend
cp frontend.env.example frontend/.env.local
# Set NEXT_PUBLIC_API_URL=https://app-api.yourdomain.com6
Run the installer
chmod +x install.sh && ./install.sh
# Installs deps, runs Prisma migrations, builds both apps7
Configure Nginx
# Create Nginx config (replace yourdomain.com with your actual domain):
cat > /etc/nginx/sites-available/shadoapps << 'EOF'
server {
listen 80;
server_name app.yourdomain.com;
location / {
proxy_pass http://localhost:3004;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 80;
server_name app-api.yourdomain.com;
location / {
proxy_pass http://localhost:3003;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
EOF
ln -sf /etc/nginx/sites-available/shadoapps /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx8
Obtain SSL certificates
# Point your DNS A records to this server's IP first, then:
certbot --nginx -d app.yourdomain.com -d app-api.yourdomain.com \
--non-interactive --agree-tos -m your@email.com9
Start services
chmod +x start.sh && ./start.sh
# Starts both services via PM2, prints URLs
# Set PM2 to auto-start on reboot:
pm2 startup && pm2 saveBackend .env Reference
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | ✓ | PostgreSQL connection string |
REDIS_URL | ✓ | Redis URL (default: redis://localhost:6379) |
JWT_ACCESS_SECRET | ✓ | 64-char random string |
JWT_REFRESH_SECRET | ✓ | 64-char random string |
FRONTEND_URL | ✓ | Frontend URL for CORS (e.g. https://app.yourdomain.com) |
PORT | — | Backend port (default: 3003) |
NODE_ENV | — | Set to production |
Generate JWT secrets:
openssl rand -hex 64 # run twice — once for each secretDNS Configuration
Add two A records in your DNS provider:
| Subdomain | Type | Value |
|---|---|---|
app | A | Your server IP |
app-api | A | Your server IP |
DNS propagation can take up to 24 hours, but usually completes within minutes.
Firewall
ufw allow OpenSSH
ufw allow 'Nginx Full'
ufw enableDo not expose ports 3003 or 3004 directly — all traffic must go through Nginx.
Maintenance
# View logs
pm2 logs shadoapps-backend
pm2 logs shadoapps-frontend
# Restart after code changes
pm2 restart shadoapps-backend
pm2 restart shadoapps-frontend
# Renew SSL (auto via cron, but manual if needed)
certbot renew --nginx