Live Demo
- Open the public Cloudflare Pages demo
- Scope: credential-free, synthetic-data demo for product reviewers and evaluators.
Curated supporting repo This repository is kept as optional proof, but it no longer leads the portfolio. Current front door: aix-pilot and doeon-kim-portfolio. Reason: Wellness and consumer positioning are not strong enough for the main product or B2B story.
Buddhist-inspired mindfulness platform built on Cloudflare Pages + Functions + OpenAI API.
System Overview
A calm consumer AI surface that tests whether journaling, reflection, and lightweight coaching can retain users without heavy infrastructure.
| Area | Details |
|---|---|
| Users | Wellness creators, small community operators, and solo users looking for low-friction reflection tools. |
| Technical path | Validate the demo, README, architecture notes, and quality gate before deeper workflow review. |
| System scope | Cloudflare Pages deployment, optional local or hosted AI adapters, journaling flows, and deterministic fallbacks. |
| Operating boundary | This is wellness software, not clinical care; sensitive user content needs clear privacy controls and optional local-only mode. |
| Evaluation path | Run the app locally or inspect the Pages deployment and fallback behavior without requiring external model keys. |
Evaluation Path
- Start here: Try the check-in flow, then confirm fallback coaching works without a provider key.
- Local demo: Run
npm install && npm run dev, then openhttp://localhost:8788. - Checks: Run
npm run verify; it covers syntax checks, lint, and Node tests.
Architecture Notes
- Architecture guide summarizes the system scope, first files to inspect, runtime commands, and known boundaries.
- Quality notes lists the local checks, CI surface, and release expectations for this repository.
- Enterprise readiness notes outlines security, data, operations, integration, and handoff expectations.
- Repository positioning explains why this repository is archived/supporting and where the current technical entry points live.
Features
- 1-minute emotional check-in with 3-minute calming routine
- AI meditation coaching conversation
- Journal insight generation
- OpenAI, OpenRouter, Gemini, and Ollama provider support with explicit routing
- BYOK (bring your own key) with server key fallback
- Offline fallback coaching when no provider is available
- BYOK runtime posture + safety consent banner
- 14-day recovery insight dashboard with data export
- Capacitor-based iOS/Android packaging
Quick Start
npm install
npm run dev
Open http://localhost:8788 in your browser.
Local Setup (Ollama)
ollama serve
ollama pull llama3.2:latest
npm run dev:ollama
Environment Variables (Cloudflare Pages)
OPENAI_API_KEY: Server OpenAI key (off by default, needsALLOW_SERVER_OPENAI_KEY=true)ALLOW_SERVER_OPENAI_KEY: Enable server key usageOPENROUTER_API_KEY: Server-side OpenRouter keyOPENROUTER_MODEL: OpenRouter model name (defaultmistralai/mistral-small-2603)GEMINI_API_KEY: Server-side Gemini keyGEMINI_MODEL: Gemini model name (defaultgemini-2.5-flash)
ENABLE_OLLAMA:true/falseOLLAMA_BASE_URL: Ollama API address (defaulthttp://127.0.0.1:11434)OLLAMA_MODEL: Ollama model name (defaultllama3.2:latest)
See full list of rate limit and security env vars in the source.
API Endpoints
GET /api/config- Client runtime configPOST /api/chat- Check-in / coach / journal generationPOST /api/key-check- OpenAI key validationGET /api/health- Health checkGET /api/meta- Provider/rate-limit metadataGET /api/runtime-brief- Operator readiness briefGET /api/architecture-pack- Safety/runtime boundary summaryGET /api/progress-trends- Coaching trend snapshotGET /api/escalation-readiness- Crisis escalation readinessGET /api/schema/coach-response- Coach response schema
Architecture
the-savior/
public/ # Static frontend (SPA)
functions/api/ # Cloudflare Pages Functions (serverless)
tests/ # Node.js tests
ios/ android/ # Capacitor native shells
Request flow (POST /api/chat)
- CORS check against allowed origins
- Rate limiting (per-IP sliding window)
- Input validation (size, content-type, sanitization)
- Crisis keyword detection - returns hotline resources immediately if matched
- Provider resolution: explicit provider override, then OpenRouter server key, OpenAI BYOK/server key, Gemini server key, Ollama, or explicit offline fallback
- LLM call with provider-specific timeouts
- Error mapping to safe user-facing messages (keys never exposed)
Tests
npm run check
npm test
Deploy
npm run deploy
Mobile
npm run mobile:add:ios
npm run mobile:add:android
npm run mobile:sync
Security Notes
- Never commit API keys
- Default mode is BYOK or fallback only
- All error responses redact API key fragments
- User API keys stored in session storage only
Cloud + AI Architecture
- Cloud + AI architecture blueprint
- Machine-readable architecture manifest
- Validation command:
python3 scripts/validate_architecture_blueprint.py
Enterprise Productization
- Product operating model defines the product scope, trust boundary, operating checks, and service path for this repository.
System Architecture
- System architecture maps the runtime boundary, data/control flow, cloud or local deployment surface, and operating assumptions for this repository.
Service Architecture
- Service architecture defines the cloud resources, account information, cost controls, and production guardrails needed to turn this repo into a scoped service without publishing public financial assumptions.
Search And Service Surface
- Public entry: free static ritual experience
- Paid boundary: premium theme packs, private journal export, and supporter bundle
- Canonical URL: https://the-savior-9z8.pages.dev/
- Lead capture: https://kim3310-doeon-kim-portfolio.pages.dev/?offer=the-savior&inquiry=consumer-prototype-customization#private-inquiry
- Resource route: https://kim3310-doeon-kim-portfolio.pages.dev/resources/the-savior/
- Commercial route: https://kim3310-doeon-kim-portfolio.pages.dev/?offer=the-savior#service-offers
- Machine-readable offer: docs/service-offer.json
- Search growth implementation: docs/search-growth-implementation.md
- Revenue architecture: docs/revenue-architecture.md