BAAS Docs
Reference

Backend Service Interfaces

BAAS Service-mode HTTP, WebSocket, auth, config sync, logs, and remote-display interfaces.

This page is migrated from baas-dev/docs/develop_doc/service_mode.md for developers maintaining Tauri-to-backend communication.

Entry Point

The stable Service-mode entry command is:

python main.service.py --host 0.0.0.0 --port 8190 --log-level info

The ASGI entrypoint is service.app:app. It assembles FastAPI, CORS, lifespan, and route modules. Long-lived dependencies are stored in service.api.state.context.

Module Ownership

ModuleResponsibility
service/api/http.pyremember/logout and health
service/api/ws_control.pycontrol-channel auth, heartbeat, password change, auth revocation
service/api/ws_sync.pyconfig/event/gui/setup snapshots, JSON patch, config list, filesystem pushes
service/api/ws_provider.pylogs, runtime status, static requests, status requests
service/api/ws_trigger.pycommand-response WebSocket
service/api/commands.pydispatch trigger messages into ServiceRuntime
service/api/ws_remote.pyscrcpy remote-display WebSocket proxy
service/api/security.pyorigin policy, encrypted JSON frames, control auth, business-channel resume
service/auth/password state, sessions, remember tokens, signing keys, secretstream transport
service/conf/safe config paths, initialization, resource lookup, snapshots, patching, filesystem watching
service/update/setup.toml, remote SHA checks, CDK validation, update execution
service/remote/scrcpy client, server jar, proxy callbacks, cleanup

Public Interfaces

HTTP:

EndpointPurpose
POST /auth/rememberVerify remember-session proof and set baas_remember
POST /auth/logoutDelete baas_remember
GET /healthReturn service status and public auth state

WebSocket:

EndpointPurpose
/ws/controlclient_hello, server_hello, initialize, authenticate, resume, heartbeat
/ws/syncconfig snapshots, patches, config list, filesystem pushes
/ws/providerinitial logs, runtime status, static/status requests
/ws/triggeraccept commands and return command_response
/ws/remoteremote-display scrcpy proxy with encrypted or plain bytes

/ws/remote_test was a debug endpoint and has been removed.

Business WebSocket Resume Flow

Rendering diagram...

All business channels share this resume pattern. When changing Tauri connection logic, keep control-channel authentication separate from business-channel resume.

Development Checks

After backend interface changes, run at least:

python -m compileall -q service
python -m pytest tests/service

Compatibility checks should cover:

from service.auth import ServiceAuthManager
from service.conf.manager import ConfigManager
from service.runtime import ServiceRuntime
from service.update import check_for_update, read_setup_toml
from service.remote import ScrcpyClient

On this page