Skip to main content

Platform

Platform is the Moveat business backend. It is responsible for durable product state, validation rules and official calculations.

Responsibilities

Platform owns:
  • Authentication session handling.
  • User identity metadata.
  • Profiles.
  • Goals.
  • Nutrition settings.
  • Meal entries.
  • Daily nutrition summaries.
  • Weight logs.
  • Workout sessions.
  • Channel links.
  • Coaching context.
  • Internal APIs consumed by Agent.

Architecture style

Platform is a TypeScript modular monolith built with NestJS and Prisma. The intended structure is pragmatic hexagonal architecture:
LayerResponsibility
HTTP controllersParse request, validate DTOs, authenticate, call services.
Application servicesOwn use cases, transactions and business flow.
Domain helpersOwn calculations, conversion and invariant logic.
InfrastructureDatabase, Redis and external adapters.

Source of truth

Platform is the only service that should persist business data. Agent and Client must not write directly to PostgreSQL.

Database

PostgreSQL stores product data. Prisma owns schema and migrations. Redis can be used for cache/session support, but Redis is not the durable source of truth for product data.

API split

Platform exposes two categories of APIs:
API typeConsumerExample
Public product APIsWeb clientLogin, onboarding, profile, meals, weights, workouts.
Internal service APIsAgentResolve user by channel, get context, log meals.
Internal APIs require a service token and should not be used by frontend clients.