FrontierJS

The allegory

Building software is like opening a restaurant.

On the first night you have a dish worth eating and somewhere to cook it. Every night after that brings something new to look after, and each one turns up because you dealt with the one before.

The order rail

  1. 01

    Does it work?

    The dish

    Every restaurant starts with one plate somebody wants to eat. Behind it is a recipe card: what goes in, how it's made, how it's served, and the line at the bottom that says who mustn't eat it.

    Lead

    • nameText
    • emailEmail
    • stagenew · won · lost
    • ownerUser

    @@gate: staff read, owner writes

    In FrontierJS the recipe card is db/schema.lite. You write a model once and the rest is cooked from it: the data (Model), the API that serves it (Service) and the screens people use (Resource). The line at the bottom goes on the card too. A @@gate on the model says who may read a record and who may change it.

    Everything after this is cooked from the card.

    See: Flow

  2. 02

    Can anyone get in?

    Open the doors

    A dish nobody can reach isn't a restaurant. It needs an address, a sign, the lights on and a door that unlocks at six. Behind the door are the gas, the water and the power, and the meter room stays locked.

    fli deploy puts the app on a server, and Outpost on that server acts only on signed instructions. Config is read in one place, through $.config, and fli env:* moves each environment's values between machines. Ports follow a formula of environment, category, project and service, so dev, test and prod never share a door.

    Where it lives is part of the plan.

  3. 03

    What if the fridge dies?

    Stock the walk-in

    Everything the kitchen knows sits in the walk-in: the stock, the prep, the sauce that took two days. The night the compressor fails is the night you find out whether anything was kept anywhere else.

    fli db:backup takes a hot copy of every database the schema declares, while it's serving. Migrations come from diffing the schema against the database, so the walk-in always matches the card. Restoring a copy is one command.

    Keep a second copy of what you can't cook again.

  4. 04

    Is tonight going well?

    Watch the pass

    A good manager stands where the plates come out. Which tickets are waiting, which tables have turned, which plate came back untouched. You can't fix a service you can't see.

    Every request carries a trace id from the door to the database and back. Health checks and metrics are registered next to the code they describe, and the devtools panel shows calls as they happen.

    See the service while it's still going on.

  5. 05

    Will I hear when it isn't?

    The alarm

    Nobody can stand at the pass all night. So there's a smoke alarm, a fridge that beeps when it warms, and a cook who shouts when a ticket has waited forty minutes. The building tells you when something's wrong.

    Basecamp, itself a FrontierJS app, watches every server and every app on it and raises an alert when one stops answering or a check fails. Alerts are notifications, so each one lands in the app and in an inbox at once.

    Hear it from the building, not from a customer.

  6. 06

    Why am I doing this by hand?

    Morning prep

    Half the work of a kitchen happens when nobody's eating. The prep crew comes in at seven, the standing order goes out on Mondays, the floors get done after close. Nobody asks for it each day. It just happens, by the same rules as the rest of the kitchen.

    Caravan runs the queue and the schedule, on SQLite. A follow-up can be queued in the same transaction as the save that prompted it, so it only runs if the save did. A job reads and writes through the same gates as a person.

    Settled at 01 · the card

    Work nobody clicked answers to the same card.

  7. 07

    Can I change it safely?

    Change the menu

    Sooner or later the menu changes. You taste it on Tuesday, print it on Wednesday and keep last season's in the drawer, because a new dish that sinks on Friday has to come off by Saturday.

    A new menu comes from new cards. The migration is diffed from the schema, and fli test:access writes the whole access policy out as a snapshot, so a change to who can do what shows up in review. fli proves names the checks a change needs, fli release:mint shows exactly what would ship, and fli deploy:rollback puts the last release back.

    Settled at 01 · the card

    Know what changes before anyone eats it.

  8. 08

    Who can touch what?

    The keys

    A busy restaurant ends up with a ring of keys: the walk-in, the till, the office safe, the wine store. People join and leave, and the question is never who has a key. It's whether anyone remembers who has a key.

    Here it was answered on the card. The @@gate on each model holds whether the caller is a person at the door, a job at dawn or an agent working through MCP. @encrypted and @guarded fields stay locked at the data layer, secrets never sit in the repo, and the audit trail records each change with protected fields written as [redacted].

    Settled at 01 · the card

    One lock, whoever's at the door.

  9. 09

    What if the fish doesn't come?

    The suppliers

    No kitchen grows its own fish. There's the fish guy, the bakery, the card machine and the delivery apps, and every one of them is a way for Friday to go wrong without anyone in the building doing anything.

    Each outside service is declared once, with its own timeouts and retries, and every call goes through app.conduit.send(). When something changes inside, webhooks go out at least once and try again when nobody answers. Sign-in with another provider comes through the same door.

    Every supplier is on the books.

    See: Seams

  10. 10

    What happens at eight on a Saturday?

    The bad night

    The oven dies with a full room. The card machine goes down. A delivery never turns up. A good kitchen has been through it before and knows the next move without stopping to think.

    A deploy that went wrong is one fli deploy:rollback, and the deploy journal says what happened. A lost database comes back from the last backup. A failed job retries on its own, and a supplier that's down is retried by conduit without anyone writing a loop.

    Have the next move ready before you need it.

  11. 11

    Is the whole place healthy?

    The books

    One day you notice you don't cook much anymore. You do the rota, the books, the repairs and the inspections, and you keep a notebook of why the walk-in is where it is so nobody moves it. You're the owner now.

    fli is the office desk. Its commands are written in markdown, and your project's own sit beside the framework's. fli check turns your conventions into checks that fail, so nobody has to remember them. The reasons live in DECISIONS.md, what's broken in ISSUES.md, and fli next suggests what to work on.

    Less running around for the person who answers for all of it.

  12. ··

    One card, every station

    Write "contains nuts" on the card once, and nobody has to remember to say it again.

    Menumarks the dish
    Ticketflags the order
    the cardcontains nuts
    Floorwarns the table
    Inspectorchecks the line

    The @@gate on Lead works the same way. You wrote it once, and it turns up at every station:

    Screensthe query refuses rows the caller can't see, and the screen hides the button
    APIa refused call gets its status from the one place that maps errors
    Prep crewa job reads through the same gate as a person
    Agentsan agent isn't offered a tool it isn't allowed to use
    Reviewfli test:access puts any change to it in the diff

    One card for the whole kitchen.

  13. 12

    Do I do all of that twice?

    The second location

    Then it goes well enough that you open another. Without the cards, you rebuild the kitchen from memory and every station comes out slightly different. With them, you open the binder.

    db/schema.litethe binder

    Every FrontierJS app is laid out the same way: db/ at the root and each surface beside it, api/, web/, site/. fli new opens the next one already set up, Outpost runs on each server, and Basecamp runs every location from one office.

    The second one opens as a restaurant, not a dish.

Eleven jobs, two kitchens

Every job brings its own

  1. Disha framework
  2. Doorsa host
  3. Walk-ina backup script
  4. Passa log service
  5. Alarma pager
  6. Prepa cron box
  7. Menua CI file
  8. Keysan auth vendor
  9. Supplierssix SDKs
  10. Bad nighta runbook
  11. Booksa spreadsheet

Every job reads the card

db/schema.lite

  1. DishModel · Service · Resource
  2. Doorsfli deploy
  3. Walk-infli db:backup
  4. Passtraces · health
  5. AlarmBasecamp
  6. PrepCaravan
  7. Menufli release:mint
  8. Keys@@gate
  9. Suppliersconduit
  10. Bad nightfli deploy:rollback
  11. Booksfli

You thought you were cooking.
You were running a restaurant.

FrontierJS is a framework for building and running software systems, for the few people who look after the whole place.

The same arc, with the tools up front: The story · Map