The Moving Parts
You finish this chapter able to say which part of Miniflux holds what: where your entries live, what does the fetching, and how you and your scripts each get in. The check: when something later goes wrong — a feed silent, a sign-in refused — you will be able to guess which part is complaining before you look.
Miniflux is unusually few parts for what it does. There are five worth naming.
The one binary
Miniflux itself is a single program file, written in Go, about 24 MB in the lab's copy (transcript t01). That one file is the web server, the feed fetcher, the database migrator and the admin tool, told apart only by the flags and environment variables it is started with:
./miniflux -migratebuilds the database tables and exits../miniflux -create-adminmakes the first user and exits../minifluxwith no flag stays running: it serves the web interface and works through the fetching schedule../miniflux -config-dumpprints every setting it knows, with the value currently in force — the lab's way of discovering the option it needed in transcript t04, and a good first move whenever a setting is in doubt.
There is no separate web server to configure and no runtime to install. If a page is served at all, this binary served it.
The database
Everything Miniflux remembers lives in
PostgreSQL — not files, not an
embedded store. Your users, feeds,
categories, entries, read and unread
marks, API keys, and the schedule of
what to fetch next are all rows in
tables. The lab's fresh install
created 14 of them (transcript t02),
including feeds, entries,
categories, users and api_keys.
Two consequences follow. First, PostgreSQL is a real requirement, not a preference: no database, no Miniflux — chapter 3 starts there, and the PostgreSQL guide in this series covers the database itself. Second, backing up Miniflux means backing up that database (plus your list of feeds, which the OPML export of chapter 9 makes a one-line job). The program file itself is replaceable in a minute.
The scheduler
Left running, Miniflux keeps a quiet
internal timetable. Each feed records
when it was last checked and when it
is next due (checked_at and
next_check_at in transcript t04's
feed record). A background worker
wakes regularly and refreshes the
feeds that are due — on the default
setting, a feed is revisited about
once an hour (POLLING_FREQUENCY=60
in transcript t04). Fetching is
polite by design: Miniflux remembers
the ETag and Last-Modified
stamps a site offers, and presents
them next time, so a site with nothing
new can say so in one short reply
instead of sending the whole file
again.
The two doors
You reach the same entries through two doors.
The web interface is pages the binary serves: sign-in, the unread list, feed and category pages, settings. It is deliberately sparse — fast, keyboard-friendly (its help overlay lists dozens of shortcuts; the lab read them off the served page in transcript t03) and identical for every reader on the server, apart from each person's own lists.
The API is a set of web addresses
under /v1/ that answer in JSON
(the short, structured text format
programs trade in) instead of pages:
list my feeds, list unread entries,
mark this one read. Anything the web
interface can do, a script can do
through the API — chapter 8 runs the
important calls for real. A third,
older pair of doors (the Google Reader
and Fever sync APIs) exists for
third-party reading apps; chapter 11
is honest that this guide describes
but does not exercise them.
Who holds what, in one breath
The binary serves and fetches; PostgreSQL remembers; the scheduler decides when; the web page and the API are two views of the same lists. When a feed goes quiet, the argument is between the scheduler and the site. When a script is refused, the argument is at the API door. When everything is gone at once, look at the database.