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
| Path | Role |
|---|---|
/home/pawspos/app/backend | API |
/home/pawspos/app/frontend | Staff SPA |
/home/pawspos/app/public-site | Public SPA |
/home/pawspos/app/bridge | LAN bridge |
/home/pawspos/app/infrastructure | PM2/Nginx scripts |
/home/pawspos/app/documentation/OAO | Trusted deep docs |
/home/pawspos/app/documentation/dochub | This visual hub |
/home/pawspos/ForGrok.md | AI/human orientation |
/etc/nginx/sites-available/pawspos-staging | Live staging vhost |
Deploy commands (reference)
| Change type | Typical steps |
|---|---|
| Backend JS | node --check file.js → pm2 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 site | cd public-site && npm run build → Nginx serves dist/ |
| DocHub | Edit static HTML under documentation/dochub — no rebuild |
| Nginx | nginx -t && systemctl reload nginx |