# Working on a Bogie app

Source: https://bogie-go.com/docs/

One guide per feature: the commands to run, in order, and what they produce. Read [Getting started](https://bogie-go.com/docs/getting-started.html) 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](https://bogie-go.com/book.html) builds one real shop, Bogie Depot.

## The app

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

- [Getting started](https://bogie-go.com/docs/getting-started.html)

  Install Bogie, generate a new service, and get it migrating, seeded and serving.
- [Models and migrations](https://bogie-go.com/docs/models.html)

  Add a table with `g model`, change one with `g migration`, and run it through `db:*`.
- [Seeds](https://bogie-go.com/docs/seeds.html)

  Plain Go seeds with `g seed`; `db:seed` runs every one, every time, so each is safe to run twice.
- [Resources, controllers and routing](https://bogie-go.com/docs/controllers.html)

  Scaffold a whole resource or write a controller by hand, and see how either gets registered.
- [Static files and error pages](https://bogie-go.com/docs/static-files.html)

  Files in `public/`, embedded in the binary and served below the router; the 404 and 500 pages.
- [Authentication](https://bogie-go.com/docs/authentication.html)

  Guard a route group with a middleware: a shared secret, a bearer token, or a machine client's key.
- [Authorization](https://bogie-go.com/docs/authorization.html)

  Since v0.7.0, `bogie g policy` writes plain-Go authorization: a denial is 403, and a token may carry a role claim.
- [Services](https://bogie-go.com/docs/services.html)

  Give logic that is not CRUD a package of its own, with no HTTP in it.
- [Background jobs](https://bogie-go.com/docs/jobs.html)

  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](https://bogie-go.com/docs/configuration.html)

  The environment variables, the encrypted settings file, and what staging means here.
- [Your own Postgres](https://bogie-go.com/docs/own-postgres.html)

  Point the app at a Postgres you already run, without Docker.
- [Testing and CI](https://bogie-go.com/docs/testing.html)

  Where tests live, what `bin/ci` runs, and what `doctor` checks before either does.
- [Deploying](https://bogie-go.com/docs/deploying.html)

  One Docker image, every role, shipped with Kamal 2 to staging and production.
- [Upgrading an app](https://bogie-go.com/docs/upgrading.html)

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

## Reference

Look things up.

- [Conventions and agents](https://bogie-go.com/docs/conventions.html)

  The six rules every generated app keeps, and why the layout is the way it is.
- [Rails equivalents](https://bogie-go.com/docs/from-rails.html)

  A lookup table: the Rails names for things, and where each one lives in a generated Bogie app.
- [Command reference](https://bogie-go.com/docs/commands.html)

  Every `bogie` command, every generator and every `make` target, in one place.
- [Releases](https://bogie-go.com/docs/releases.html)

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