BL Beeing Human · platform engineering

Requirements Gathering Sprint

Tech workflow, architecture & plan of action

A one-sprint analysis to lock the technical foundation for the Beeing Human platform — mobile, web, backend, and admin — before a line of production code is written. This document captures the workflow, target architecture, data model, stack, compliance posture, and the sprint plan itself.

Date · 24 Jul 2026 Surfaces · Flutter mobile + web · Next.js admin · FastAPI backend Sprint length · 1 week (5 working days)
AvatarHybrid (pre-rec → real-time)
MobileFlutter
BackendPython · FastAPI
CloudAWS (HIPAA BAA)
MVPOnboarding + Orientation

01 · Product shape

Five phases, one growing avatar

Beeing Human is an AI-avatar coaching platform. Each user gets two avatars — Avatar 2 (a likeness of themselves) and Avatar 1, a "brain" that grows and accumulates memory as the user moves through a structured journey of 4 stages · 12 modules · 3 lessons each. The MVP proves the first two phases end-to-end.

MVPP0

Onboarding

Sign-up, plan/billing, avatar creation, assessments, growth plan, consents, uploads.

MVPP1

Orientation

Avatar-taught intro modules on stage, in-video Q&A, camera opt-in, chat rooms unlock.

LaterP2

Learning

Module videos, synthesis, avatar memory updates, engagement signals, pocket guide.

LaterP3

Interpreting

Skit sessions, micro-expression reading, peer grading, self-reporting.

LaterP4

Applying

Real-life use-cases, improv rooms, flag clearing, growth-plan-driven practice.

Scope guardrail. Live real-time sessions are explicitly out for MVP (crossed out on the boards). We architect the hybrid avatar layer so real-time can drop in later without a rewrite — but we build only the pre-recorded path now.

02 · Tech workflow

The two MVP flows, step by step

These are the user-facing sequences the MVP must support, annotated with the system responsibilities each step triggers. This is the spine the API contract and screens are built from.

Onboarding

  1. Sign upEmail or social · first/last name · phone. Auth via Cognito, JWT issued.
  2. Plan selection1 month free trial → $29.99/mo. Stripe customer + subscription created.
  3. B2B branchBusinesses / universities → org account + seat (stub in MVP, model now).
  4. ConsentsHIPAA / data-processing / camera consent captured & versioned before any PHI.
  5. Avatar creationCartoon avatar ("second life") → Avatar 2. Avatar 1 record initialized.
  6. AssessmentsSkill assessment (values, strengths, goals/obstacles); questions served by platform.
  7. Growth planValues & strengths + short/long-term goals populated, user reviews & edits.
  8. UploadsResume / PDF / linked accounts + self video/audio → S3 (KMS-encrypted).
  9. Privacy portalSettings to view, update, and delete everything (right to erasure).

Orientation

  1. Start orientationEntry screen; gates Learning until orientation is complete.
  2. Stage introTwo avatars "act out" what the product does — pre-recorded video track.
  3. Interactive modulesProduct overview, the 12-module map, relapse process, guidelines & principles.
  4. In-video Q&AType or talk questions any time; answered by LLM grounded in module content.
  5. Camera opt-inConsented webcam enables on-device emotion/face signals through the phase.
  6. Chat rooms unlockModule-based AI-coach room; live user rooms open as modules complete.
  7. CompletionProgress recorded → Learning phase unlocked. Avatar 1 memory seeded.

03 · Architecture

Target system architecture

A service-oriented backend on AWS, HIPAA-eligible services throughout, with a media/AI edge for avatar delivery and an AvatarProvider abstraction so the pre-recorded and future real-time engines are interchangeable.

flowchart TB
  subgraph Clients
    M["Flutter Mobile<br/>iOS · Android"]
    W["Flutter Web<br/>user app"]
    A["Next.js<br/>Admin Panel"]
  end
  subgraph Edge["AWS Edge"]
    CF["CloudFront CDN"]
    GW["API Gateway / ALB"]
    COG["Cognito<br/>auth + BAA"]
  end
  subgraph Svc["FastAPI services · ECS Fargate (VPC)"]
    ID["Identity and Billing"]
    ON["Onboarding and Assessments"]
    OR["Orientation and Progress"]
    CH["Chat and Rooms"]
    AV["Avatar / Memory"]
  end
  subgraph AI["AI and Media"]
    BR["Bedrock<br/>Claude — chat/synthesis"]
    AVP["AvatarProvider<br/>pre-rec then real-time"]
    HG["HeyGen / D-ID<br/>video gen"]
    SP["Transcribe / Polly"]
  end
  subgraph Data
    PG[("RDS PostgreSQL<br/>+ pgvector")]
    RD[("ElastiCache Redis")]
    S3[("S3 + KMS<br/>media · PHI")]
    Q["SQS · async jobs"]
  end
  ST["Stripe"]

  M --> CF --> GW
  W --> CF
  A --> GW
  M -.auth.-> COG
  GW --> ID & ON & OR & CH & AV
  ID --> ST
  ON --> S3
  CH --> BR
  AV --> BR
  AVP --> HG
  OR --> AVP
  CH --> SP
  ID & ON & OR & CH & AV --> PG
  CH --> RD
  ON --> Q --> S3
  AV --> PG

Emotion / micro-expression detection runs on-device (Flutter + MediaPipe / ML Kit) — only derived signals, never raw video, reach the backend, minimizing PHI transfer.

Why these edges

04 · Data model

Database schema

PostgreSQL is the system of record. The "growing avatar" is modeled as avatar_memory nodes with pgvector embeddings, so knowledge, questions, and confidence signals accrue over time and are queryable semantically. Entities below the fold are modeled now but built in later phases.

erDiagram
  ORGANIZATION ||--o{ USER : "employs / enrolls"
  USER ||--|| PROFILE : has
  USER ||--o{ CONSENT : grants
  USER ||--o| SUBSCRIPTION : holds
  PLAN ||--o{ SUBSCRIPTION : defines
  USER ||--o{ AVATAR : owns
  USER ||--o{ ASSESSMENT : completes
  ASSESSMENT ||--o{ ASSESSMENT_RESPONSE : contains
  USER ||--o{ GROWTH_PLAN : has
  GROWTH_PLAN ||--o{ GROWTH_PLAN_ITEM : contains
  USER ||--o{ UPLOAD : submits
  AVATAR ||--o{ AVATAR_MEMORY : accrues
  PHASE ||--o{ MODULE : groups
  MODULE ||--o{ LESSON : contains
  USER ||--o{ ENROLLMENT : has
  ENROLLMENT ||--o{ MODULE_PROGRESS : tracks
  USER ||--o{ CHAT_MESSAGE : sends
  CHAT_ROOM ||--o{ CHAT_MESSAGE : holds
  USER ||--o{ FLAG : raises
  USER ||--o{ AUDIT_LOG : generates

  USER {
    uuid id PK
    uuid org_id FK
    string cognito_sub
    string email
    string phone
    string status
  }
  AVATAR {
    uuid id PK
    uuid user_id FK
    enum kind "self | growing"
    jsonb appearance
    int growth_level
  }
  AVATAR_MEMORY {
    uuid id PK
    uuid avatar_id FK
    enum kind "knowledge|gap|question|confidence"
    text content
    vector embedding
    uuid source_module_id
  }
  GROWTH_PLAN_ITEM {
    uuid id PK
    uuid plan_id FK
    enum type "value|strength|short_goal|long_goal"
    text content
  }
  MODULE_PROGRESS {
    uuid id PK
    uuid enrollment_id FK
    uuid module_id FK
    enum state
    jsonb engagement_signals
  }

Entity inventory

DomainTablesMVP
Identityorganizations · users · profiles · consentsYes
Billingplans · subscriptions · invoices (Stripe-mirrored)Yes
Avataravatars · avatar_memory (pgvector)Yes
Assessmentassessments · assessment_responses · growth_plans · growth_plan_itemsYes
Contentphases · modules · lessons · enrollments · module_progressOrientation only
Mediauploads · session_recordings · avatar_video_assetsUploads only
Socialchat_rooms · chat_messages · room_membershipsAI-coach room
Signalsengagement_signals · flags · pocket_guidesModeled, later
Complianceaudit_logs · data_erasure_requestsYes

05 · Stack

Technology stack

Chosen for a small team moving fast to MVP, with every third-party under an AWS-signable BAA or kept clear of PHI. Shared type discipline via OpenAPI-generated clients into Flutter and the admin panel.

LayerChoiceNotes
MobileFlutter (Dart)Single codebase iOS + Android; strong video/animation for avatar stage.
Web appFlutter WebReuse mobile codebase for the logged-in user app. (Next.js is the fallback if SEO/marketing site is needed.)
Admin panelNext.js + React (Refine)Richer admin ecosystem — content/module management, user support, audit review.
BackendFastAPI (Python 3.12)Async, Pydantic v2, auto OpenAPI; best fit for the AI/ML pipeline.
ComputeECS FargateServerless containers, no cluster ops; scale per service.
DatabaseRDS PostgreSQL 16 + pgvectorRelational core + avatar-memory embeddings in one store.
Cache / QueueElastiCache Redis · SQSSessions, rate limits, chat presence; async media jobs.
Storage / CDNS3 + KMS · CloudFrontEncrypted PHI/media; signed URLs; CDN for avatar video.
AuthAmazon CognitoEmail + social; HIPAA-eligible; JWT to services.
LLMBedrock — ClaudeIn-video Q&A, synthesis, memory updates; inside the account boundary.
Avatar videoHeyGen / D-IDBehind AvatarProvider; keep PHI out of prompts (verify BAA before any).
EmotionMediaPipe / ML Kit (on-device)Derived signals only leave the device.
SpeechTranscribe · PollyVoice Q&A in / avatar TTS out.
PaymentsStripeTrials, subscriptions, B2B seat billing.
IaC / CITerraform · GitHub ActionsReproducible envs; per-service pipelines.
ObservabilityCloudWatch · SentryMetrics/logs/traces + app error tracking.

06 · Compliance & risk

Flags to resolve before build

The boards mention "EHR certified", "HIPAA", "relapse process", universities, and webcam emotion reading. Each carries regulatory weight that must be pinned down in this sprint — they change hosting, vendor, and consent decisions.

Critical

"Relapse process" → substance-use records (42 CFR Part 2)

If Beeing Human handles addiction/recovery data, US 42 CFR Part 2 applies — stricter than HIPAA, with tight redisclosure limits. Must confirm the clinical scope before designing data flows and consents.

Critical

Vendor BAAs for any PHI path

No PHI may reach Stripe metadata, HeyGen/D-ID prompts, or any subprocessor without a signed BAA. Confirm AWS BAA scope and treat avatar-gen/analytics vendors as PHI-free by design.

High

Universities → FERPA (& possibly minors)

The B2B "universities" path can bring FERPA education-record obligations and, if any users are under 18, COPPA. Needs multi-tenant data isolation and per-org data agreements.

High

Biometric emotion reading → BIPA & consent

Webcam micro-expression/face analysis is biometric processing. Illinois BIPA and similar laws require explicit, specific consent. On-device processing + granular opt-in mitigates, but consent copy and retention policy must be reviewed.

High

What does "EHR certified" actually mean?

"EHR certified for potential audits" is ambiguous — clinical EHR certification (ONC) is a very different bar from "audit-ready wellness data." This single answer reshapes the compliance program.

07 · Plan of action

The requirements sprint — this week

Five days to turn the boards into a build-ready foundation. Each day has a clear output; the week ends with a prioritized, estimated backlog and a green-lit architecture.

Day 1 · Mon

Discovery workshop

Confirm personas, B2C-vs-B2B priority, phase scope, and success metrics for the thin slice. Walk every board with stakeholders.

Output: signed-off PRD skeleton + scope boundary.

Day 2 · Tue

Compliance deep-dive

Resolve the six risk flags with legal/clinical input. Define PHI inventory, consent matrix, retention & erasure rules, required BAAs.

Output: compliance checklist + data-classification map.

Day 3 · Wed

AI & avatar spike

POC: Bedrock/Claude Q&A grounding, HeyGen/D-ID pre-recorded pipeline + BAA check, on-device MediaPipe emotion feasibility.

Output: vendor decision + AvatarProvider interface spec.

Day 4 · Thu

Model & contract

Finalize the ERD, draft the OpenAPI contract for Onboarding + Orientation, and define non-functional requirements (latency, scale, uptime).

Output: ERD + OpenAPI v0 + NFR doc.

Day 5 · Fri

Architecture review & backlog

Threat-model the design, validate the diagram, break epics into stories, estimate, and sequence Sprint 0 (repos, IaC, CI/CD, skeletons).

Output: approved architecture + estimated backlog.

Sprint deliverables

PRDScope, personas, MVP boundary
Architecture diagramReviewed & threat-modeled
ERD + migrations planPostgreSQL + pgvector
OpenAPI contract v0Onboarding + Orientation
Compliance checklistHIPAA / Part 2 / FERPA / BIPA
NFR documentLatency, scale, uptime, cost
Vendor decisionsAvatar, LLM, BAAs
Estimated backlogEpics → stories → points

Then — Sprint 0 (setup, week 2)