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 logsService 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 serviceCommunication Pattern
Frontend (React) ──tRPC──► API Server (Node) ──HTTP──► Service (Python/etc)
│
└──► PostgreSQLServices 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
- Create directory under
services/{service-name}/ - Include a
Makefilewith standard targets:install,dev,test,lint,format,docker-build,docker-up - Add convenience scripts to root
package.json - Document the service in
docs/services/ - Create tRPC router procedures in
packages/api/to call the service
Last updated on