Memorang take-home exercise: detect, triage, and heal GCP Professional Cloud Architect practice questions when upstream Google Cloud sources change.
Live demo: source-document-management-system-five.vercel.app
- Cache-aware source polling with Vercel Cron
- Change detection, provenance-based impact analysis, and triage
- AI healing proposals (Vercel AI SDK + OpenRouter)
- Human review workflow (approve / reject / edit)
- Cloud Next simulation with SSE progress UI
- Dashboard, sources, changes, review queue, and content views
- Node.js 20+
- pnpm
- Supabase project (free tier)
- OpenRouter API key (for auto-healing proposals)
- Install dependencies:
pnpm install- Copy environment variables:
cp .env.example .env.localFill in values from your Supabase project dashboard (Project Settings → API Keys):
| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Project URL |
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY |
Publishable key (sb_publishable_...) |
SUPABASE_SECRET_KEY |
Secret key (sb_secret_..., server-only) |
CRON_SECRET |
Random string for Vercel Cron auth |
OPENROUTER_API_KEY |
OpenRouter API key for healer agent |
OPENROUTER_HEALER_MODEL |
Optional; defaults to openai/gpt-oss-120b:free |
- Apply the database migration:
Run supabase/migrations/20250610120000_initial_schema.sql in the Supabase SQL editor.
pnpm db:migrate- Seed baseline data:
pnpm db:seed- Start the dev server:
pnpm devOpen http://localhost:3000.
- Dashboard — source counts, open changes, review queue depth
- Sources — five registered GCP URLs with v1 snapshots
- Content — twelve practice questions with provenance links
Poll registered sources against live URLs (requires network; may take several minutes if healing runs):
pnpm poll:sources:force- Open the Dashboard
- Click Simulate Google Cloud Next Update
- Watch per-source progress in the dialog
- Use Minimize to collapse to a floating spinner; click it to restore
- When complete, dashboard stats refresh and new items appear in Changes and Review
The simulation injects pre-authored v2 snapshots for four doc sources; the exam guide stays unchanged.
- Go to Review — proposals sorted by priority
- Open a proposal — side-by-side current vs proposed, diff excerpt, citations
- Approve, Reject, or Edit and approve
- Content — updated questions return to
active - Changes — drill into a change event for affected items and proposals
| Command | Description |
|---|---|
pnpm dev |
Start Next.js dev server |
pnpm build |
Production build |
pnpm db:seed |
Load baseline GCP PCA data |
pnpm db:migrate |
Migration reminder |
pnpm poll:sources |
Poll due sources |
pnpm poll:sources:force |
Reset schedule and poll all sources |
- Import the repository in Vercel
- Add all environment variables from
.env.example - Deploy — cron runs
/api/cron/poll-sourcesdaily - Simulation SSE (
/api/simulation/progress) requires sufficient function duration (maxDuration = 300on Pro plan recommended for full healing runs)
See docs/SYSTEM_DESIGN.md for architecture and technical decisions.