# fxbixn12/axislab architecture

> Architecture diagram of the GitHub repository fxbixn12/axislab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fxbixn12/axislab
- Repository: https://github.com/fxbixn12/axislab

## Overview

1. **Overall shape**
   - This is a Laravel application built on the Laravel + Livewire starter kit.
   - The app is a small e-commerce / ordering system with customer browsing, cart/checkout, payment integration, and an admin back office.
   - The frontend is Blade-driven with Livewire/Volt for reactive interaction, not a separate SPA.

2. **Request entry and application bootstrap**
   - HTTP requests enter through `public/index.php`, then Laravel bootstraps via `bootstrap/app.php`.
   - Routing is split between `routes/web.php` for the main site and `routes/auth.php` for authentication flows.
   - Standard Laravel config lives under `config/`, with environment setup driven by `.env.example`.

3. **Presentation layer**
   - User-facing pages are rendered from `resources/views/`, including catalog, product detail, cart, checkout, success, contact, and landing pages.
   - Admin screens have their own Blade views such as `admin.blade.php`, `admin-crear.blade.php`, and district management views.
   - Shared UI structure is centralized in `resources/views/components/` and `resources/views/layouts/`, with Flux UI components under `resources/views/flux/`.

4. **Frontend reactivity**
   - Livewire is used for interactive UI behavior without a full frontend framework.
   - The starter kit includes Livewire auth views under `resources/views/livewire/auth/` and settings views under `resources/views/livewire/settings/`.
   - A small Livewire action exists for logout in `app/Livewire/Actions/Logout.php`.

5. **Authentication and user management**
   - Authentication is handled by the standard Laravel auth stack plus custom controllers in `app/Http/Controllers/AuthController.php` and `app/Http/Controllers/Auth/VerifyEmailController.php`.
   - User data is extended beyond the default starter kit with `apellido` and `id_rol`, indicating role-based access control.
   - Email verification, password reset, and registration tests are present, matching the starter kit’s auth subsystem.

6. **Catalog and customer browsing**
   - `CatalogoController` likely serves product listing and product detail flows.
   - The domain is organized around `Producto` and `Categoria`, with a `producto-detalle` view for item detail pages.
   - This is the customer discovery layer before cart and checkout.

7. **Cart, checkout, and order lifecycle**
   - `CheckoutController` coordinates the purchase flow.
   - The database includes `carrito` and `detalle_carrito` tables for temporary cart state, plus `pedidos` and `detalle_pedido` for finalized orders.
   - Additional tables for `pagos` and `envios` show that checkout persists both payment and shipping information as separate order-related records.

8. **Payment integration**
   - `MercadoPagoController` is the dedicated integration point with Mercado Pago.
   - Architecturally, this sits between checkout/order creation and payment confirmation, handling the external payment provider boundary.
   - The `success` view suggests a post-payment return or confirmation page.

9. **Admin/back-office subsystem**
   - `AdminController` manages admin CRUD for catalog or user-related entities, while `AdminDistritoController` manages districts.
   - Admin views cover create/edit/list flows for both products/users and districts.
   - `Distrito` appears to support shipping or checkout constraints, and the migrations include `distritos` plus `add_datos_envio_to_pedidos_table`, suggesting admin-maintained shipping metadata affects orders.

10. **Domain model and persistence**
   - The core domain models are `User`, `Role`, `Categoria`, `Producto`, `Pedido`, `DetallePedido`, and `Distrito`.
   - Database migrations define the schema evolution for roles, products, cart, orders, payments, shipping, and district data.
   - `DatabaseSeeder` and `RoleSeeder` establish initial application data, especially role records for authorization.

11. **System boundaries and data flow**
   - Main flow: anonymous user browses catalog → authenticates if needed → adds products to cart → checkout creates order records → payment is sent through Mercado Pago → success/confirmation view closes the loop.
   - Admin flow: privileged user logs in → manages products/categories/districts and related operational data.
   - The key boundary is between internal order state in the database and the external payment provider.

12. **Tooling and operational structure**
   - Dependencies are managed with Composer and npm/Vite (`composer.json`, `package.json`, `vite.config.js`), reflecting a Laravel + modern asset pipeline setup.
   - GitHub Actions in `.github/workflows/` run linting and tests, so the repo includes CI validation even though the test coverage is still mostly starter-kit auth tests.
   - Standard Laravel storage, cache, and queue directories are present, but the visible architecture is primarily synchronous web request handling.

Main entry points: [`routes/web.php`](https://github.com/fxbixn12/axislab/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/CheckoutController.php`](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/CheckoutController.php) (Checkout), [`app/Http/Controllers/CatalogoController.php`](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/CatalogoController.php) (Catalog), [`app/Http/Controllers/AdminController.php`](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/AdminController.php) (Admin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry & Routing"]
  node_public_index["Front controller<br/>http entry<br/>[index.php]"]
  node_bootstrap_app["Bootstrap app<br/>[app.php]"]
  node_routes_web["Web routes<br/>route map<br/>[web.php]"]
  node_routes_auth["Auth routes<br/>route map<br/>[auth.php]"]
end

subgraph group_presentation["Presentation"]
  node_layout["Main layout<br/>blade layout<br/>[layout.blade.php]"]
  node_catalogo_view["Catalog page<br/>blade view<br/>[catalogo.blade.php]"]
  node_producto_view["Product detail<br/>blade view"]
  node_carrito_view["Cart page<br/>blade view<br/>[carrito.blade.php]"]
  node_checkout_view["Checkout page<br/>blade view<br/>[checkout.blade.php]"]
  node_success_view["Success page<br/>blade view<br/>[success.blade.php]"]
  node_admin_view["Admin page<br/>blade view<br/>[admin.blade.php]"]
  node_districts_view["Districts page<br/>blade view"]
end

subgraph group_application["Application"]
  node_catalogo_ctrl["Catalog<br/>controller"]
  node_checkout_ctrl["Checkout<br/>controller"]
  node_mercadopago_ctrl["Mercado Pago<br/>payment gateway"]
  node_auth_ctrl["Auth<br/>controller<br/>[AuthController.php]"]
  node_verify_ctrl["Verify email<br/>auth controller"]
  node_admin_ctrl["Admin<br/>controller"]
  node_admin_distrito_ctrl["District admin<br/>controller"]
  node_logout_action(("Logout<br/>livewire action<br/>[Logout.php]"))
end

subgraph group_domain["Domain & Data"]
  node_user_model[("User<br/>Eloquent model<br/>[User.php]")]
  node_role_model[("Role<br/>Eloquent model<br/>[Role.php]")]
  node_categoria_model[("Categoria<br/>Eloquent model<br/>[Categoria.php]")]
  node_producto_model[("Producto<br/>Eloquent model<br/>[Producto.php]")]
  node_pedido_model[("Pedido<br/>Eloquent model<br/>[Pedido.php]")]
  node_detalle_pedido_model[("Order detail<br/>Eloquent model<br/>[DetallePedido.php]")]
  node_distrito_model[("Distrito<br/>Eloquent model<br/>[Distrito.php]")]
  node_migrations["Schema migrations<br/>database schema"]
  node_seeders["Seed data<br/>database seeders<br/>[DatabaseSeeder.php]"]
end

node_public_index -->|"boots"| node_bootstrap_app
node_bootstrap_app -->|"loads"| node_routes_web
node_bootstrap_app -->|"loads"| node_routes_auth
node_routes_web -->|"browse"| node_catalogo_ctrl
node_routes_web -->|"checkout"| node_checkout_ctrl
node_routes_web -->|"pay"| node_mercadopago_ctrl
node_routes_web -->|"admin"| node_admin_ctrl
node_routes_web -->|"districts"| node_admin_distrito_ctrl
node_routes_auth -->|"auth"| node_auth_ctrl
node_routes_auth -->|"verify"| node_verify_ctrl
node_routes_web -->|"sign out"| node_logout_action
node_catalogo_ctrl -->|"renders"| node_catalogo_view
node_catalogo_ctrl -->|"renders"| node_producto_view
node_catalogo_ctrl -->|"reads"| node_producto_model
node_catalogo_ctrl -->|"reads"| node_categoria_model
node_checkout_ctrl -->|"uses"| node_carrito_view
node_checkout_ctrl -->|"renders"| node_checkout_view
node_checkout_ctrl -->|"creates"| node_pedido_model
node_checkout_ctrl -->|"writes"| node_detalle_pedido_model
node_checkout_ctrl -->|"validates"| node_distrito_model
node_checkout_ctrl -.->|"hands off"| node_mercadopago_ctrl
node_mercadopago_ctrl -->|"returns"| node_success_view
node_auth_ctrl -->|"authenticates"| node_user_model
node_auth_ctrl -->|"uses"| node_layout
node_verify_ctrl -->|"verifies"| node_user_model
node_admin_ctrl -->|"renders"| node_admin_view
node_admin_ctrl -->|"manages"| node_producto_model
node_admin_ctrl -->|"manages"| node_categoria_model
node_admin_ctrl -->|"manages"| node_user_model
node_admin_distrito_ctrl -->|"renders"| node_districts_view
node_admin_distrito_ctrl -->|"manages"| node_distrito_model
node_user_model -->|"belongs to"| node_role_model
node_migrations -.->|"defines"| node_user_model
node_migrations -.->|"defines"| node_role_model
node_migrations -.->|"defines"| node_producto_model
node_migrations -.->|"defines"| node_pedido_model
node_seeders -.->|"seeds"| node_role_model

click node_public_index "https://github.com/fxbixn12/axislab/blob/main/public/index.php"
click node_bootstrap_app "https://github.com/fxbixn12/axislab/blob/main/bootstrap/app.php"
click node_routes_web "https://github.com/fxbixn12/axislab/blob/main/routes/web.php"
click node_routes_auth "https://github.com/fxbixn12/axislab/blob/main/routes/auth.php"
click node_catalogo_ctrl "https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/CatalogoController.php"
click node_checkout_ctrl "https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/CheckoutController.php"
click node_mercadopago_ctrl "https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/MercadoPagoController.php"
click node_auth_ctrl "https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/AuthController.php"
click node_verify_ctrl "https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/Auth/VerifyEmailController.php"
click node_admin_ctrl "https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/AdminController.php"
click node_admin_distrito_ctrl "https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/AdminDistritoController.php"
click node_logout_action "https://github.com/fxbixn12/axislab/blob/main/app/Livewire/Actions/Logout.php"
click node_layout "https://github.com/fxbixn12/axislab/blob/main/resources/views/layouts/layout.blade.php"
click node_catalogo_view "https://github.com/fxbixn12/axislab/blob/main/resources/views/catalogo.blade.php"
click node_producto_view "https://github.com/fxbixn12/axislab/blob/main/resources/views/producto-detalle.blade.php"
click node_carrito_view "https://github.com/fxbixn12/axislab/blob/main/resources/views/carrito.blade.php"
click node_checkout_view "https://github.com/fxbixn12/axislab/blob/main/resources/views/checkout.blade.php"
click node_success_view "https://github.com/fxbixn12/axislab/blob/main/resources/views/success.blade.php"
click node_admin_view "https://github.com/fxbixn12/axislab/blob/main/resources/views/admin.blade.php"
click node_districts_view "https://github.com/fxbixn12/axislab/blob/main/resources/views/admin-distritos.blade.php"
click node_user_model "https://github.com/fxbixn12/axislab/blob/main/app/Models/User.php"
click node_role_model "https://github.com/fxbixn12/axislab/blob/main/app/Models/Role.php"
click node_categoria_model "https://github.com/fxbixn12/axislab/blob/main/app/Models/Categoria.php"
click node_producto_model "https://github.com/fxbixn12/axislab/blob/main/app/Models/Producto.php"
click node_pedido_model "https://github.com/fxbixn12/axislab/blob/main/app/Models/Pedido.php"
click node_detalle_pedido_model "https://github.com/fxbixn12/axislab/blob/main/app/Models/DetallePedido.php"
click node_distrito_model "https://github.com/fxbixn12/axislab/blob/main/app/Models/Distrito.php"
click node_seeders "https://github.com/fxbixn12/axislab/blob/main/database/seeders/DatabaseSeeder.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public_index,node_bootstrap_app,node_routes_web,node_routes_auth toneBlue
class node_layout,node_catalogo_view,node_producto_view,node_carrito_view,node_checkout_view,node_success_view,node_admin_view,node_districts_view toneAmber
class node_catalogo_ctrl,node_checkout_ctrl,node_mercadopago_ctrl,node_auth_ctrl,node_verify_ctrl,node_admin_ctrl,node_admin_distrito_ctrl,node_logout_action toneMint
class node_user_model,node_role_model,node_categoria_model,node_producto_model,node_pedido_model,node_detalle_pedido_model,node_distrito_model,node_migrations,node_seeders toneRose
```

## Components

### Entry & Routing

HTTP bootstrap and route dispatch

- [Front controller](https://github.com/fxbixn12/axislab/blob/main/public/index.php): http entry · Initial web entrypoint · `public/index.php`
- [Bootstrap app](https://github.com/fxbixn12/axislab/blob/main/bootstrap/app.php): bootstrap · Laravel application bootstrap · `bootstrap/app.php`
- [Web routes](https://github.com/fxbixn12/axislab/blob/main/routes/web.php): route map · Main site routing · `routes/web.php`
- [Auth routes](https://github.com/fxbixn12/axislab/blob/main/routes/auth.php): route map · Authentication routing · `routes/auth.php`

### Presentation

Blade and Livewire UI surfaces

- [Main layout](https://github.com/fxbixn12/axislab/blob/main/resources/views/layouts/layout.blade.php): blade layout · Shared site shell · `resources/views/layouts/layout.blade.php`
- [Catalog page](https://github.com/fxbixn12/axislab/blob/main/resources/views/catalogo.blade.php): blade view · Product listing page · `resources/views/catalogo.blade.php`
- [Product detail](https://github.com/fxbixn12/axislab/blob/main/resources/views/producto-detalle.blade.php): blade view · Single product page · `resources/views/producto-detalle.blade.php`
- [Cart page](https://github.com/fxbixn12/axislab/blob/main/resources/views/carrito.blade.php): blade view · Shopping cart page · `resources/views/carrito.blade.php`
- [Checkout page](https://github.com/fxbixn12/axislab/blob/main/resources/views/checkout.blade.php): blade view · Checkout form and confirmation page · `resources/views/checkout.blade.php`
- [Success page](https://github.com/fxbixn12/axislab/blob/main/resources/views/success.blade.php): blade view · Post-payment completion page · `resources/views/success.blade.php`
- [Admin page](https://github.com/fxbixn12/axislab/blob/main/resources/views/admin.blade.php): blade view · Back-office list/manage screen · `resources/views/admin.blade.php`
- [Districts page](https://github.com/fxbixn12/axislab/blob/main/resources/views/admin-distritos.blade.php): blade view · District management screen · `resources/views/admin-distritos.blade.php`

### Application

Controllers and interactive actions

- [Catalog](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/CatalogoController.php): controller · Catalog browsing and product detail flows · `app/Http/Controllers/CatalogoController.php`
- [Checkout](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/CheckoutController.php): controller · Cart and order flow coordination · `app/Http/Controllers/CheckoutController.php`
- [Mercado Pago](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/MercadoPagoController.php): payment gateway · External payment integration boundary · `app/Http/Controllers/MercadoPagoController.php`
- [Auth](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/AuthController.php): controller · Custom login and registration handling · `app/Http/Controllers/AuthController.php`
- [Verify email](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/Auth/VerifyEmailController.php): auth controller · Email verification flow · `app/Http/Controllers/Auth/VerifyEmailController.php`
- [Admin](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/AdminController.php): controller · Back-office CRUD entrypoint · `app/Http/Controllers/AdminController.php`
- [District admin](https://github.com/fxbixn12/axislab/blob/main/app/Http/Controllers/AdminDistritoController.php): controller · District management for shipping/admin data · `app/Http/Controllers/AdminDistritoController.php`
- [Logout](https://github.com/fxbixn12/axislab/blob/main/app/Livewire/Actions/Logout.php): livewire action · Session sign-out action · `app/Livewire/Actions/Logout.php`

### Domain & Data

Core entities and persistence

- [User](https://github.com/fxbixn12/axislab/blob/main/app/Models/User.php): Eloquent model · Authenticated user with role data · `app/Models/User.php`
- [Role](https://github.com/fxbixn12/axislab/blob/main/app/Models/Role.php): Eloquent model · Authorization role model · `app/Models/Role.php`
- [Categoria](https://github.com/fxbixn12/axislab/blob/main/app/Models/Categoria.php): Eloquent model · Product category model · `app/Models/Categoria.php`
- [Producto](https://github.com/fxbixn12/axislab/blob/main/app/Models/Producto.php): Eloquent model · Catalog product model · `app/Models/Producto.php`
- [Pedido](https://github.com/fxbixn12/axislab/blob/main/app/Models/Pedido.php): Eloquent model · Finalized order model · `app/Models/Pedido.php`
- [Order detail](https://github.com/fxbixn12/axislab/blob/main/app/Models/DetallePedido.php): Eloquent model · Line items for orders · `app/Models/DetallePedido.php`
- [Distrito](https://github.com/fxbixn12/axislab/blob/main/app/Models/Distrito.php): Eloquent model · Shipping district model · `app/Models/Distrito.php`
- **Schema migrations**: database schema · Tables for users, roles, catalog, cart, orders, payments, shipping, and districts
- [Seed data](https://github.com/fxbixn12/axislab/blob/main/database/seeders/DatabaseSeeder.php): database seeders · Initial roles and app data · `database/seeders/DatabaseSeeder.php`

## Connections

- Front controller → Bootstrap app: boots · Web entrypoint starts the framework
- Bootstrap app → Web routes: loads · Registers the main web route set
- Bootstrap app → Auth routes: loads · Registers auth-specific routes
- Web routes → Catalog: browse · Catalog and product pages
- Web routes → Checkout: checkout · Cart and order flow
- Web routes → Mercado Pago: pay · Payment provider boundary
- Web routes → Admin: admin · Back-office management routes
- Web routes → District admin: districts · District management routes
- Auth routes → Auth: auth · Login and registration flows
- Auth routes → Verify email: verify · Email verification flow
- Web routes → Logout: sign out · Session termination action
- Catalog → Catalog page: renders · Catalog listing view
- Catalog → Product detail: renders · Product detail view
- Catalog → Producto: reads · Catalog data access
- Catalog → Categoria: reads · Category grouping
- Checkout → Cart page: uses · Cart UI during purchase flow
- Checkout → Checkout page: renders · Checkout UI
- Checkout → Pedido: creates · Order lifecycle start
- Checkout → Order detail: writes · Order line items
- Checkout → Distrito: validates · Shipping district constraints
- Checkout → Mercado Pago: hands off · Delegates payment processing
- Mercado Pago → Success page: returns · Post-payment confirmation
- Auth → User: authenticates · User identity and profile data
- Auth → Main layout: uses · Shared auth/site shell
- Verify email → User: verifies · Email verification state
- Admin → Admin page: renders · Admin management screens
- Admin → Producto: manages · Catalog administration
- Admin → Categoria: manages · Category administration
- Admin → User: manages · User administration
- District admin → Districts page: renders · District management screens
- District admin → Distrito: manages · District data maintenance
- User → Role: belongs to · Role-based access control
- Schema migrations → User: defines · User schema extensions
- Schema migrations → Role: defines · Role storage
- Schema migrations → Producto: defines · Catalog tables
- Schema migrations → Pedido: defines · Order and payment tables
- Seed data → Role: seeds · Initial authorization data
