ShaDo Apps Docs

Getting Started

Live Server (VPS) Installation

Deploy ShaDo AI to a production Ubuntu server with Nginx + SSL.

Server Requirements

ItemMinimumNotes
OSUbuntu 22.04 LTS20.04 works; 24.04 untested
RAM2 GB4 GB recommended for AI generation
vCPU12+ for concurrent users
Disk20 GBFor OS + app + DB
DomainRequired2 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 pm2
2

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.0
4

Configure the backend

cp backend.env.example backend/.env
# Edit backend/.env — set DATABASE_URL, REDIS_URL, JWT secrets, FRONTEND_URL
5

Configure the frontend

cp frontend.env.example frontend/.env.local
# Set NEXT_PUBLIC_API_URL=https://app-api.yourdomain.com
6

Run the installer

chmod +x install.sh && ./install.sh
# Installs deps, runs Prisma migrations, builds both apps
7

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 nginx
8

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.com
9

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 save

Backend .env Reference

VariableRequiredDescription
DATABASE_URLPostgreSQL connection string
REDIS_URLRedis URL (default: redis://localhost:6379)
JWT_ACCESS_SECRET64-char random string
JWT_REFRESH_SECRET64-char random string
FRONTEND_URLFrontend URL for CORS (e.g. https://app.yourdomain.com)
PORTBackend port (default: 3003)
NODE_ENVSet to production

Generate JWT secrets:

openssl rand -hex 64  # run twice — once for each secret

DNS Configuration

Add two A records in your DNS provider:

SubdomainTypeValue
appAYour server IP
app-apiAYour server IP

DNS propagation can take up to 24 hours, but usually completes within minutes.

Firewall

ufw allow OpenSSH
ufw allow 'Nginx Full'
ufw enable

Do 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