Skip to content

Domain Structure ​

Root Domain ​

professionalperformanceportfolio.com - registered and managed via Cloudflare.

Subdomains ​

SubdomainPurposeHostingEnvironment
professionalperformanceportfolio.comMarketing / sales siteCloudflare PagesProduction
staging.professionalperformanceportfolio.comMarketing / sales site (staging)Cloudflare PagesStaging
ppp.professionalperformanceportfolio.comPPP web applicationCloudflare Pages (proxied to S3/CloudFront or direct)Production
ppp-staging.professionalperformanceportfolio.comPPP web application (staging)Cloudflare PagesStaging
api.professionalperformanceportfolio.comPPP tRPC API + Auth endpointsCloudflare DNS proxied to Azure Container App endpointProduction
api-staging.professionalperformanceportfolio.comPPP tRPC API + Auth endpoints (staging)Cloudflare DNS proxied to Azure Container App endpointStaging

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

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:

VariableLocationDescription
VITE_APP_TRPC_URLinstances/ppp/.envFrontend -> API URL (https://api.professionalperformanceportfolio.com/trpc)
VITE_BETTER_AUTH_BASE_URLinstances/ppp/.envFrontend -> Auth URL (https://api.professionalperformanceportfolio.com/api/auth)
BETTER_AUTH_BASE_URLapi/backend-ppp/.envBackend auth base URL (must match the app origin for cookie domain)

SSL / TLS ​

  • Cloudflare provides edge SSL for all *.professionalperformanceportfolio.com subdomains
  • 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 same api.* endpoints
  • Monitoring: A grafana.* subdomain may be added if self-hosted Grafana is exposed

Internal documentation — org members only