How coppsary/motify-backend works
Motify Backend is an optional hosted API for Motify’s source-based editor. The main request path is the editor calling the Express server, which routes authenticated requests through controllers into services and persistence; project saves preserve authored source rather than introducing another animation format. Distinct capabilities include account and workspace management, projects, assets and audio, brand data, AI-assisted generation, and credits and payments. The README describes rendering as an intended separate worker capability, but no renderer appears in the supplied tree. Some subsystem links rely on the source index or README rather than sampled implementation details.
Main entry points: server.ts API server · payment.service.ts Payment service · schema.ts PostgreSQL schema · auth.repository.ts Auth persistence
Components 20
HTTP API
- API server
src/server.ts - Auth routes
src/routes/auth.routes.ts - Auth controller
src/controllers/auth.controller.ts - Session middleware
src/middleware/authentication.ts
Identity and Workspaces
- Auth service
src/services/auth.service.ts - Auth persistence
src/repositories/auth.repository.ts - Supabase Auth
packages/auth/supabase-provider.ts - Workspace service
src/services/workspace.service.ts
Creative Workflows
- Project controller
src/controllers/project.controller.ts - Project service
src/services/project.service.ts - AI generation agent
packages/ai/agent/motify-agent.ts - Generation records
src/repositories/motion-graph.repository.ts
Assets and Audio
- Asset controller
src/controllers/asset.controller.ts - Asset service
src/services/asset.service.ts - Object storage
packages/object-storage/supabase-storage.ts - Audio catalog
src/services/audio.service.ts
Billing and Persistence
- Payment service
src/services/payment.service.ts - Bakong API client
packages/bakong/client.ts - PostgreSQL schema
packages/database/schema.ts
Other components
- Motify editor
Connections 19
- Motify editor → API server: calls API
README.md - API server → Auth routes: mounts routes
src/server.ts - Auth routes → Auth controller: dispatches
src/routes/auth.routes.ts - API server → Session middleware: resolves sessions
src/server.ts - Auth controller → Auth service: invokes
src/controllers/auth.controller.ts - Auth persistence → PostgreSQL schema: reads and writes
src/repositories/auth.repository.ts - Auth persistence → Supabase Auth: uses provider types
src/repositories/auth.repository.ts - API server → Project controller: configures
src/server.ts - Project controller → Project service: invokes
src/controllers/project.controller.ts - API server → AI generation agent: configures agent
src/server.ts - Generation records → AI generation agent: uses generation schemas
src/repositories/motion-graph.repository.ts - API server → Asset controller: mounts asset routes
src/server.ts - Asset controller → Asset service: invokes
src/controllers/asset.controller.ts - Asset service → Object storage: uses storage adapter
src/services/asset.service.ts - Audio catalog → PostgreSQL schema: persists catalog
- API server → Payment service: configures service
src/server.ts - Payment service → Bakong API client: checks payments
src/services/payment.service.ts - Payment service → Workspace service: uses workspace service
src/services/payment.service.ts - API server → PostgreSQL schema: creates database
src/server.ts