Skip to content

Latest commit

 

History

History
279 lines (228 loc) · 9.98 KB

File metadata and controls

279 lines (228 loc) · 9.98 KB

Platform Context for Gemini — brackenw3.github.io Reconstruction

This file provides Gemini with full context on the willbracken.com platform so the site can showcase and integrate with it accurately.


Live Platform Endpoints

Cloudflare Workers (production)

https://ai-router.will-i-bracken.workers.dev       — tiered AI routing (free→elite)
https://site-assistant.will-i-bracken.workers.dev  — public chat + contact form
https://cf-agent.will-i-bracken.workers.dev        — Cloudflare management (Gemini-powered)
https://cf-monitor.will-i-bracken.workers.dev      — daily health monitoring (free AI)
https://analytics-dashboard.will-i-bracken.workers.dev — AI usage + cost dashboard
https://r2-explorer.will-i-bracken.workers.dev     — R2 file browser + graph metadata
https://agent-code.will-i-bracken.workers.dev      — code review/gen (GPT-4o)
https://agent-research.will-i-bracken.workers.dev  — research synthesis (GPT-4o)
https://agent-data.will-i-bracken.workers.dev      — SQL + data analysis
https://agent-writing.will-i-bracken.workers.dev   — technical writing (Claude Sonnet)
https://agent-gemini.will-i-bracken.workers.dev    — Gemini Flash/Pro/Ultra direct
https://security-txt-worker.will-i-bracken.workers.dev — security.txt

Custom domains (willbracken.com)

https://willbracken.com                      — main domain (CF Pages, force graph)
https://n8n.willbracken.com                  — n8n automation (Railway, US East)
https://ollama-desktop.willbracken.com       — i9 RTX 4080 Ollama (CF Tunnel)
https://ollama-macbook.willbracken.com       — M3 Pro 18GB Ollama (CF Tunnel, Docker)
https://analytics-dashboard.willbracken.com  — analytics (pending CF Pages setup)

n8n Webhooks (set after n8n is stable)

Webhook base: https://n8n.willbracken.com/webhook/
family-task-capture  — creates Jira tasks from form submissions
family-jira-done     — triggers Confluence page creation when task Done
email-ingestion-realtime  — processes new emails

AI Agent API Reference

All agents accept POST with JSON body. No auth required for public endpoints.

ai-router (primary entry point)

POST https://ai-router.will-i-bracken.workers.dev/chat
Headers: X-Tier: free|standard|premium|elite
         X-Agent: code|research|data|writing|gemini
Body: { "prompt": "string" }
      { "messages": [{"role":"user","content":"..."}] }

Tiers:

  • free: llama-3.3-70b:free, mistral-7b:free, gemma-3-27b:free
  • standard: gpt-4o-mini, gemini-flash-1.5, claude-haiku
  • premium: gpt-4o, claude-sonnet-4-5, gemini-pro-1.5
  • elite: claude-opus-4-5, o3, gemini-2.0-ultra

Specialized agents

POST /chat  — returns { response, model, latency_ms, usage }
GET  /      — returns agent info, capabilities, models

site-assistant (public-facing)

POST https://site-assistant.will-i-bracken.workers.dev/chat
Body: { "messages": [{"role":"user","content":"..."}] }

POST /contact
Body: { "message": "...", "captchaToken": "...", "category": "general" }

GET /health

Credentials & Secret Locations

Never hardcode secrets. All credentials are stored in:

Secret Location Key name
Cloudflare API tokens CF KV agent-secrets (id: 373889c056f24f9fa21959e819e3e281) CF_ADMIN_TOKEN, CF_READONLY_TOKEN, etc.
Supabase URL CF KV agent-secrets SUPABASE_URL
Supabase key CF KV agent-secrets SUPABASE_SECRET_KEY
OpenRouter API CF Wrangler secrets OPENROUTER_API_KEY
Gemini API CF Wrangler secrets GOOGLE_AI_STUDIO_KEY
Mistral API Railway env vars MISTRAL_API_KEY
n8n Railway Railway env vars DB_POSTGRESDB_*
Ollama Mac CF KV CF_TUNNEL_TOKEN_MACBOOK

For frontend calls to CF Workers: no auth needed for public endpoints. For admin operations: use CF_READONLY_TOKEN from KV as X-Agent-Key header.


Data Layer

Supabase (source of truth)

Project: smttdhtpwkowcyatoztb
URL: https://smttdhtpwkowcyatoztb.supabase.co
Tables: ai_usage_log, workflow_logs, infra_events, emails (email pipeline)
Views: ai_daily_costs, ai_provider_summary, email_tier_summary

Cloudflare D1 (edge metrics)

willbracken-observability (id: 91f67eae-1940-4764-b079-710622f22652)
Tables: requests, ai_usage, security_events, nodes, edges, hourly_patterns

Vectorize (semantic search)

Indexes: email-search, knowledge-base, platform-docs
Dimensions: 768 (nomic-embed-text / bge-base-en)
Metric: cosine

R2 Storage

willbracken-logs  — email warm tier, log archives
storagewebbucket  — general assets

Platform Architecture Summary

willbracken.com (CF Pages)
    │
    ├── Cloudflare Workers (edge compute, US East)
    │       ai-router → 5 specialized agents
    │       site-assistant (public chat/contact)
    │       cf-agent (infra management, Gemini)
    │       cf-monitor (free daily monitoring)
    │       analytics-dashboard (D1 + Supabase)
    │       r2-explorer (file browser + graph)
    │
    ├── AI Providers (via Cloudflare AI Gateway)
    │       OpenRouter → GPT-4o, Claude, Llama, etc.
    │       Google AI Studio → Gemini Flash/Pro/Ultra
    │       Cloudflare Workers AI (free: Llama, Mistral)
    │       Anthropic, Perplexity, xAI, Mistral, ZAI
    │
    ├── n8n (Railway, US East) — workflow automation
    │       family-task-capture → Jira
    │       email-ingestion → Supabase + R2
    │       weekly-digest → email
    │
    ├── Local LLMs (via Cloudflare Tunnels)
    │       ollama-desktop.willbracken.com (i9, RTX 4080)
    │       ollama-macbook.willbracken.com (M3 Pro, 18GB)
    │       Models: qwen2.5-coder, deepseek-r1, qwen3, llava
    │
    └── Data
            Supabase (Postgres, US East) — source of truth
            Cloudflare D1 — edge analytics
            Cloudflare Vectorize — semantic search
            Cloudflare R2 — object storage
            Google Drive — email cool tier (5-10TB)
            iDrive e2 — email cold tier (S3-compatible)

Upcoming Integrations (reference for site design)

Email Pipeline

  • Armstrong @zoominternet.net (IMAP, shared family mailbox)
  • Outlook accounts (IMAP)
  • Processing: spam filter → vectorize → task detection → Jira
  • Storage: R2 (warm) → Google Drive (cool) → iDrive (cold)
  • Search: Vectorize semantic search, natural language queries
  • MongoDB: document storage for email bodies
  • Neo4j: graph layer (senders, topics, tasks, threads as nodes/edges)

Atlassian (setup in progress)

  • Jira project: FAM (family goals/tasks)
  • Confluence: knowledge base ("What We Did")
  • n8n integration: task capture from forms + emails → Jira
  • Issue types: Project (Epic), Task, Step (Subtask)

HashiCorp Vault (roadmap)

  • Secrets management replacing current KV approach
  • PKI for mTLS certificate automation
  • Dynamic Supabase credentials via Postgres secrets engine

Azure Entra SSO (roadmap)

  • Personal tenant (separate from enterprise work)
  • Protects Streamlit apps on Railway
  • Cloudflare Access as proxy IdP layer

Frontend Design Direction

Current site (brackenw3.github.io)

Multiple HTML pages already exist:

  • index.html (46KB) — main portfolio
  • ai-lab.html — AI lab demos
  • analytics.html — analytics demos
  • data-science.html — data science projects
  • go-systems.html — Go language projects
  • ms-teams-demo.html — MS Teams integration demo
  • code-galaxy.html — code visualization
  • projects.html — projects listing

willbracken.com (CF Pages, separate)

  • Force-directed network graph as hero element (React + react-force-graph-2d)
  • Shows platform architecture as live, animated graph
  • Node types: hub, workers, AI providers, data stores, services, Ollama
  • Link particles show data flow direction and volume
  • Dark space theme, glowing nodes, pulsing on activity
  • Source: BrackenW3/Cloudflare/apps/willbracken-landing

GitHub Pages reconstruction goals

  • Showcase deployed projects with live status from cf-monitor
  • Integrate AI demos (chat via site-assistant)
  • Display real analytics from Analytics Engine
  • LinkedIn/GitHub widget integration
  • SSO via Cloudflare Access (not requiring page-level auth code)
  • Mobile-friendly, non-technical accessible

Docker Approach for GitHub Pages Backend

Keep separate from existing n8n Docker stack. Recommended:

brackenw3.github.io/
  docker-compose.yml   — development services only
  ├─ portfolio-api/    — FastAPI/Node.js serving dynamic data
  ├─ data-cache/       — Redis for caching GitHub API / analytics
  └─ .env.template     — API keys for portfolio backend

Production hosting:

  • Static frontend → GitHub Pages (already there)
  • Dynamic API → Railway service (separate from n8n)
  • Or: CF Pages Functions (serverless, no separate service needed)

Recommendation: Use CF Pages Functions for the portfolio API layer. No Docker needed — Functions run at the CF edge, use same credentials as the Workers, and deploy automatically on git push. Only use Docker for local development of more complex backends.


Repositories

Repo Purpose
BrackenW3/brackenw3.github.io GitHub Pages portfolio (you are here)
BrackenW3/Cloudflare CF Workers, Pages apps, docker-mcp stack
BrackenW3/n8n n8n workflows, Railway config, Dockerfiles
BrackenW3/WSL_Docker Windows WSL2 workspace (n8n submodule)
BrackenW3/VSCode_Folders Cross-platform VSCode projects, Streamlit apps

Key Environment Variables (for CF Pages Functions)

Set in CF Pages > Settings > Environment variables:

SUPABASE_URL          = https://smttdhtpwkowcyatoztb.supabase.co
SUPABASE_ANON_KEY     = (from Supabase dashboard)
CF_ACCOUNT_ID         = a429049d531ba955ef37fbd55ce5f865
N8N_WEBHOOK_BASE      = https://n8n.willbracken.com/webhook
AI_ROUTER_URL         = https://ai-router.will-i-bracken.workers.dev
GITHUB_TOKEN          = (from GitHub settings, read-only repos scope)