FAS Local Setup Guide
This guide covers setting up the Frontend Application Split repositories for local development.
Table of Contents
- Prerequisites
- Quick Start: Run a Single Suite
- Suite-Specific Local Development
- Oracle-Bridge Local Setup
- Environment Variables
- Package Development: Cross-Package Changes
- Full Stack: Suite + IC Canisters
- Repository Clone Locations
- Suite-Specific Troubleshooting
- Related Documentation
Prerequisites
- Node.js 20+ and npm 9+
- Git
- GitHub account with access to the Hello-World-Co-Op organization
- dfx CLI (optional, only needed for IC canister deployment)
Quick Start: Run a Single Suite
The fastest way to get started is running one suite locally.
1. Configure GitHub Packages Authentication
Create a GitHub Personal Access Token (PAT) with read:packages scope, then configure npm:
# Create/edit ~/.npmrc (global npm config)
echo "@hello-world-co-op:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=YOUR_GITHUB_PAT" >> ~/.npmrcReplace YOUR_GITHUB_PAT with your actual token.
Note: The scope MUST be
@hello-world-co-op(matching the GitHub org nameHello-World-Co-Op). Using@helloworlddaowill fail.
2. Clone and Run a Suite
Pick any suite and get it running:
git clone https://github.com/Hello-World-Co-Op/<suite-name>.git
cd <suite-name>
cp .env.example .env.local
# Edit .env.local with canister IDs (see Environment Variables below)
npm install
npm run devDefault ports:
| Suite | Port | URL |
|---|---|---|
| marketing-suite | 5173 | http://localhost:5173 |
| think-tank-suite | 5174 | http://localhost:5174 |
| governance-suite | 5174 | http://localhost:5174 |
| dao-suite | 5174 | http://localhost:5174 |
| otter-camp-suite | 5176 | http://localhost:5176 |
| dao-admin-suite | 5176 | http://localhost:5176 |
3. Run Tests
# Unit tests
npm test
# TypeScript check
npx tsc --noEmit
# Lint
npm run lint
# E2E tests (if available)
npm run test:e2eSuite-Specific Local Development
marketing-suite (Standalone)
The marketing suite is the simplest to run -- no auth or oracle-bridge needed.
cd ~/git/marketing-suite
npm install
npm run dev # Dev server on http://localhost:5173Build with SEO pre-rendering:
npm run build # Runs: tsc + vite build + prerender + sitemap generationPre-rendered HTML files are generated in dist/ along with sitemap.xml. Build time includes ~30s for pre-rendering (expected).
Key files:
src/entry-prerender.tsx-- SSR entry point (add new routes here)scripts/prerender.ts-- Build-time HTML generationscripts/generate-sitemap.ts-- Sitemap generation (add new routes here)
otter-camp-suite (Standalone)
The game suite is standalone but has specific Phaser.js requirements.
cd ~/git/otter-camp-suite
npm install
npm run dev # Dev server on http://localhost:5176
# Navigate to /otter-camp to load the gameOptional -- Multiplayer: To enable real-time multiplayer presence, start oracle-bridge:
cd ~/git/oracle-bridge
npm run dev # WebSocket server on http://localhost:3000The game gracefully degrades to single-player mode if oracle-bridge is unavailable.
Key environment variables:
VITE_WS_URL=ws://localhost:3000 # WebSocket for multiplayer
VITE_IC_HOST=http://127.0.0.1:4943 # IC host (optional, no canister calls in game)dao-suite (Auth-Integrated)
The dao-suite requires oracle-bridge for authentication.
# 1. Start oracle-bridge (required for auth)
cd ~/git/oracle-bridge
npm run dev # http://localhost:3000
# 2. Start dao-suite
cd ~/git/dao-suite
cp .env.example .env.local
# Edit .env.local:
# VITE_ORACLE_BRIDGE_URL=http://localhost:3000
# VITE_THINK_TANK_URL=http://localhost:5174
npm install
npm run dev # http://localhost:5174
# Alternative: bypass auth for local development
npm run dev:qa # Sets VITE_DEV_AUTH_BYPASS=trueAuth flow: Unauthenticated users are redirected to VITE_THINK_TANK_URL for login. After login, they are redirected back with a session cookie.
dao-admin-suite (Auth-Integrated + RBAC)
Same as dao-suite, plus AdminGuard for admin-only routes.
# 1. Start oracle-bridge (required for auth)
cd ~/git/oracle-bridge
npm run dev
# 2. Start dao-admin-suite
cd ~/git/dao-admin-suite
cp .env.example .env.local
# Edit .env.local (same as dao-suite)
npm install
npm run dev # http://localhost:5176
# Alternative: bypass auth for local development
npm run dev:qa # Sets VITE_DEV_AUTH_BYPASS=trueNote: dev:qa mode bypasses AdminGuard locally. In staging/production, AdminGuard enforces role-based access.
think-tank-suite and governance-suite
These suites were migrated in FAS-3 and follow the same setup pattern:
cd ~/git/<suite-name>
npm install
cp .env.example .env.local
# Edit .env.local with canister IDs
npm run devFor QA testing without authentication:
npm run dev:qa # Sets VITE_DEV_AUTH_BYPASS=trueOracle-Bridge Local Setup
The oracle-bridge is required for auth-integrated suites (think-tank, governance, dao, dao-admin).
Running oracle-bridge locally
cd ~/git/oracle-bridge
npm install
npm run dev # Starts on http://localhost:3000Verify oracle-bridge is running
curl http://localhost:3000/health
# Expected: {"status":"ok"}Configure suites to use local oracle-bridge
In each auth-integrated suite's .env.local:
VITE_ORACLE_BRIDGE_URL=http://localhost:3000For staging, use:
VITE_ORACLE_BRIDGE_URL=https://staging-oracle.helloworlddao.comCommon oracle-bridge issues
| Issue | Cause | Fix |
|---|---|---|
ECONNREFUSED on port 3000 | oracle-bridge not running | Start with npm run dev |
ERR_ERL_KEY_GEN_IPV6 | express-rate-limit IPv6 validation | Fixed in FAS-8.1 -- pull latest |
| CORS errors | Missing origin in oracle-bridge config | Add http://localhost:5174 to allowed origins |
Environment Variables
Each suite requires environment variables for canister IDs and service URLs. Copy .env.example to .env.local and configure:
Common Variables
| Variable | Description | Example |
|---|---|---|
VITE_IC_HOST | IC network host | https://ic0.app or http://localhost:4943 |
VITE_AUTH_SERVICE_CANISTER_ID | auth-service canister | gexqh-jqaaa-aaaae-acsxq-cai |
VITE_USER_SERVICE_CANISTER_ID | user-service canister | j4rvr-3aaaa-aaaao-qkvfq-cai |
Auth-Integrated Suite Variables
| Variable | Description | Example |
|---|---|---|
VITE_ORACLE_BRIDGE_URL | Oracle-bridge URL | http://localhost:3000 |
VITE_THINK_TANK_URL | Think Tank URL (login redirect) | http://localhost:5174 |
VITE_DEV_AUTH_BYPASS | Skip auth in dev mode | true (dev only) |
Suite-Specific Variables
See each suite's .env.example for the complete list of required variables.
Package Development: Cross-Package Changes
When you need to modify a shared package and test it in a suite simultaneously, use the npm link workflow.
npm link Workflow
# 1. Clone the package you want to modify
git clone https://github.com/Hello-World-Co-Op/ui.git
cd ui
npm install
npm run build
# 2. Create a global link
npm link
# 3. In your suite, link to the local package
cd ../think-tank-suite
npm link @hello-world-co-op/ui
# 4. Make changes to ui, rebuild, and they appear in the suite
cd ../ui
# ... edit files ...
npm run build
# Changes are immediately available in think-tank-suitefile: References (Alternative)
For rapid iteration, you can use file: references in package.json:
{
"dependencies": {
"@hello-world-co-op/ui": "file:../ui"
}
}Then run npm install to create the symlink.
Warning: Do NOT commit
file:references. Thepackage-publish.ymlworkflow detects stalefile:references inpackage-lock.jsonand falls back tonpm installto avoid broken symlinks in CI.
Full Local Dev Workflow Documentation
For the complete cross-package development guide including multi-package chains, IDE integration, and troubleshooting, see the Local Development Workflow section in the dot-github README.
Full Stack: Suite + IC Canisters
To run a suite with real canister backends:
Option A: Against Staging Canisters
Use the staging canister IDs in your .env.local:
VITE_IC_HOST=https://ic0.app
VITE_AUTH_SERVICE_CANISTER_ID=gexqh-jqaaa-aaaae-acsxq-cai
# ... other staging canister IDs from .env.exampleOption B: Against Local PocketIC
Requires the full local dev environment setup:
dfx start --background
dfx deploy # Deploys all canistersRepository Clone Locations
By convention, all repos live under ~/git/:
~/git/
├── hello-world-workspace/ # VS Code workspace
├── docs/ # Documentation
├── api/ # @hello-world-co-op/api
├── auth/ # @hello-world-co-op/auth
├── ui/ # @hello-world-co-op/ui
├── suite-template/ # Suite template
├── think-tank-suite/ # Think Tank app
├── governance-suite/ # Governance app
├── marketing-suite/ # Marketing site (standalone)
├── otter-camp-suite/ # Otter Camp game (standalone)
├── dao-suite/ # DAO member dashboard
├── dao-admin-suite/ # DAO admin dashboard
├── oracle-bridge/ # Off-chain auth proxy
├── dot-github/ # .github org repo (reusable workflows)
└── ... # Backend canister reposSuite-Specific Troubleshooting
marketing-suite: SEO pre-rendering build time
Issue: npm run build takes > 60 seconds. Cause: Pre-rendering all routes with ReactDOMServer.renderToString() is slow. Fix: This is expected (~30s for pre-rendering). If adding many routes, use selective pre-rendering (only pre-render SEO-critical pages).
otter-camp-suite: Phaser.js not loading
Issue: Game canvas does not render, black screen. Cause: Phaser.AUTO configuration issue or missing game assets. Fix:
- Check browser console for Phaser errors
- Verify
Phaser.AUTOmode is set in game config - Check that game assets exist in
public/assets/ - Navigate to
/otter-camp(not root/)
dao-suite / dao-admin-suite: Oracle-bridge connection refused
Issue: ECONNREFUSED 127.0.0.1:3000 errors. Cause: oracle-bridge is not running locally. Fix:
- Start oracle-bridge:
cd ~/git/oracle-bridge && npm run dev - Verify:
curl http://localhost:3000/health - Check
VITE_ORACLE_BRIDGE_URLin.env.localishttp://localhost:3000 - Alternative: use
npm run dev:qato bypass auth entirely
Staging Deployment Pre-Flight Checklist
Before deploying a service to staging for the first time (especially oracle-bridge or new suite integrations), verify each item. This checklist was created after FAS-8.1 discovered 5 simultaneous bugs during the first oracle-bridge staging deployment.
Environment Variables
- [ ] All required env vars are set in the staging deployment config
- [ ]
AUTH_SERVICE_CANISTER_IDis correct for staging - [ ]
AUTH_COOKIE_DOMAINis set to.helloworlddao.com - [ ]
AUTH_COOKIE_SECURE=trueandAUTH_COOKIE_SAME_SITE=lax - [ ]
VITE_ORACLE_BRIDGE_URLpoints to the staging oracle-bridge URL - [ ]
VITE_THINK_TANK_URLpoints tohttps://staging-think-tank.helloworlddao.com
Source Files
- [ ] All source files are included in the deployment (no missing modules)
- [ ] No local-only files accidentally excluded from git
- [ ] Build output (
dist/) is complete and includes all routes
Canister Health
- [ ] Target canister is in
Runningstate:dfx canister status <id> --network ic - [ ] Canister has sufficient cycles (minimum 2 TC buffer)
- [ ] Dependent canisters (auth-service, user-service) also have sufficient cycles
- [ ] Inter-canister call targets are registered (e.g.,
authorized_canisterslist)
Dependencies
- [ ] All npm dependencies installed (no missing packages)
- [ ] No
file:references inpackage-lock.json(breaks CI) - [ ]
@dfinity/agentversion matches across packages
Suite-Specific (.env.staging)
- [ ]
.env.stagingfile exists for auth-integrated suites (dao-suite, dao-admin-suite) - [ ] All
VITE_*variables are set (they are baked in at build time) - [ ] Build with staging env: verify
VITE_ORACLE_BRIDGE_URLis not empty
Post-Deploy Verification
- [ ] Health check endpoint returns OK:
curl https://<service-url>/health - [ ] Browser test: navigate to staging URL, verify rendering
- [ ] Auth flow: login → session check → logout → session check
- [ ] No console errors in browser DevTools
Related Documentation
- Architecture Overview -- How packages and suites fit together
- Repository Map -- Which repo contains what
- Suite Creation Guide -- Creating new suites
- Troubleshooting -- Common issues and fixes
- Cross-Suite Auth Debugging -- SSO troubleshooting
- Rollback Procedures -- Suite-specific rollback steps