Skip to content

Latest commit

 

History

History
133 lines (95 loc) · 4.09 KB

DEPLOY.md

File metadata and controls

133 lines (95 loc) · 4.09 KB

Deploy Procedure (nyampire/Rapid fork)

This document describes how to build and deploy this Rapid fork to the VPS.

Infrastructure

Item Detail
Production URL https://rapid.nyampire.info/
VPS login plateau@<VPS_IP_ADDRESS> (SSH key authentication)
Document root <DOCUMENT_ROOT>: the directory nginx serves Rapid from
Web server Static file serving (no application restart needed)
Plateau API Separate service (nyampire/rapid_plateau_api)
Dashboard Lives in dashboard/ inside the document root, deployed separately (nyampire/rapid_plateau_dashboard)

Replace <VPS_IP_ADDRESS> and <DOCUMENT_ROOT> with your own values in the commands below.

Quick Deploy

# 1. Ensure all changes are committed and pushed
git status
git push origin main

# 2. Build
npm run all

# 3. Check what would be deleted (nothing is expected)
rsync -avzn --delete --exclude '/dashboard/' dist/ plateau@<VPS_IP_ADDRESS>:<DOCUMENT_ROOT>/ | grep '^deleting'

# 4. Deploy to VPS
rsync -avz --delete --exclude '/dashboard/' dist/ plateau@<VPS_IP_ADDRESS>:<DOCUMENT_ROOT>/

Note: The VPS serves static files only. No service restart is required after deployment.

Detailed Steps

1. Pre-deploy Checks

# Run linter (0 errors expected, warnings are OK)
npm run lint

# Run tests (all should pass)
npm run test

# Verify current branch and commit
git log --oneline -3

2. Build

npm run all

This command runs clean, build, and dist in sequence:

  • clean: Removes old build artifacts from dist/
  • build: Generates development bundles (rapid.js, rapid.css), data files, and source maps
  • dist: Generates production bundles (rapid.min.js, rapid.legacy.js, rapid.legacy.min.js) and SVG sprites

Expected output:

  • dist/rapid.js (~7.2 MB, development)
  • dist/rapid.min.js (~2.7 MB, production)
  • dist/rapid.legacy.js / dist/rapid.legacy.min.js (legacy browser support)
  • dist/data/ (localization, imagery, presets)
  • dist/img/ (SVG sprites)

3. Deploy

First, do a dry run and check the files that would be deleted. Nothing should be listed.

rsync -avzn --delete --exclude '/dashboard/' dist/ plateau@<VPS_IP_ADDRESS>:<DOCUMENT_ROOT>/ | grep '^deleting'

Then deploy:

rsync -avz --delete --exclude '/dashboard/' dist/ plateau@<VPS_IP_ADDRESS>:<DOCUMENT_ROOT>/
rsync flag Purpose
-a Archive mode (preserves permissions, timestamps)
-v Verbose output
-z Compress during transfer
--delete Remove files on VPS that no longer exist in dist/
--exclude '/dashboard/' Keep the dashboard. It is not in dist/, so --delete would remove it
-n Dry run: show what would change without changing anything

4. Post-deploy Verification

Open https://rapid.nyampire.info/ in a browser and verify:

  • Page loads without errors
  • Map renders correctly
  • Plateau building data layer is available (Map Data panel > Plateau Japan)
  • Browser console shows no errors (F12 > Console)

Rollback

If a deployment causes issues, redeploy from the previous commit:

# Check previous commits
git log --oneline -10

# Checkout the working commit
git checkout <commit-hash>

# Rebuild and redeploy
npm run all
rsync -avz --delete --exclude '/dashboard/' dist/ plateau@<VPS_IP_ADDRESS>:<DOCUMENT_ROOT>/

# Return to main
git checkout main

Runtime Configuration

These URL hash parameters allow runtime configuration without redeployment:

Parameter Example Description
#plateau_api_url=<url> #plateau_api_url=http://localhost:8000/api/mapwithai/buildings Override Plateau API endpoint
#plateau_conflation=false #plateau_conflation=false Disable client-side conflation (overlap filtering)

Related Documents