monorepo/cloud/infrastructure/production/operations/FRONTEND_UPDATES.md

2.2 KiB

Frontend Updates & Deployment

Quick Reference for MapleFile Frontend

Overview

The frontend runs on Worker Node 9 as a static site built with Vite/React. Updates are deployed by pulling the latest code and rebuilding.

Prerequisites

  • SSH access to worker-9 as dockeradmin
  • Node.js and npm installed on the server

Quick Deploy

# SSH to worker-9 and run deploy script
ssh dockeradmin@<WORKER_9_IP>
~/deploy-frontend.sh

Manual Deploy

# 1. SSH to worker-9
ssh dockeradmin@<WORKER_9_IP>

# 2. Navigate to monorepo
cd /var/www/monorepo

# 3. Pull latest changes (includes .env.production from git)
git pull origin main

# 4. Navigate to frontend
cd web/maplefile-frontend

# 5. Install dependencies (if package.json changed)
npm install

# 6. Build production bundle
npm run build

Verify Deployment

# Check build output exists
ls -la /var/www/monorepo/web/maplefile-frontend/dist/

# Check build timestamp
stat /var/www/monorepo/web/maplefile-frontend/dist/index.html

Rollback

# SSH to worker-9
ssh dockeradmin@<WORKER_9_IP>

# Navigate to monorepo
cd /var/www/monorepo

# Reset to previous commit
git log --oneline -10  # Find the commit to rollback to
git checkout <COMMIT_SHA>

# Rebuild
cd web/maplefile-frontend
npm install
npm run build

Troubleshooting

Build Fails

# Clear node_modules and rebuild
cd /var/www/monorepo/web/maplefile-frontend
rm -rf node_modules
npm install
npm run build

Check Node.js Version

node --version
npm --version

# If outdated, update Node.js

Permission Issues

# Ensure correct ownership
sudo chown -R dockeradmin:dockeradmin /var/www/monorepo

Standard Deployment Workflow

# 1. Local: Commit and push your changes
cd ~/go/src/codeberg.org/mapleopentech/monorepo/web/maplefile-frontend
git add .
git commit -m "feat: your changes"
git push origin main

# 2. Deploy to production
ssh dockeradmin@<WORKER_9_IP>
cd /var/www/monorepo
git pull origin main
cd web/maplefile-frontend
npm install
npm run build

# 3. Verify by visiting the site
# https://maplefile.app (or your domain)

Last Updated: November 2025