Skip to Content
ServicesOverview

Services

M3 Forge includes several backend services that run alongside the main API server.

Available Services

Webapp Runner

Container lifecycle management service for user-deployed webapps. Supports Gradio, Streamlit, FastAPI, static sites, and custom Docker apps.

Location: services/webapp-runner/

Tech Stack: Python 3.11, FastAPI, Docker SDK, Jinja2

Commands:

pnpm runner:dev # Development server pnpm runner:up # Docker deployment pnpm runner:logs # View logs

Service Architecture

Services in M3 Forge are polyglot - they can be written in any language and communicate with the main TypeScript backend via HTTP APIs. They are located in the services/ directory at the monorepo root, separate from the pnpm workspace.

marie-studio/ ├── packages/ # TypeScript packages (pnpm workspace) │ ├── api/ # Main tRPC API server │ ├── frontend/ui/ # React frontend │ └── ... └── services/ # Non-Node services └── webapp-runner/ # Python service

Communication Pattern

Frontend (React) ──tRPC──► API Server (Node) ──HTTP──► Service (Python/etc) └──► PostgreSQL

Services are called by the main API server’s tRPC routers, never directly from the frontend. This allows:

  • Consistent authentication and authorization
  • Database access managed by the API server
  • Type-safe API contracts between frontend and backend
  • Language flexibility for specialized services

Adding New Services

  1. Create directory under services/{service-name}/
  2. Include a Makefile with standard targets: install, dev, test, lint, format, docker-build, docker-up
  3. Add convenience scripts to root package.json
  4. Document the service in docs/services/
  5. Create tRPC router procedures in packages/api/ to call the service
Last updated on