Architecture
This page is the picture an integrator needs. It names no hosts and no infrastructure of any one installation.
The parts
- The API is a Ruby on Rails application (Rails 8). It serves the JSON API
under
/api/v1, receives webhooks from other systems, and runs the background jobs. Data is kept in PostgreSQL. - The back office, the shop and the driver app are single-page web
applications (SvelteKit, built to static files). They hold no data of their own
and call the API. The back office is also what serves these pages, under
/docs. - Search uses Meilisearch. The API indexes products and other records, and every search is limited to the signed-in shop.
- Files such as product images are kept in an S3-compatible store.
- Print hubs are small programs at a shop that receive print jobs from the API. Commands travel through Redis. They are not documented yet.
- The MCP endpoint sits on the API address under
/mcpand lets an AI agent call shop operations. It takes an agent key or an OAuth token issued by Tienda; see MCP overview. The OAuth metadata, consent, token and registration endpoints are on the same address, outside/api/v1.
The back office and the driver app are installable web applications: each carries a web app manifest with its installable icons, an apple-touch-icon and a favicon, all made from the owner's one drawing. The browser tab is that drawing too, scaled down to 16, 32 and 48 px; it reads soft there by the owner's choice. These pages use the same mark in the sidebar.
Tenants
One installation serves many shops. Each shop is a tenant, called an application in the data. Almost every record carries the tenant it belongs to, and every API controller starts from the signed-in shop's own records, so a request cannot reach another shop's data. A token names one shop. A person can belong to several shops and chooses one when signing in. A tenant can be suspended (nobody can sign in) or archived (inaccessible).
Which modules a shop has is also per tenant: each module is enabled, read only or disabled. See Modules.
Shop fronts
A shop front is a public shop on a domain. A request from a shop's domain is tied to the shop by the host it comes from. See Shop fronts and domains.
Background jobs
Slow and repeating work runs in background jobs on a queue kept in the database (Solid Queue). Examples: delivering webhooks, sending mail, checking payments, mirroring a POS, making delivery and pickup slots, renewing subscriptions, and the daily clean-up of the e-mail log. Recurring jobs are scheduled in the application's configuration. A job that fails is retried for the kinds of work where that is safe, such as webhook delivery (five attempts).
Realtime
The API also has a WebSocket endpoint (Action Cable). A session is checked on every WebSocket connection, as on every request.
Signing in
Staff sign in with an e-mailed code, or, when the operator has switched it on, with the Shiloh account. The API issues a token that names the person and the shop and lasts 24 hours. Shop customers sign in with an e-mailed code at the shop and get a token for that shop only. Programs that only read products use an API key.
Languages
The back office speaks English and Dutch. The shop speaks four languages. Translated texts of products, pages and menus are stored per language, and the shop API answers in the visitor's language.