-
-
Notifications
You must be signed in to change notification settings - Fork 1
setup
Documentation Authority: SYSTEM_MODEL.md Section 1 (Tech Stack)
- SYSTEM_MODEL.md - Primary authority for technology stack and version requirements
- AGENTS.md - Implementation patterns and Context7 references
- Node.js: v22.12.0 or higher (required by current Admin/Public toolchain)
- npm: v10+
- Flutter: v3.38.5+ (if working on mobile)
- PlatformIO: Core 6.1+ (if working on IoT)
-
Supabase CLI: v2.70+ (install globally or use
npx supabase)
git clone <repository_url>
cd <repo-root>Refer to .env.example in each directory. Public portal static builds require PUBLIC_TENANT_ID (or VITE_PUBLIC_TENANT_ID).
For a full clone/bootstrap + deployment-oriented walkthrough, use:
docs/dev/environment-bootstrap.mdpython3 scripts/setup_awcms_environment.py
When syncing linked/remote schema snapshots, prefer:
npx supabase migration list --linked
npx supabase db pull --schema public,extensionsThis avoids storage-managed objects that can churn migrations in local shadow databases.
For local schema changes, run:
npx supabase migration list --local
npx supabase db push --localValidate root/mirror Supabase parity before opening a PR:
scripts/verify_supabase_migration_consistency.shIf migration history drifts, use the repair helper from repo root:
scripts/repair_supabase_migration_history.sh
scripts/repair_supabase_migration_history.sh --apply --local
scripts/repair_supabase_migration_history.sh --apply --linkedIf using Context7 tools via awcms-mcp, set CONTEXT7_API_KEY in awcms/.env.
We typically use npm for web projects and flutter pub for mobile.
# Admin Panel
cd awcms
npm install
# Public Portal (Primary Tenant)
cd ../awcms-public/primary
npm install
# Edge Worker
cd ../../awcms-edge
npm install
# MCP Server
cd ../awcms-mcp
npm install| Service | Command | Directory | Port |
|---|---|---|---|
| Admin Panel | npm run dev |
awcms/ |
3000 |
| Public Portal | npm run dev |
awcms-public/primary/ |
4321 |
| Edge Worker | npm run dev:local |
awcms-edge/ |
8787 |
| MCP Server | npm run dev |
awcms-mcp/ |
stdio / MCP runtime |
| Mobile App | flutter run |
awcms-mobile/primary/ |
Device/Emu |
| IoT Firmware | pio run -t upload |
awcms-esp32/primary/ |
Serial |
Local admin development expects a tenant to resolve on localhost. The default dev slug is primary via VITE_DEV_TENANT_SLUG, so make sure the tenant exists before signing in.
# Start local Supabase
npx supabase start
# Seed the primary tenant (required for localhost)
node awcms/src/scripts/seed-primary-tenant.js
# Create or reset the default admin user
node awcms/src/scripts/create-admin-user.js
# Optional: grant owner role and seed menus/modules
node awcms/src/scripts/assign-owner-role.js
node awcms/src/scripts/seed-sidebar.jsseed-sidebar.js requires VITE_SUPABASE_URL and SUPABASE_SECRET_KEY in awcms/.env.local. Never expose the secret key in client code.
Use mcp.json as the repo source of truth for MCP topology.
# Optional: run local AWCMS MCP server directly
cd awcms-mcp
npm install
npm run dev
# Verify connected MCP servers in OpenCode
opencode mcp listGitHub MCP uses scripts/start_github_mcp.sh and requires one of: GITHUB_PERSONAL_ACCESS_TOKEN, GITHUB_MCP_PERSONAL_ACCESS_TOKEN, GH_TOKEN, or GITHUB_TOKEN.
The Cloudflare Worker layer lives in awcms-edge/ and is the primary edge HTTP runtime for AWCMS.
cd awcms-edge
npm install
cp .dev.vars.example .dev.vars
npm run dev:localNotes:
-
npm run dev:localloads local Worker secrets fromawcms-edge/.dev.vars. - Worker bindings are defined in
awcms-edge/wrangler.jsonc. -
awcms/,awcms-public/primary/,awcms-public/smandapbun/, andawcms-edge/currently align on@supabase/supabase-js^2.99.3; still treatawcms-edge/package.jsonas the source of truth for Worker-only dependency changes. - Local
wrangler devR2 state is isolated by default. Usenpm run sync:r2:remoteornpm run sync:r2:localinawcms-edge/when you need explicit local/remote media reconciliation. - Production-only secrets should be set with
npx wrangler secret put <SECRET_NAME>.
| Script | Purpose | Scope |
|---|---|---|
scripts/repair_supabase_migration_history.sh |
Repair migration history states (applied/reverted) from local timestamps |
Local (--local) and linked (--linked) |
scripts/verify_supabase_migration_consistency.sh |
Verify root/mirror migration parity and migration-list alignment | Local by default; add --linked for remote check |
scripts/check_markdown_local_links.mjs |
Validate maintained markdown links to local repository targets before external link checks run | Docs workflow and local docs validation |
scripts/start_github_mcp.sh |
Start local Docker-backed GitHub MCP with token auto-discovery | MCP runtime |
scripts/update_cloudflare_secrets.sh |
Interactive Cloudflare Pages secret sync from project .env files |
Deployment ops |
packages/awcms-shared/ is a maintained source-first TypeScript package used by the public portals.
It currently ships a standalone npm run typecheck script for direct validation, while runtime/build
coverage still happens through consuming workspaces such as awcms-public/primary and awcms-public/smandapbun.
cd packages/awcms-shared
npm install
npm run typecheckWe check code quality in CI. Run these before pushing:
# Admin
cd awcms
npm run lint
# Public
cd ../awcms-public/primary
npm run check