Backend as a Service
sh0 provides a complete BaaS stack on your own server -- database, API, auth, realtime, and functions -- without vendor lock-in.
What is BaaS?
Backend as a Service (BaaS) gives frontend and mobile developers a ready-made backend: a database with an auto-generated API, authentication, real-time messaging, and serverless functions. Instead of building and maintaining a custom backend, you configure services and connect them to your client app.
Popular hosted BaaS platforms include Supabase, Firebase, and Appwrite. sh0 brings the same capabilities to your own infrastructure -- self-hosted, open-source components, flat pricing, and full control.
The sh0 BaaS Stack
sh0's BaaS is composed of four managed services, each backed by a proven open-source project:
| Service | Engine | Purpose |
|---|---|---|
| PostgREST API | PostgREST | Auto-generated REST API from PostgreSQL schema |
| Authentication | Logto | OIDC-compliant auth with social login and admin console |
| Realtime | Centrifugo | WebSocket channels, presence, and pub/sub messaging |
| Functions | Deno | Serverless TypeScript/JavaScript functions |
All four services are managed by sh0 -- provisioned with one click, auto-configured with SSL, and connected to your PostgreSQL database servers.
Comparison with Supabase & Appwrite
| Feature | sh0 | Supabase | Appwrite |
|---|---|---|---|
| Hosting | Self-hosted (your server) | Hosted or self-hosted | Hosted or self-hosted |
| REST API | PostgREST | PostgREST | Custom REST API |
| Auth | Logto (OIDC) | GoTrue | Custom auth |
| Realtime | Centrifugo | Realtime (Elixir) | Realtime (custom) |
| Functions | Deno | Deno | Multiple runtimes |
| Pricing | Flat license fee | Usage-based | Usage-based |
| App Hosting | Full PaaS included | Not included | Not included |
Architecture
Each BaaS service runs as a managed container on your server, orchestrated by sh0:
- PostgREST connects directly to your PostgreSQL database server and exposes tables as REST endpoints.
- Logto runs as a standalone auth server, storing user data in a PostgreSQL database you control.
- Centrifugo runs as an independent WebSocket server. Your backend publishes messages via HTTP; clients connect via WebSocket.
- Deno runs as a sandboxed runtime for your TypeScript functions, invoked via HTTP.
All services get automatic SSL via Caddy, domain routing, and health monitoring from sh0. They can communicate with each other over the internal Docker network.
Getting Started
To start using BaaS features, you need:
- A running sh0 instance (see Installation).
- A PostgreSQL database server (see Database Provisioning).
- Enable the BaaS services you need from the dashboard.
Each service is independent -- enable only what you need. Start with the individual guides:
- PostgREST API -- auto-generated REST API
- Authentication (Logto) -- managed auth service
- Realtime (Centrifugo) -- WebSocket messaging
- Functions (Deno) -- serverless TypeScript