Get CV

Architecture

A feature that fits in one folder

LaraBoom keeps the resource, its fields, and the Service next to each other. Host routes and app/Http are the folders I do not create.

I spent a morning chasing a notes image bug across five Laravel trees. The model lived in app/Models, the controller in app/Http, a FormRequest next to it, a service in app/Services, a seeder in database. The upload path in one file did not match the URL the Vue grid expected. Host routes/ and app/Http were the folders that hid the mismatch.

LaraBoom puts the definition, the attributes, and the Service in Resources/Note. Routes do the same under Routes/Auth. The host app has no routes/, no app/Http, no top-level Services. JSON stays under /api.

The visitor never saw the folder layout. I did, every time a tile pointed at a file that the route had stored somewhere else. That is not taste. It is the rule that keeps a small portfolio from growing a second framework inside the first.

A feature is one folder. Read it top to bottom without jumping the tree.
A feature is one folder. Read it top to bottom without jumping the tree.

What the Service owns

Image storage, value normalisation, and seed rows left the route bodies and sat in Service. A route method now reads as validate, call the service, return the resource. Two duplicated image normalisers became obvious and were merged.

The next split is size. A service that both stores files and formats HTML is two jobs. The boundary follows the data, not the screen. Notes images stay with Note. Auth cookies stay with Auth. I do not make a SharedImageService until a third resource copies the same ten lines.

When I put HTML sanitising next to Redis list keys in the same Service, a cache flush started depending on a DOM helper. The flush test failed for a string change in a figure caption. Colocation is not one file for the whole product. It is one folder per resource, and a Service that still has one job.

Route validates, calls the service, returns the resource.
Route validates, calls the service, returns the resource.

Seeds as the spec

Every seeded row carries en, ru, and de. That caught a form that saved only the active locale and dropped the other two. It also exercises the grid: short titles, long titles, missing images, each tile size.

The cost is keeping three languages in sync by hand. The rule is no empty locale on a seed row, and a test that asserts it. If the Service file grows past one screen of seed HTML, the articles move to Note/Articles. That already happened. The resource file stayed small.

Demo patterns in the package are the other half of the spec. If the host invents a controller namespace, the next feature copies it. I read the Demo resource first, then add a host folder that looks the same. Tests hit /api, not a named route group I would have to recreate in routes/web.php.

What I took from this

I open one folder when a feature breaks. If I need five trees to find the image path, the feature already left LaraBoom shape.

I do not trust a host app/Http or a Shared service for two copies of ten lines. Route validates, Service does the work, resource returns JSON under /api.

The rule I keep: seed all three locales, move article HTML out of Service when it no longer fits one screen, match Demo. No second framework in the host.

Back to notes