Skip to content

Directory Structure

.
├── app
│   ├── config
│   │   └── i18n
│   │       └── en
│   ├── public
│   │   ├── css
│   │   ├── js
│   │   └── static
│   │       └── images
│   └── src
│       ├── back_end
│       │   ├── data_models
│       │       ├── db
│       │       ├── migrations
│       │       └── seed
│       ├── cli
│       └── front_end
│           ├── components
│           ├── css
│           ├── fonts
│           ├── forms
│           ├── handlers
│           ├── images
│           ├── js
│           ├── layouts
│           ├── pages
│           ├── route_hooks
│           ├── support
│           └── svgs
├── bin
├── deploy
├── dx
└── specs
    ├── back_end
    │   ├── data_models
    │       └── db
    ├── e2e
    ├── factories
    │   └── db
    └── front_end
        ├── components
        ├── handlers
        ├── js
        ├── pages
        └── support

Top Level

DirectoryPurpose
app/Contains all configuration and source code specific to your app
bin/Contains tasks and other CLIs to do development of your app, such as bin/test
dx/Contains scripts to manage your development environment
specs/Contains all tests

Inside app/

DirectoryPurpose
bootstrap.rbA ruby file that sets up your app and ensures everything is required in the right way.
config/Configuration for your app, such as localizations and translations. Brut tries very hard to make sure there is no YAML in here at all. YAML is not good for you.
public/Root of public assets served by the app.
src/All source code for your app

Inside app/src

DirectoryPurpose
app.rbThe core of your app, mostly configuration, such as routes, hooks, middleware, etc.
back_end/Back end classes for your app including database schema, DB models, seed data, and your domain logic
cli/Any CLIs or tasks for your app
front_end/The front-end for your app, including pages, components, forms, handlers, JavaScript, and assets

Inside app/src/back_end

DirectoryPurpose
data_models/app_data_model.rbBase class for all DB model classes
data_models/dbDB model classes
data_models/db.rbNamespace module for DB model classes
data_models/migrationsDatabase schema migrations
data_models/seedSeed data used for local development

Inside app/src/front_end

DirectoryPurpose
components/Component classes
css/CSS, managed by esbuild and bin/build-assets
fonts/Custom fonts, managed by esbuild and bin/build-assets
forms/Form classes
handlers/Handler classes
images/Images, copied to app/public by bin/build-assets
js/JavaScript, managed by esbuild and bin/build-assets
layouts/Layout classes
middlewares/Rack Middleware, if any
pages/Page classes
route_hooks/Route hooks, if any
support/General support classes/junk drawer.
svgs/SVGs you want to render inline

Inside specs/

specs/ is intended to mirror app/src, but has a few extra directories:

DirectoryPurpose
specs/back_endtests for all back-end code, organized the same as app/src/back_end
specs/back_end/data_models/dbtests for all DB classes, if needed
specs/e2eEnd-to-end tests, organized however you like
specs/factoriesRoot of all factories for FactoryBot. You can create subdirectories here for non-DB classes you may want to be able to create
specs/factories/dbFactories to create DB records
specs/front_endtests for all front-end code, organized the same as app/src/front_end
specs/jsJavaScript code to test any autonomous custom elements you have created