Build and connect backend services
Choose a Docker Hub image, a Dockerfile, or native Node.js/Python source, then connect the service to your frontend.
Step-by-step guidance.
Before you start
- A factory with permission to create and configure services.
- For source builds, the intended repository source or reviewed factory source snapshot.
What a backend does
A managed backend runs your application API, account checks, database access and business logic. Use it for ordinary create/read/update/delete features, direct file-storage operations, existing container applications, or background workers. Workflows remain useful for AI, scheduled automation, ETL and durable jobs; each API endpoint does not need its own workflow.
New APIs normally start from the verified Node API starter with its repository-owned Dockerfile. Existing stacks and explicit native-runtime choices remain valid. The service is registered and managed separately from the frontend; an existing combined server-rendered app can intentionally serve both pages and API from one process.
Choose a service source
Open System Explorer → Services → New service. The Source control offers three ways to supply the program that Rumata will run.
| Source | Choose it when | What you supply |
|---|---|---|
| Docker image | An existing container already provides the API, tool, or worker you need. | A container image reference and the settings required by that image. |
| Native runtime | Your backend is a Node.js or Python application and you want to configure its build and start commands directly. | Repository paths, runtime/version, build command, and start command. |
| Dockerfile | You need to control the container build, such as installing system packages or using a custom base image. | A Dockerfile and its build context in the selected release source. |
Source and service type are separate choices. A Web service accepts HTTP requests; a Background worker runs work without a web endpoint. Choose the runtime policy, resources, and storage for the workload, whichever source you use.
Choose a Docker Hub image
- Select Docker image, then Choose an image.
- Search public Docker Hub images by name or namespace. The picker also offers quick setups such as Gotenberg, NGINX, and HTTPBin.
- Select the intended image and version tag. Review the publisher’s documentation for its HTTP port, environment variables, startup requirements, and writable directories.
- Check Container image and the service settings after selection. You can also enter an image reference directly. Use the optional private-registry configuration when the image requires registry authentication.
- Choose the service name, service type, runtime policy, and endpoint access. Save settings, then deploy when ready.
An image reference identifies a repository and optionally a tag, for example `namespace/image:version`. A tag is a named version that its publisher can update; a digest identifies particular image content. Prefer an explicit reviewed version over relying on a changing `latest` tag.
Build native Node.js or Python source
- Select Native runtime. Review Backend folder, Build context, and the optional Git branch or ref. Paths are relative to the repository root.
- Choose Node.js or Python under Native runtime, then enter an exact supported Runtime version, including its patch number.
- Set the Build command for dependency installation and any compilation your application needs. Leave it empty only when no build is needed.
- Set the Start command to launch the application. For a web service, listen on `0.0.0.0` and the supplied `PORT`.
- Review environment variables, service type, HTTP port, resources, and endpoint access. For a standalone repository build, commit and push the intended source; for a coordinated factory release, review its selected source snapshot.
- Save settings, build the intended source, then deploy its successful artifact. Read the logs and test the running service.
For Node.js, the form offers `npm ci && npm run build --if-present` and `npm start`. These commands require a compatible package file, lockfile, and start script. For Python, use installation and startup commands appropriate to your project and its dependency files; switching runtimes does not convert your application.
Build from a Dockerfile
- Select Dockerfile.
- Review Backend folder, Build context, Git branch or ref, and Dockerfile path. Use paths relative to the repository root.
- Make sure files copied by the Dockerfile are inside its build context and are not excluded by the applicable `.dockerignore`.
- Keep dependency installation and compilation in build instructions, and configure the container’s startup command for the running application.
- Include the Dockerfile and all required files in the selected release source. Commit and push them for a standalone repository build, or review the coordinated factory source snapshot. Save settings, deploy, and inspect the build logs.
A Dockerfile is a recipe for building an image. A Docker image source instead runs an already-built image. Native runtime builds expose language and command settings directly; Dockerfile builds put the container setup under your control.
Connect the frontend with rumata.backends.json
The frontend’s `rumata.backends.json` records backend bindings. It sits in the frontend directory, for example `factories/<factory-id>/frontend/rumata.backends.json`. It connects a frontend configuration name with a service ID and the intended production and development endpoints and access modes.
- Open Code and find `rumata.backends.json` in the frontend that should use the service.
- Check that the binding points to the intended service. Keep development and production endpoints separate; do not replace the production endpoint with a private preview URL.
- Make sure the frontend’s API client uses the corresponding configuration name and the authentication required by the selected endpoint access mode.
- Include the binding with the frontend changes in the reviewed release source. Review the frontend deployment’s backend information and deploy the connected frontend and service together when Rumata requires a coordinated deployment.
- Test the API call in private preview and on the intended deployed environment, including an unauthorized request when the API should be private.
In managed Vite preview, the binding uses a same-origin backend path with preview authorization forwarded by the runtime. It can be relative and has no trailing slash; join it with an endpoint path instead of passing it directly to new URL. A missing development backend does not silently switch to production. Prebuilt images intentionally use their deployed service because they have no working-tree development process.
Develop without publishing
- Configure the service’s development command, a free non-reserved port, database binding and required secrets.
- Install dependencies and start or ensure the development process. Wait for readiness, then test an application request.
- Connect the frontend binding and complete the task through the UI. Read service logs and browser runtime errors.
Development reads working-tree files on the development machine. Production is a separate deployment. Enabling database binding normally connects both to the project database and factory schema; do not assume preview has a disposable copy of production data.
Application accounts and endpoint access
The Node API starter includes an opt-in native email/password account module backed by PostgreSQL. Enable it with the database and factory signing-key bindings when the app needs accounts. Reuse an existing sign-in system where appropriate; passwordless login, social sign-in and app-specific roles require their own implementation. See Account contracts.
Rumata resource permissions and application-user authorization are separate checks. Private development requires an authorized Rumata session. Deployed services using Rumata permissions can allow public execution; the backend must still verify app sessions and record ownership for private data. Never copy the developer’s Rumata token or a service API key into browser code.
Runtime policy and persistent data
| Policy or resource | Behavior |
|---|---|
| Sleep when idle | An on-demand HTTP service can suspend and wake on a permitted request; startup can delay the first response. |
| Always on | Use when continuous execution is required, including a worker that must remain active without HTTP requests. |
| Stop after duration | The deployment expires at its configured runtime limit, even while busy. |
| Persistent disk | Separate deployed-service storage for software that needs a filesystem. It requires one replica, consumes storage while stopped, is not mounted in development and does not provide automatic backups. |
Use PostgreSQL for relational records and managed project storage for user files. The container’s ordinary filesystem is not durable across replacement. HTTP-disabled workers cannot wake through an HTTP request; choose their runtime policy deliberately.