Almanac
the slot engine · browser build

This is the slot engine only — not the booking platform. Almanac is JWT sign-in over a relational database, transactional email and a background reminder thread, and none of that can run in a browser tab. What can is the part that is pure computation: turning a provider's recurring weekly hours, their one-off blocks and their existing bookings into the list of slots a guest may actually book. That is what this page is, and it is all it is.

There is no account, no database, and nothing is saved. Every row you add below lives in this tab and is gone when you close or reload it. Nothing is uploaded and no request leaves the page. You cannot book any of the slots it shows you — there is nobody to book them with.

js/slots.js is a port of domain/calendar_logic.py, and tools/build_static.py runs the two against each other in a real browser over a matrix of scenarios before publishing this page. It refuses to write a single file if they disagree about one slot. Source, and the Flask app the engine belongs to →

What the provider has set

The three tables the engine reads. Change any of them and the board on the right recomputes.

Start from

Weekly opening hours

Recurring, by weekday. A window is a start, an end and the length of one slot; a day may have several, and a day with none is simply not open.

One-off blocks

Time taken out of a single date. Leave both times empty for a whole day off — that is what a null pair means in the blocked_slots table, and the engine reads it that way.

Existing bookings

The engine's filter is status = 'confirmed', so only a confirmed appointment is busy. Cancelling one frees its slot again, which is the whole point of cancelling it; a completed one frees it too, which is almost always moot because a completed appointment is in the past.

What a guest may book

Computed here, in this tab, by the same rules the Flask app applies.

The question

The clock is a control because it is part of the answer: a date in the past offers nothing at all, and today offers only what has not started yet. A slot beginning this very minute is already gone — by the time anyone confirmed it, it would have begun.

— —

How it got there

    Is a particular span bookable?

    is_slot_free walks consecutive free slots rather than matching one exactly, which is why a provider on a 30-minute grid can still take a 60-minute booking.

    —

    What the engine is part of

    Almanac is a multi-role booking platform: Flask and JWT behind a single-page front end. Everything above is one module of it.

    Running it is pip install -r requirements.txt then python app.py, on 127.0.0.1:5003. It refuses to start reachable from outside with the committed development secret, because that secret is public and it signs every session token. The full README →

    The calendar, blank

    The engine above answers when can somebody book me. This is the other side of it: your own week, in one file that needs no server at all.

    An empty
      month; a day is picked, two entries are added to it and appear on the
      grid, and a to-do is added beside them

    Open the blank calendar → — no term, no diary, no to-dos, nothing of anybody's. The sample planner is the same engine seeded with an invented term, which shows what it does and is the wrong place to start a real one from: the first job would be deleting somebody else's lectures.

    A file:// page can raise a notification while its tab is open and none at all once it is closed — it cannot register a service worker, so there is no background to run in. That is the seam between the two halves: export a backup from the calendar, import it into Almanac, and the server's sweep mails you before each event whether or not anything is open. domain/schedule.py keys that on the planner's own event ids, so importing the same export twice updates rather than duplicates.