Barnark

Give a new project a shape, and keep it.

Barnark keeps a catalogue of architecture templates. Clone one into a template of your own, let Barnark make the folders, and check at any time that nothing has strayed.

The Barnark browser app for a hotel project. Hotel is an ark at /src, made from the team’s copy of Domain Driven Design. Its tree is open: the Context folder holds FrontDesk, Property and Reservation, and Reservation’s Domain holds a Booking aggregate. Dashed buttons offer Create New Aggregate and Create New Context where the template allows them.
Start from a template

A shape, not a blank folder.

Barnark ships five: Domain Driven Design, Feature Based Architecture, Model View Controller, Library and Package App. Each says what folders there are and what each is for, and where it suits.

Cloning one makes the folders at once. A template says only what folders there are, never what goes in them, so it fits any language.

Model View Controller
app/
├── Controller/
├── Model/
└── View/

The folders a clone makes. Libraries and layered applications make more.

Yours, not borrowed

A copy, so nothing can change under you.

Clone Domain Driven Design as Hotel and Hotel is the project’s own, with nothing tying it to the original. If a later Barnark changes the shipped template, your project doesn’t notice.

Edit your template as you like, or leave it as it is. Whatever you build is yours to keep.

  • Hotelbound to /src
  • Domain Driven Designshipped, read-only
  • Libraryshipped, read-only
One change, two places

The template and the folders move together.

Add a context and the template records it as a new revision while the folder, with everything a context holds, appears on disk. Deleting a member is recorded as a revision too.

Every revision is kept with a reason, so the history of the architecture reads like the history of any decision.

$ barnark template:new Context Reservation src/Context

src/Context/
└── Reservation/
    ├── Application/
    ├── Domain/
    ├── Infrastructure/
    └── PublicApi/

The template now reads “Added Context/Reservation.”

Checked, not claimed

Either it conforms or it doesn’t.

The check compares the project’s folders with its template and lists what is missing and what is unexpected. For anything unexpected you decide: remove it, or take it into the template and say what it is for.

Nobody declares a project well architected. The check says.

The Check tab for the hotel project. It says one inconsistency was found: the folder /src/Scratch is not part of Hotel, with a button to add it to the template.
A folder made by hand, with no place in the template, and the button to take it in.

Used in Barn: in a barn, Barnark is the Ark tab. It works on its own too.