Will being able to organise/work on individual components of an app by component directories be possible with Hologram?

I think what you’re describing is vertical slicing architecture - and I have great news! This is exactly what will be possible in the standalone Hologram version. Actually, supporting this kind of structure is one of the key reasons why standalone is needed.

Here’s how it will work:

When you generate a new project with the Hologram project generator, you’ll start with a horizontal slicing structure - all your app directories organized by technical layers (pages, components, services, etc.) in one flat folder structure.

But as your application grows (or really, whenever you want), you’ll be able to switch to vertical slicing and reorganize the app folder into feature/domain directories like shopping_cart, accounting, etc. Each subfolder would have its own subdirectories for pages, components, services, tests, and so on.

I think it usually makes sense to start with horizontal slicing because in the beginning you don’t always know exactly what you’re building, and this way you can save time not overthinking boundaries (similar to how you’d start with MVC). Later, once the application grows and patterns emerge, you can reorganize the code better.

Note: Vertical slicing won’t be possible in the first standalone version, but it will be supported eventually.

So Hologram will have two modes:

  1. Phoenix-based - where you use Hologram alongside Phoenix or even together with Phoenix LiveView
  2. Standalone - very simple to use, with a very simple structure, no configuration needed. Just install and start adding features.
5 Likes