Skip to content

The Moving Parts

One program, one small database file, one folder of documents — and an API that everything, including the web pages, talks to.

HomeBox ships as a single program file. There is no separate database server to install in the default setup, no runtime, no constellation of services. You start the one binary and it serves the web pages, answers the API, and minds the data. That shape is the reason this guide's lab could run the genuine article on a small machine in minutes.

The pieces

  • The program holds all the logic: who may log in, what an item may contain, how totals are computed. It also contains the web application itself — the pages are served by the same file, which the lab confirmed by fetching the front page and receiving the app (transcript t03).
  • The database is, by default, one SQLite file named homebox.db. Everything structured lives there: users, households, items, locations, tags, maintenance entries, the lot. The lab opened its copy afterwards and counted 21 tables (transcript t21); the file is small enough to copy with one command, which is the whole backup story in miniature. (PostgreSQL is supported for larger installs; the guide's lab used the default.)
  • The document store is a folder — .data by default — where uploaded files land: photos, manuals, receipts. Files are stored under a name derived from their contents, one folder per household, as chapter 8 shows from the lab's disk.
  • The API is the program's front door. The web pages you click are one client of it; this guide's lab was another. It is documented by the program itself: point a browser at /swagger/ on a running HomeBox and you get the full endpoint map — the lab's copy ran to 68 routes (transcript t04). Anything the screens can do, a script can do, which is why the recipes in chapter 15 lean on it.

The vocabulary that matters

The API calls both items and locations entities, because under the hood they are the same kind of record wearing different entity types: a type marked "is a location" behaves as a place, and the rest behave as things. That is why a location can hold a serial number field it will never use, and why one endpoint serves both. You do not need to love the word, but you will meet it in the API and in the export files, so it is worth meeting here first.

A group is HomeBox's word for a household: one group's worth of people sharing one inventory. One person can belong to several groups — your house, a parent's house, a club storeroom — and each group has its own items, locations, tags and currency. Chapter 13 covers the sharing model.

The check for this chapter: on a running install, the status address /api/v1/status answers with the version and a health: true — the lab's reply is in transcript t03. If you can find that, you have found the whole machine: there is nothing else to be running.