Skip to content
Get started
Documentation menu

Architecture

This section is for the person who runs a Hatamoto server and wants to know what is inside it. Hatamoto is one program plus one Postgres database: the public site, the admin, the JSON API, the endpoint for AI tools, the background jobs and the plugins all run in that one process, and the database structure is built into the program and updated when it starts.

Start with the guides to look at your own server: what runs, how a page request travels through it and where each piece of data is kept. The reference pages then hold the detail: every stage of a request, every table, the migration rules, the security controls, the plugin sandbox, the background jobs, the third-party code and the source packages.

Guides

  • Overview

    Look at a running Hatamoto server to see what runs, what it answers and where it keeps its state, in about fifteen minutes.

  • How a page is served

    Send requests to your own server with curl and watch each stage answer: headers, the log, redirects, missing pages and the admin.

  • Where your data lives

    Look inside your Postgres database and the server's folders to see where content, settings, files and secrets are kept, and what to back up.

Reference

  • Request flow

    Each stage a request passes through, from the socket to the HTML: middleware, routes, page cache, redirects, address lookup and rendering.

  • Data model

    Every Postgres table Hatamoto uses for content, people, menus, redirects, users, plugins, updates and analytics, with the rules each one follows.

  • Database migrations

    How the database structure is updated on start-up, how versions are numbered, and the rules and checks that keep going back to an older version safe.

  • Auth and security

    How Hatamoto signs in people and API keys, blocks forged requests, cleans stored content, sets security headers and guards outbound requests.

  • Plugin runtime

    How the server runs plugins in a closed space: what they may do, their limits, their own database space, outbound requests and signing.

  • Worker and background

    Every background job and loop the server runs on its own, when each one runs, and the settings that switch them off.

  • Dependencies

    Every third-party Go module and browser file Hatamoto ships, with versions and licences, how they are checked and how to update them.

  • Package map

    The technology Hatamoto is built on, the order the server starts in, the design rules behind the code and what each Go package does.