This document explains how to run a local development environment that matches the production deployment.
# Install root dependencies (express for dev server)
npm install
# Install React viewer dependencies
cd timeline/viewer && npm install && cd ../..
# Build and serve both Hugo and React
npm run devThe development server will be available at:
- Hugo static site: http://localhost:8080/
- React interactive viewer: http://localhost:8080/viewer
- Static event pages: http://localhost:8080/events/
# Start combined development server (builds if needed)
npm run dev
# Build both Hugo and React
npm run build
# Build Hugo only
npm run build:hugo
# Build React viewer only
npm run build:viewer
# Clean all builds
npm run cleanFor active React development with hot reload:
cd timeline/viewer
npm startThis runs the React dev server on http://localhost:3000/viewer with hot reloading, but without Hugo integration.
The development server (dev-server.js) uses Express to serve:
-
Hugo static site at the root path
/- Built with
hugocommand inhugo-site/ - Output to
hugo-site/public/ - 21,000+ static event pages for SEO
- Built with
-
React viewer at
/viewer- Built with
npm run buildintimeline/viewer/ - Output to
timeline/viewer/build/ - Full interactive experience with filters and search
- Built with
This matches the production deployment created by .github/workflows/ci-cd.yml.
Production Parity: Local development matches production deployment exactly, ensuring:
- Navigation between Hugo and React works correctly
- Static URLs (
/events/[id]/) resolve properly - ShareDialog static links can be tested
- No surprises when deploying
CaptureCascadeTimeline/
├── hugo-site/ # Hugo static site
│ ├── content/
│ │ └── events/ # 21K+ markdown event pages
│ └── public/ # Built static site (git-ignored)
│
├── timeline/
│ └── viewer/ # React interactive viewer
│ ├── src/
│ └── build/ # Built React app (git-ignored)
│
├── dev-server.js # Combined development server
└── package.json # Root package with dev scripts
# 1. Install root dependencies
npm install
# 2. Install React viewer dependencies
cd timeline/viewer
npm install
cd ../..
# 3. Build everything (automatic on first 'npm run dev')
npm run build
# 4. Start development server
npm run devHugo content changes:
npm run build:hugo
# Dev server auto-detects changes and serves new contentReact code changes: For quick iteration, use the React dev server:
cd timeline/viewer
npm startThen rebuild for integrated testing:
npm run build:viewerThe GitHub Actions workflow (.github/workflows/ci-cd.yml) automatically:
- Builds Hugo site
- Builds React viewer
- Merges them into
combined-site/ - Deploys to GitHub Pages
No manual deployment needed - just push to main.
- Development Server: 8080 (combined Hugo + React)
- React Dev Server: 3000 (React only, hot reload)
- Production: Served via GitHub Pages at your custom domain
lsof -ti:8080 | xargs kill -9
npm run devnpm run clean
npm run build
npm run devbrew install hugocd timeline/viewer
rm -rf node_modules package-lock.json
npm install
npm run build