Modular monolith
The Baxela backend is a modular monolith: a single Laravel deployment whose codebase is partitioned into bounded, self-contained modules managed with nwidart/laravel-modules.
You get microservice-style separation — each module owns its domain logic,
database tables, routes, and events — without distributed-systems overhead.
Modules live in apps/backend/Modules/, one folder per module.
Modules at a glance
| Module | Responsibility |
|---|---|
| Auth | Authentication and authorization |
| Cart | Shopping carts and cart items |
| Catalog | Products, variants, options, images, categories |
| Contact | Storefront contact-form messages and admin inbox |
| Content | CMS pages and the blog (posts, categories, comments) |
| Core | Shared contracts, gateways, DTOs, countries, idempotency |
| Discount | Coupons and automatic product promotions |
| Inventory | Product stock levels |
| Media | Media uploads |
| Menu | Navigation menus and nested links |
| Notification | Database/email/web-push notifications, realtime broadcast |
| Order | Orders, order items, order addresses |
| Payment | Payments behind a pluggable gateway-driver registry |
| Setting | System settings |
| Shipping | Shipping methods, zones, rates, shipments |
| Support | Customer support tickets |
| User | Customers/users |
See Backend / Modules for the per-module reference: tables, emitted/listened events, and dependencies.
How modules interact
- Events — the primary coupling point. A module publishes domain events
(for example
OrderCreatedEvent) and other modules react through listeners. See Events. - Gateways & contracts — the Core module hosts shared interfaces,
events, gateway contracts, and DTOs. A module consumes another module's
data only through a gateway defined in Core (e.g. Shipping calls
OrderGatewayInterface::markAsShipped), never by reaching into another module's internals. - Table prefixes — each module's tables are prefixed with the module
name (
catalog_products,order_orders,shipping_rates, …), keeping the single database physically partitioned by module.
Interactive dependency graph
The real coupling between modules is mapped in an auto-generated,
interactive graph that ships in the main repository:
docs/module-dependency-graph.html.
View it rendered on
htmlpreview.
It aggregates imports, calls, references, and inheritance across the backend
modules, the admin feature areas, and the storefront parts. Hover any module
for its coupling stats, drag to rearrange, filter by app, and raise the
minimum-reference threshold to surface only the strongest links. The graph is
a snapshot regenerated after each version release with
python3 scripts/generate-module-graph.py, so it stays in sync with the
module list on this page.
Database ERD
Every module's database schema is diagrammed in the
Database ERD reference: one Mermaid diagram per module with
tables, columns, keys, and indexes. Solid lines are enforced database foreign
keys; dashed lines are Eloquent relations the database does not constrain
(mostly cross-module references); loose *_id columns that have neither are
listed per page.
The pages are generated from the live schema with php artisan erd:generate
in the platform repository and pulled into this site with pnpm sync:erd, so they describe the database
exactly as deployed.
Extending the platform
Baxela is built to be extended via:
- Events & listeners — subscribe to existing domain events.
- Module overrides — replace module behavior where the module system allows it.
- Custom modules — add your own module with its own tables and events; nothing in the core assumes it exists.