02 · Deployment stack

What runs where. Critical: staging is the live product surface today.

Runtime diagram

flowchart TB
  subgraph INTERNET
    DNS1[staging.gopastearth.com]
    DNS2[dochub.gopastearth.com]
    DNS3[gperep.gopastearth.com]
  end

  subgraph THISBOX["Linux app server 104.207.140.143"]
    NGX[Nginx]
    BE["pawspos-backend
PM2 cluster ×2 :4000"] FE["pawspos-frontend
Vite dev :5173 ⚠"] PUB["public-site/dist
static + optional Vite :5174"] DOC["documentation/dochub
static DocHub"] FS["/mnt/vfs/platform-catalog
media files"] end subgraph GCP["Google Cloud"] SQL[("Cloud SQL MySQL 8
ppos-sandyone · db-g1-small")] end DNS1 --> NGX DNS2 --> NGX DNS3 --> NGX NGX -->|/api /auth /media| BE NGX -->|/admin /dashboard /login …| FE NGX -->|/ marketing store| PUB NGX -->|DocHub root| DOC BE --> SQL BE --> FS
Known maturity gap Staff dashboard is served from a live Vite dev server, not a production static build. Public site mostly uses prebuilt dist/. See audit S1-2.

Layer strips

1 · Presentation

SPAs & players

frontend/ staff OS · public-site/ marketing/store/barcode · signage player · kiosk layouts

2 · Edge

Nginx

TLS (Let’s Encrypt on staging) · reverse proxy · static roots · ACME challenges

3 · Application

Express + PM2

backend/server.js · middleware · ~150 route files · background crypto watchers in-process

4 · Domain

Services

backend/services/* CoreInvoicing, cart, HR, inventory, bridge managers, catalog…

5 · Data

Cloud SQL

Master + per-tenant main/analytics/HR · direct IP connect (proxy PM2 entry unused/errored)

6 · Integration

Bridge & devices

On-prem Node/C# bridge · printers · local KDS · device heartbeats

Important paths on disk

PathRole
/home/pawspos/app/backendAPI
/home/pawspos/app/frontendStaff SPA
/home/pawspos/app/public-sitePublic SPA
/home/pawspos/app/bridgeLAN bridge
/home/pawspos/app/infrastructurePM2/Nginx scripts
/home/pawspos/app/documentation/OAOTrusted deep docs
/home/pawspos/app/documentation/dochubThis visual hub
/home/pawspos/ForGrok.mdAI/human orientation
/etc/nginx/sites-available/pawspos-stagingLive staging vhost

Deploy commands (reference)

Change typeTypical steps
Backend JSnode --check file.jspm2 restart pawspos-backend --update-env → smoke /api/health or login
Frontend (today)Edit source → restart pawspos-frontend (dev server reloads source; build not what Nginx serves for /admin)
Public sitecd public-site && npm run build → Nginx serves dist/
DocHubEdit static HTML under documentation/dochub — no rebuild
Nginxnginx -t && systemctl reload nginx