Usage
A Datahoster data host is one folder. Inside it you author three kinds of thing: collections that hold your data, users that hold an access token, and endpoints that define your API. Edit them locally; the local client mirrors them up and your server serves a JSON API over HTTPS.
api.example.com/
datahoster-collections/ your tables, each a folder of columns
datahoster-users/ accounts that hold an access token
datahoster-endpoints/ your API, one folder per path
A collection is a table: a folder of typed columns, with records you can import from local files. You never reach a collection directly. Every request goes through an endpoint, a named entry in your API that reads or writes one collection under its own permission. A user is a name with a token. Keeping endpoints separate from collections lets your API stay stable while the collections behind it change.
Contents
Server →
The server on your own box: Caddy and the small datahoster API, set up by one install script. It holds the data and serves the API.
Local →
The local client you run from your machine: one command and one config that push your schema up, pull records down, and build the tools pages.
Domains →
Your content root, one folder per domain. Each domain folder holds its own collections, users and endpoints.
Collections →
A table, stored as a folder: its definition, a folder of typed columns, and records to import from local files.
Users →
A named account holding an access token. List a user in an endpoint's permission to grant them that operation.
Endpoints →
Your API surface: select, insert, update and delete endpoints, each naming a collection, its public fields and who may call it.
Examples
Worked data hosts you can read end to end. Browse them all in Examples.
Contact form →
A public inbox: anyone may submit a message, only you may read the messages back. One collection, an open insert endpoint and a private select endpoint.
Search →
This site's own search: a collection of terms filled by import, behind a public select endpoint parameterised by the query. The reference search box calls it.