Domain Structure
Root Domain
professionalperformanceportfolio.com - registered and managed via Cloudflare.
Subdomains
| Subdomain | Purpose | Hosting | Environment |
|---|---|---|---|
professionalperformanceportfolio.com | Marketing / sales site | Cloudflare Pages | Production |
staging.professionalperformanceportfolio.com | Marketing / sales site (staging) | Cloudflare Pages | Staging |
ppp.professionalperformanceportfolio.com | PPP web application | Cloudflare Pages (proxied to S3/CloudFront or direct) | Production |
ppp-staging.professionalperformanceportfolio.com | PPP web application (staging) | Cloudflare Pages | Staging |
api.professionalperformanceportfolio.com | PPP tRPC API + Auth endpoints | Cloudflare DNS proxied to Azure Container App endpoint | Production |
api-staging.professionalperformanceportfolio.com | PPP tRPC API + Auth endpoints (staging) | Cloudflare DNS proxied to Azure Container App endpoint | Staging |
Architecture Overview
Cloudflare DNS
|
+--------------------+--------------------+
| | |
Root Domain ppp.* / ppp-staging.* api.* / api-staging.*
| | |
Cloudflare Pages Cloudflare Pages CNAME -> Azure Container App endpoint
(static marketing) (React SPA) (Azure UK South)
|
Express server handles:
- /trpc/* (tRPC API)
- /api/auth/* (Better Auth)Site Details
Marketing Site (professionalperformanceportfolio.com)
- Static sales/landing pages hosted on Cloudflare Pages
- Focuses on pitching the PPP product to prospective users
- Contains CTA links directing users to the PPP app login:
- Production:
ppp.professionalperformanceportfolio.com - Staging:
ppp-staging.professionalperformanceportfolio.com
- Production:
PPP Web Application (ppp.*)
- React SPA built with Vite (source:
instances/ppp/) - Deployed to Cloudflare Pages
- Connects to the API via tRPC at the corresponding
api.*subdomain - Authentication handled via Better Auth (sessions, cookies)
PPP API (api.*)
- Azure Container App (Express server) serving both:
- tRPC routes - all application API calls
- Better Auth routes (
/api/auth/*) - authentication flows (login, signup, sessions)
- Stripe payment processing (server-side, no separate webhook endpoint currently)
- External integrations proxied server-side: GMC Registrant Lookup, FHIR Ontoserver, Google Gemini, SendGrid
Infrastructure as Code
All domain and infrastructure configuration is managed via Pulumi across:
- Cloudflare - DNS records, Pages projects, SSL certificates
- Azure - future workloads as needed
The Grafana monitoring stack (api/infra-grafana/) is already managed via Pulumi.
Environment Variables
Key URLs that need updating per environment:
| Variable | Location | Description |
|---|---|---|
VITE_APP_TRPC_URL | instances/ppp/.env | Frontend -> API URL (https://api.professionalperformanceportfolio.com/trpc) |
VITE_BETTER_AUTH_BASE_URL | instances/ppp/.env | Frontend -> Auth URL (https://api.professionalperformanceportfolio.com/api/auth) |
BETTER_AUTH_BASE_URL | api/backend-ppp/.env | Backend auth base URL (must match the app origin for cookie domain) |
SSL / TLS
- Cloudflare provides edge SSL for all
*.professionalperformanceportfolio.comsubdomains - Azure Container Apps have built-in TLS
- Cloudflare -> Azure connection uses Full (Strict) SSL mode
Future Considerations
- Stripe Webhooks: If a Stripe webhook endpoint is added, it will be served from the existing
api.*Container App (no additional subdomain needed) - Mobile App: The Expo mobile app (
mobile/ppp/) will connect to the sameapi.*endpoints - Monitoring: A
grafana.*subdomain may be added if self-hosted Grafana is exposed