Quickstart
Purpose
Get a working VibeSwitch instance running on your machine in under ten minutes. By the end you'll have:
- The API server running and serving the SPA.
- The Vite dev server running (for live UI edits).
- Swagger UI and the in-app Docs panel both reachable.
- One fresh homefront news export on disk, ready to feed the analysis pipeline.
This is the fastest path to "I can see this working." It does not enable auth, set up production deploys, or wire in WhatsApp/audio — those are separate guides linked at the bottom.
Prerequisites
- Required: Node.js 20+ (the project root uses
type: module; older Node versions won't parse the code). - Required:
NEWSAPI_API_KEYfrom NewsAPI.ai — used to fetch homefront-relevant articles. - Optional but recommended:
ANTHROPIC_API_KEY— lets you run signal extraction and narrative generation after ingestion. - Optional:
OPENAI_API_KEY— only needed if you plan to transcribe audio.
Inputs
- Environment variables: a root
.envwith at leastNEWSAPI_API_KEY. Anthropic and OpenAI keys are optional for the Quickstart but required for full analysis. - Two free ports: 3000 (API server) and 5173 (Vite dev server).
Outputs
- Running API: Fastify responds at
http://localhost:3000. - Running UI: Vite serves the SPA at
http://localhost:5173with a proxy to the API. - Docs + OpenAPI reachable:
/api/docs/index,/api/openapi.json, and/api/swaggerall return200. - First ingest artifact: a dated homefront markdown file under
business_modules/news-sites/articles_extracted/articles-homefront-YYYY-MM-DD.md.
Constraints
- Never commit API keys.
.envandclient/.env.localare gitignored — keep them that way. Use environment variables or a secrets manager in production. - Auth is off by default in the Quickstart. If your
.envsetsAUTH_REQUIRED=true, several endpoints will return 401 until you also configure Firebase — see Auth setup. type: module: if you seeSyntaxError: Cannot use import statement outside a module, you're on an old Node version. Upgrade.
Examples
1) Install dependencies
npm install
cd client && npm install
Expected: both installs complete without error. Lockfiles are committed, so you should see consistent versions across machines.
2) Create the .env file
In the repo root:
NEWSAPI_API_KEY=your_key_here
# Optional but recommended:
ANTHROPIC_API_KEY=sk-ant-...
# Optional — only for audio ingestion:
OPENAI_API_KEY=sk-...
# Leave auth off for the quickstart:
AUTH_REQUIRED=false
Expected: the server will start without "API key is required". You can add more keys later — nothing in the Quickstart needs more than NEWSAPI_API_KEY.
3) Start the server
npm run start
Expected: the server logs a startup line and binds to http://localhost:3000. Leave this terminal running.
4) Start the client (dev, second terminal)
npm run client:dev
Expected: Vite prints a local URL (usually http://localhost:5173). Open it — you should see the Home Front Command dashboard. API requests are proxied to :3000 automatically.
5) Verify docs + Swagger
Back in a third terminal:
curl -sS -o /dev/null -w "%{http_code}\n" http://localhost:3000/api/docs/index
curl -sS -o /dev/null -w "%{http_code}\n" http://localhost:3000/api/openapi.json
Expected: both print 200.
Then open these in the browser:
- Swagger UI:
http://localhost:3000/api/swagger— interactive API explorer. - In-app Docs panel: click Docs in the app header.
6) Ingest news for today
npm run homefront-to-md
Expected: two files appear under business_modules/news-sites/articles_extracted/:
articles-homefront.md(the latest run, overwritten each time)articles-homefront-YYYY-MM-DD.md(dated archive)
The command fetches articles from NewsAPI.ai, asks an LLM to filter for homefront relevance, and writes both files.
7) (Optional) Run analysis on the export
If you added ANTHROPIC_API_KEY:
npm run analyze-resilience
Expected: logs show signal extraction, then a scored assessment. The UI's Report tab picks this up on the next refresh.
Troubleshooting
- "API key is required" at startup
- Check: root
.envcontainsNEWSAPI_API_KEY. - Fix: set it and restart the server.
- Check: root
- UI loads but API calls fail / CORS errors
- Check: the API server is running on
:3000and the Vite proxy is intact. - Fix: confirm
client/vite.config.jsproxies/api→http://localhost:3000. Restart both servers.
- Check: the API server is running on
npm run homefront-to-mdruns but no dated file appears- Check: whether
HOMEFRONT_MDis set in your env and points elsewhere. - Fix: unset
HOMEFRONT_MD, or point it to thebusiness_modules/news-sites/articles_extracted/directory.
- Check: whether
SyntaxError: Cannot use import statement outside a module- Check:
node --version. - Fix: upgrade to Node 20+.
- Check:
- 401 Unauthorized from every API call
- Check:
.envforAUTH_REQUIRED=true. - Fix: set it to
falsefor the Quickstart, or follow Auth setup to finish the auth wiring.
- Check:
- Swagger UI is blank
- Check:
http://localhost:3000/api/openapi.jsonreturns valid JSON. - Fix: confirm
openapi/openapi.yamlexists on disk; a missing or malformed spec breaks the UI.
- Check:
Next steps
- Configure auth: Auth setup
- Operate the daily pipeline: Operate the daily pipeline
- Plug in more sources: WhatsApp, Audio
- Understand the model: System dataflow