System Architecture
How Protocol Health Club's blood work automation stack fits together — services, data flow, and infrastructure.
System Map
The system connects three external platforms — Junction (lab data), GoHighLevel (CRM), and AWS Bedrock (Claude AI) — into a Next.js application running on a single AWS EC2 instance.
Components
Next.js Application
- Framework: Next.js 14, App Router, TypeScript, Tailwind CSS
- Hosting: AWS EC2 (Ubuntu), port 3000
- Access: SSH tunnel now. Planned: Cloudflare + HTTPS + Next-Auth
AWS Bedrock (Claude AI)
- Auth: Bedrock API key (Bearer token — not IAM)
- Models: Haiku 4.5 (fast), Sonnet 4.6 (extraction), Opus 4.7 (analysis)
- Region: us-east-1
GoHighLevel (GHL)
- Auth: Private Integration Token (PIT), contacts scope
- Contacts: 51 contacts, 190 custom fields, 21 tags
- Capabilities: Full read/write — fields, tags, notes
Junction
- Auth: X-Vital-API-Key header
- Environment: Production / US region
- Capabilities: Lab results, wearable data, user linking
Infrastructure Layout
Network / Security
| Port | Open to internet? | Purpose |
|---|---|---|
| 22 | ✅ Yes | SSH access |
| 3000 | ❌ No — SSH tunnel only | Next.js dashboard |
| 443 | ❌ Not yet | Planned: HTTPS via Cloudflare |