WR

Case study

AvatarKit AI

Consent-first business avatar platform

Next.jsTypeScriptPrismaPostgreSQLRedisFastAPITurborepoDocker

Key outcomes

Phase 4 complete: auth, workspaces, avatar drafts, source photos, consent, and identity-safety acceptance
Workspace-scoped Avatar Studio with protected routes, role-aware access, and setup checklist state
Clean monorepo boundary for web, API, widget, Python AI/runtime services, and future provider integrations

The Problem

Most AI avatar products start as photo-to-video demos. That is useful for experimentation, but it is not enough for a business system where a team needs to create avatars, prove consent, control who can edit them, attach approved business knowledge, and eventually publish them into customer-facing workflows.

The risk profile is different from a generic media generator. A business avatar represents a person or brand. The platform has to treat identity, consent, workspace ownership, and future provider boundaries as core product infrastructure, not as policy text added after launch.

AvatarKit AI needed a phase-driven foundation that could grow into talking avatars for websites, kiosks, onboarding, sales, support, education, and service workflows without shipping unsafe public runtime features too early.

What Was Built

AvatarKit AI is a Turborepo monorepo for business avatar infrastructure:

  • apps/web - Next.js dashboard and product UI
  • apps/api - TypeScript API service foundation
  • apps/widget - placeholder for the future embeddable runtime
  • packages/config, packages/types, packages/ui - shared configuration, contracts, and UI
  • services/ai-runtime, services/ingestion, services/media-worker - Python service foundations for future AI, ingestion, and media workloads
  • prisma - database schema for the product state model

The current implementation is complete through Phase 4: local auth, session cookies, workspaces, role-aware access control, onboarding, Avatar Studio drafts, source-photo upload and validation, private preview routes, consent records, identity-safety acceptance, and setup checklist state.

Consent-First Avatar Creation

The core product loop is intentionally gated:

Create avatar -> verify consent -> upload source photo -> configure behavior -> add knowledge -> test -> publish

Only the early phases are implemented today. That is a deliberate engineering decision. Public widget access, voice cloning, AI runtime calls, knowledge ingestion, avatar video generation, lead capture, billing, and realtime streaming are locked behind later milestones.

This keeps the system honest. A publishable business avatar should not exist until the platform can prove workspace ownership, source-photo validity, and consent state.

Workspace and Identity Boundaries

Every major business entity is workspace-scoped. Users create or switch active workspaces, and dashboard routes enforce workspace-aware protection. Avatar records, setup state, source photos, and consent records are not global objects that can be accidentally leaked between teams.

Source photos are validated server-side for JPG, PNG, and WEBP constraints, stored in private local storage during development, and exposed only through protected dashboard preview routes. Consent records are tied to the current valid source photo, so replacing the source image changes the consent state that matters.

Provider-Ready Architecture

The architecture separates product state from future avatar engines. TypeScript owns the dashboard, API, widget, SDK, permission boundaries, and shared contracts. Python owns the future AI orchestration, retrieval, ingestion, media, and GPU-oriented workloads.

That separation matters because commercial avatar providers, self-hosted engines, LLMs, TTS, STT, and media workers should sit behind internal service boundaries. The product should not be coupled to one provider's API shape or safety model.

Key Engineering Decisions

Phase guardrails over premature features. The repository explicitly documents what is implemented and what is not. Voice libraries, knowledge ingestion, public widgets, AI runtime calls, publishing, and billing are planned later rather than half-built into the current phase.

Workspace-scoped data model. Avatar infrastructure is multi-tenant from the start. Auth, roles, active workspace switching, route protection, and avatar CRUD all follow the same ownership boundary.

Consent as product state. Consent is not just copy on a form. It is recorded against the current valid source photo and reflected in setup checklist state, which makes it enforceable by later publish and runtime flows.

Scope

  • Next.js dashboard with local email/password auth, session cookies, onboarding, and workspace switching.
  • Avatar Studio supports draft creation, basics, behavior configuration, source-photo upload, and workspace-scoped avatar lists.
  • Server-side JPG, PNG, and WEBP validation with private local storage and dashboard-only preview routes.
  • Consent records are tied to the current valid source photo, with identity-safety acceptance for authorized workspace roles.
  • Phase guardrails keep future voice, knowledge, preview, publish, widget, and AI runtime work behind explicit product milestones.
Need something like this?

Waqas Raza

AI-Native Full-Stack Engineer. Top Rated on Upwork · $180K+ earned · 93% job success. I build production AI agents, LLM systems, Web3 platforms, and full-stack applications.

Hire me on Upwork