🏢

Infrastructure & Information Flow

Audissey Infrastructure & Information Flow

Overview

This document provides a comprehensive view of the Audissey platform infrastructure, covering:

Architecture Diagram

graph TB subgraph DEV_WORKFLOW["Developer Workflow"] DEV["Developer"] REPO_APP["audissey_app repo
(Flutter)"] REPO_API["Audissey repo
(API · Worker · ML)"] end subgraph AZURE_DEVOPS["Azure DevOps Pipelines"] direction TB subgraph MOBILE_CI["Mobile CI/CD"] FLUTTER_CI["Flutter CI
(analyze · test)"] REL_TAG["Release Tag
(dev → tag)"] ANDROID_CD_DEV["Android CD dev"] ANDROID_CD_STG["Android CD staging"] ANDROID_CD_PROD["Android CD prod"] IOS_CD_DEV["iOS CD dev"] IOS_CD_STG["iOS CD staging"] IOS_CD_PROD["iOS CD prod"] end subgraph API_CI["API CI/CD"] API_BUILD["API Build"] API_RELEASE["API Release
(dev → staging → prod)"] WORKER_BUILD["Worker Build"] WORKER_RELEASE["Worker Release"] ML_BUILD["ML Build"] ML_RELEASE["ML Release"] end end subgraph DISTRIBUTION["App Distribution"] FIREBASE_DEV["Firebase App Distribution
(dev testers)"] FIREBASE_STG["Firebase App Distribution
(staging testers)"] STORE["App Store / Play Store
(prod)"] end subgraph MOBILE_APPS["Mobile App (Flutter)"] APP_DEV["audissey.dev
(.env.dev)"] APP_STG["audissey.staging
(.env.staging)"] APP_PROD["audissey (prod)
(.env.prod)"] end subgraph AZURE_INFRA["Azure Infrastructure (West Europe)"] subgraph ENV_DEV["Dev Environment · audissey-dev-rg"] API_DEV_SVC["App Service
audissey-api-dev"] KV_DEV["Key Vault
audissey-kv-dev
(Private Endpoint)"] ADMIN_DEV["App Service
audissey-admin-dev"] end subgraph ENV_STG["Staging Environment · audissey-staging-rg"] API_STG_SVC["App Service
audissey-api-staging"] KV_STG["Key Vault
audissey-kv-staging
(Private Endpoint)"] ADMIN_STG["App Service
audissey-admin-staging"] end subgraph ENV_PROD["Prod Environment · audissey-prod-rg"] API_PROD_SVC["App Service
audissey-api-production"] KV_PROD["Key Vault
audissey-kv-production
(Private Endpoint)"] ADMIN_PROD["App Service
audissey-admin"] end subgraph CONTAINER_APPS["Container Apps · audissey-cae-northeu (North Europe)"] WORKER_DEV["Container App
audissey-worker-dev"] WORKER_STG["Container App
audissey-worker-staging"] WORKER_PROD["Container App
audissey-worker"] end VNET["VNets + Private DNS Zones"] end subgraph DATA_STORES["Data Stores"] MONGODB["MongoDB
(MONGODB_URI)"] REDIS["Redis
(BullMQ queues)"] end subgraph EXTERNAL["External Services"] FB["Facebook Login API
(3 App IDs: dev·stg·prod)"] GOOGLE["Google OAuth
(ID token verification)"] PODCAST["Podcast Index API"] SENDER["Sender
(transactional email)"] end DEV -->|"git push dev"| REPO_APP DEV -->|"git push"| REPO_API REPO_APP -->|"push dev"| FLUTTER_CI REPO_APP -->|"push dev/main"| REL_TAG REL_TAG -->|"tag: audissey_app-dev-v*"| ANDROID_CD_DEV REL_TAG -->|"tag: audissey_app-dev-v*"| IOS_CD_DEV REL_TAG -->|"tag: audissey_app-staging-v*"| ANDROID_CD_STG REL_TAG -->|"tag: audissey_app-staging-v*"| IOS_CD_STG REL_TAG -->|"tag: audissey_app-prod-v*"| ANDROID_CD_PROD REL_TAG -->|"tag: audissey_app-prod-v*"| IOS_CD_PROD ANDROID_CD_DEV -->|"APK"| FIREBASE_DEV IOS_CD_DEV -->|"IPA"| FIREBASE_DEV ANDROID_CD_STG -->|"APK"| FIREBASE_STG IOS_CD_STG -->|"IPA"| FIREBASE_STG ANDROID_CD_PROD --> STORE IOS_CD_PROD --> STORE FIREBASE_DEV --> APP_DEV FIREBASE_STG --> APP_STG STORE --> APP_PROD REPO_API --> API_BUILD --> API_RELEASE REPO_API --> WORKER_BUILD --> WORKER_RELEASE REPO_API --> ML_BUILD --> ML_RELEASE API_RELEASE -->|"deploy"| API_DEV_SVC API_RELEASE -->|"deploy"| API_STG_SVC API_RELEASE -->|"deploy"| API_PROD_SVC WORKER_RELEASE -->|"deploy"| WORKER_DEV WORKER_RELEASE -->|"deploy"| WORKER_STG WORKER_RELEASE -->|"deploy"| WORKER_PROD APP_DEV -->|"REST /api/*"| API_DEV_SVC APP_STG -->|"REST /api/*"| API_STG_SVC APP_PROD -->|"REST /api/*"| API_PROD_SVC API_DEV_SVC -->|"Managed Identity"| KV_DEV API_STG_SVC -->|"Managed Identity"| KV_STG API_PROD_SVC -->|"Managed Identity"| KV_PROD KV_DEV -.->|"facebook-app-secret
facebook-app-id
google-oauth-client-ids
jwt-secret"| API_DEV_SVC KV_STG -.-> API_STG_SVC KV_PROD -.-> API_PROD_SVC VNET --- KV_DEV VNET --- KV_STG VNET --- KV_PROD API_DEV_SVC --> MONGODB API_STG_SVC --> MONGODB API_PROD_SVC --> MONGODB API_DEV_SVC --> REDIS API_STG_SVC --> REDIS API_PROD_SVC --> REDIS REDIS -->|"job queue"| WORKER_DEV REDIS -->|"job queue"| WORKER_STG REDIS -->|"job queue"| WORKER_PROD API_DEV_SVC -->|"validate token"| FB API_DEV_SVC -->|"verifyIdToken"| GOOGLE API_PROD_SVC --> FB API_PROD_SVC --> GOOGLE API_PROD_SVC --> PODCAST API_PROD_SVC --> SENDER classDef azure fill:#0078d4,color:#fff,stroke:#005a9e classDef kv fill:#50e6ff,color:#000,stroke:#0078d4 classDef firebase fill:#ffca28,color:#000,stroke:#f57c00 classDef external fill:#e8eaf6,color:#000,stroke:#5c6bc0 classDef mobile fill:#66bb6a,color:#fff,stroke:#388e3c classDef pipeline fill:#ff7043,color:#fff,stroke:#d84315 class API_DEV_SVC,API_STG_SVC,API_PROD_SVC,WORKER_DEV,WORKER_STG,WORKER_PROD,ADMIN_DEV,ADMIN_STG,ADMIN_PROD azure class KV_DEV,KV_STG,KV_PROD kv class FIREBASE_DEV,FIREBASE_STG firebase class FB,GOOGLE,PODCAST,SENDER external class APP_DEV,APP_STG,APP_PROD mobile class FLUTTER_CI,REL_TAG,ANDROID_CD_DEV,ANDROID_CD_STG,ANDROID_CD_PROD,IOS_CD_DEV,IOS_CD_STG,IOS_CD_PROD,API_BUILD,API_RELEASE,WORKER_BUILD,WORKER_RELEASE,ML_BUILD,ML_RELEASE pipeline

Infrastructure Components

1. Developer Workflow & Source Control

Repositories:

Development Flow:

2. CI/CD Pipelines (Azure DevOps)

Mobile Pipelines

Flutter CI (azure-pipelines-flutter-ci.yml)

Release Tag (azure-pipelines-release-tag.yml)

Android/iOS CD Pipelines (dev, staging, prod)

Backend Pipelines

API Build & Release (azure-pipelines-api-build.yml, azure-pipelines-api-release.yml)

Worker Build & Release (azure-pipelines-worker-build.yml, azure-pipelines-worker-release.yml)

ML Service Build & Release (azure-pipelines-ml-build.yml, azure-pipelines-ml-release.yml)

3. Mobile Application (Flutter)

Flavors & Environments:

Configuration:

Distribution:

Social Authentication:

4. Azure Infrastructure

Region: West Europe

Environments:

App Service Plans

Plan SKU Sites RG
audissey-plan-dev-ws B1 3 (api-dev, admin-dev, ml-dev) audissey-rg
audissey-plan-staging P0v3 2 (api-staging, admin-staging) audissey-staging-rg
audissey-plan-staging-ws B1 1 (ml-staging) audissey-rg
audissey-plan-prod-ws B1 3 (api, admin, ml-prod) audissey-rg

Per-Environment Resources

App Service (API)

Worker Service

Admin Dashboard

ML Service (Python)

Key Vault

Networking

5. Data Stores

MongoDB (Cosmos DB MongoDB API)

Redis

6. External Service Integrations

Facebook Login API

Google OAuth

Podcast Index API

Sender

Security Architecture

Secret Management

Principles:

Key Vault Access:

App Service Hardening:

Pipeline Security:

Authentication Flow

Mobile App → Backend:

  1. User authenticates with social provider (Facebook/Google)
  2. Client receives provider token/ID token
  3. Client sends token to backend /auth/social/{provider}
  4. Backend validates token with provider API
  5. Backend creates or updates user in MongoDB
  6. Backend generates app-specific JWT
  7. Client stores JWT for subsequent API requests

Backend → External Services:

Deployment Flow

Mobile Deployment

  1. Developer pushes to dev or main
  2. Flutter CI validates code (if path matches)
  3. Release Tag pipeline creates git tags (per environment)
  4. CD pipelines triggered by tags:
    • Build signed artifacts
    • Run tests
    • Distribute to Firebase or Stores
  5. Testers receive notification (Firebase) or users update via stores

Backend Deployment

API & ML Service (App Service):

  1. Developer pushes code
  2. Build pipeline creates Docker image, pushes to ACR
  3. Release pipeline deploys progressively:
    • Deploy to Dev → smoke test
    • Deploy to Staging → smoke test
    • Manual approval gate
    • Deploy to Production → smoke test
  4. App Service pulls new container image from ACR (Managed Identity)
  5. Key Vault secrets loaded on startup
  6. Health checks validate deployment

Worker (Container Apps):

  1. Developer pushes code
  2. Build pipeline creates Docker image, pushes to ACR with deterministic tag
  3. Release pipeline deploys via az containerapp update:
    • Preflight: validate managed identity + required env vars
    • Deploy to Dev (on dev push) / Staging (on main push) / Prod (manual approval)
    • Ensure KEDA scaler: run scripts/ensure-worker-keda.sh to enforce scale-to-zero + Redis-based autoscaling (idempotent)
    • Health polling with 20 retries after each deployment
  4. Container App pulls image from ACR via SystemAssigned Managed Identity
  5. KEDA monitors BullMQ wait queues in Redis; scales 0→N replicas on demand

Worker health endpoints (Container Apps):

Troubleshooting

Key Vault Access Issues

Symptom: API fails to load secrets from Key Vault
Causes:

Resolution:

Social Login Failures

Facebook "Invalid key hash":

Google "Login canceled":

Backend token validation errors:

Pipeline Failures

Flutter CI not triggering:

CD not triggering:

Build failures: