AnyaSelf Docs

Frontend Integration Contract

Backend API contract and design decisions governing client-server communication.

[!NOTE] This document is the canonical frontend-backend contract for AnyaSelf v1. For detailed endpoint schemas, see the individual service documentation.

Design Decisions

#DecisionDetail
1Voice: Model BClient uses Gemini Live for STT/TTS only. Text turns go through Orchestrator /chat.
2Auth: Gateway tokenJWT validated at API Gateway boundary. Production target: OIDC/JWKS.
3Boutique "stands"Information architecture (grouped surfaces), not 3D.
4Mobile-firstResponsive web-first. Native wrapper optional.
5Offline toleranceWardrobe browsing only. Missions, approvals, checkout online-only.
6Performance budgetMid-tier Android: lean payloads, image memory, JS execution.
7Client eventsDomain APIs first, no separate critical-path event bus.

Voice Loop (B-Model)

  1. Client captures speech → Gemini Live transcribes to text
  2. Client sends text to POST /orchestrator/missions/{mId}/chat
  3. Client speaks assistant response via TTS
  4. User interrupt (barge-in) stops TTS and sends new turn

Rules:

  • Voice never calls internal tools directly
  • Orchestrator mission state is source of truth
  • Client keeps local transcript for UX; server aggregation is a separate artifact concern

Client Event Mapping

EventAuthoritative ActionMission Signal
USER_LIKED_ITEMPOST /missions/{mId}/events
USER_DISLIKED_ITEMPOST /missions/{mId}/events
USER_TAKEOVER_STARTPOST /sessions/{sId}/takeoverOptional event fallback
USER_TAKEOVER_ENDPOST /sessions/{sId}/releaseOptional event fallback
USER_APPROVED_REQUESTPOST /requests/{rId}/approveThen emit event
USER_CONFIRMED_FINAL_CHECKOUTPOST /requests/{rId}/confirm-checkoutThen emit event

Error Envelope

All services return errors in a consistent shape:

{
  "error": "ERROR_CODE",
  "message": "Human-readable message"
}

Validation errors include additional details:

{
  "error": "VALIDATION_ERROR",
  "message": "Request validation failed.",
  "details": []
}

On this page