Guides

Working on a Bogie app

Markdown version

One guide per feature: the commands to run, in order, and what they produce. Read Getting started first; the rest stand on their own after that. To learn the same path end to end, the book Bogie: How to Go from Zero to Production builds one real shop, Bogie Depot.

The app

Build the service: models, routes, seeds, auth, services and jobs.

  • Getting started

    Install Bogie, generate a new service, and get it migrating, seeded and serving.

  • Models and migrations

    Add a table with g model, change one with g migration, and run it through db:*.

  • Seeds

    Plain Go seeds with g seed; db:seed runs every one, every time, so each is safe to run twice.

  • Resources, controllers and routing

    Scaffold a whole resource or write a controller by hand, and see how either gets registered.

  • Static files and error pages

    Files in public/, embedded in the binary and served below the router; the 404 and 500 pages.

  • Authentication

    Guard a route group with a middleware: a shared secret, a bearer token, or a machine client's key.

  • Authorization

    Since v0.7.0, bogie g policy writes plain-Go authorization: a denial is 403, and a token may carry a role claim.

  • Services

    Give logic that is not CRUD a package of its own, with no HTTP in it.

  • Background jobs

    Add River with --jobs at new time, or later with g job, and write a worker that runs beside it.

Infra

Configure, test, ship and keep it current.

  • Configuration and credentials

    The environment variables, the encrypted settings file, and what staging means here.

  • Your own Postgres

    Point the app at a Postgres you already run, without Docker.

  • Testing and CI

    Where tests live, what bin/ci runs, and what doctor checks before either does.

  • Deploying

    One Docker image, every role, shipped with Kamal 2 to staging and production.

  • Upgrading an app

    bogie app:update: a three-way merge to a newer layout that keeps your edits.

Reference

Look things up.

  • Conventions and agents

    The six rules every generated app keeps, and why the layout is the way it is.

  • Rails equivalents

    A lookup table: the Rails names for things, and where each one lives in a generated Bogie app.

  • Command reference

    Every bogie command, every generator and every make target, in one place.

  • Releases

    What each version added or changed, newest first, with breaking changes marked.