# softdevhassan/minilara architecture

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

- Interactive diagram: https://gitdiagram.com/softdevhassan/minilara
- Repository: https://github.com/softdevhassan/minilara

## Overview

1. **Overall shape**
   This repository is a small PHP application/framework hybrid: a minimal core under `app/core`, Blade-based presentation under `app/src`, database schema management under `app/database`, and a thin web entrypoint at the project root.

2. **Request entrypoints**
   There are two primary runtime paths:
   - **Web requests** start at `index.php` and are typically rewritten through `.htaccess`.
   - **CLI commands** start at `bin/minilara`, which likely dispatches to the framework console for migrations, seeding, running the dev server, and key generation.

3. **Framework core boundary**
   The core runtime lives in `app/core` and is intentionally compact:
   - `Framework.php` is the likely bootstrap/orchestration layer.
   - `Router.php` handles request-to-handler matching.
   - `DB.php` wraps database access, probably through Eloquent/Illuminate.
   - `Console.php` powers command-line operations.
   - `Installer.php` and `DevTool.php` suggest setup and developer utilities.
   - `functions.php` likely contains shared helper functions used across the system.

4. **HTTP and routing flow**
   Incoming HTTP requests are routed by the core router to application handlers and views. The repository does not show a traditional controller layer, so routing likely maps directly to Blade pages or lightweight handlers in the `app/src/pages` and `app/api` areas.

5. **Presentation layer**
   UI templates are organized under `app/src`:
   - `layout/` contains the shared shell, navbar data, and breadcrumb partials.
   - `pages/` is segmented by feature area: auth, main app pages, manage screens, error pages, and print templates.
   - This layout implies server-rendered pages with reusable Blade templates rather than a client-heavy SPA.

6. **Asset and frontend pipeline**
   Frontend code is split into:
   - `app/src/assets/css/app.css`
   - `app/src/assets/js/app.js`
   
   These are built with `vite.config.js`, and the presence of `package.json`/`pnpm-lock.yaml` indicates a Node-based asset pipeline. The README also indicates Tailwind CSS, Alpine.js, and jQuery are part of the frontend stack.

7. **API boundary**
   `app/api/search.php` is a separate API endpoint outside the page-rendering structure. This suggests the app has at least one direct data endpoint for asynchronous search use, isolated from the Blade page flow.

8. **Data layer**
   Database evolution is handled through `app/database/migrations`, with seed data in `app/database/seeds`. The presence of a `users` table and `settings` table migration, plus `AdminUserSeeder.php`, shows the app expects authentication and configuration data to exist at bootstrap or install time.

9. **Auth, permissions, and module configuration**
   The config directory contains `modules.php` and `permissions.php`, which indicates the app is built around feature/module toggles and role or permission checks. Combined with the auth pages and user management screens, this suggests an admin-oriented system with access control as a first-class boundary.

10. **Localization and validation**
    `app/lang/en/validation.php` shows framework-level validation messages are localized and stored separately from views and business logic. This supports the use of Illuminate validation in the request lifecycle.

11. **PWA and public delivery**
    `app/public` contains `manifest.json`, `sw.js`, and image assets, which means the app includes a Progressive Web App layer. Static assets and service worker behavior are served as part of the public web surface, alongside the normal HTML responses.

12. **Operational/admin surface**
    The page structure includes `home`, `profile`, `settings`, `users`, and `manage/user`, which points to an internal admin/ERP-style application rather than a public consumer site. The `prints/` templates further indicate a document-generation path for reports or ledger-style output.

13. **External technology boundaries**
    The architecture is backed by Laravel ecosystem components, but in a stripped-down form: Eloquent ORM, Blade rendering, validation, Symfony HTTP foundation, and FastRoute-style routing. Composer manages PHP dependencies; pnpm/Vite manage frontend dependencies and builds.

14. **Typical end-to-end flow**
    A request enters through the web root, is bootstrapped by the framework core, matched by the router, optionally checks auth/permissions, reads or writes data through the DB layer, and returns either a Blade-rendered page, a print template, or a small API response. CLI tasks follow a separate path through the console subsystem into migrations, seeding, or environment/tooling commands.

Main entry points: [`app/core/Router.php`](https://github.com/softdevhassan/minilara/blob/main/app/core/Router.php) (Router), [`app/core/Console.php`](https://github.com/softdevhassan/minilara/blob/main/app/core/Console.php) (Console), [`app/core/Framework.php`](https://github.com/softdevhassan/minilara/blob/main/app/core/Framework.php) (Framework), [`app/src/layout/app.blade.php`](https://github.com/softdevhassan/minilara/blob/main/app/src/layout/app.blade.php) (Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entrypoints["Entrypoints"]
  node_htaccess[".htaccess<br/>web rewrite<br/>[.htaccess]"]
  node_index["index.php<br/>web entry<br/>[index.php]"]
  node_cli["minilara<br/>cli entry"]
end

subgraph group_core["Core"]
  node_framework["Framework<br/>bootstrap<br/>[Framework.php]"]
  node_router["Router<br/>routing<br/>[Router.php]"]
  node_db[("DB<br/>database<br/>[DB.php]")]
  node_console["Console<br/>cli runtime<br/>[Console.php]"]
  node_installer["Installer<br/>setup tools<br/>[Installer.php]"]
  node_devtool["DevTool<br/>dev tools<br/>[DevTool.php]"]
  node_helpers["Helpers<br/>shared functions<br/>[functions.php]"]
  node_searchapi["Search API<br/>api endpoint<br/>[search.php]"]
end

subgraph group_ui["UI"]
  node_layout["Shell<br/>blade layout<br/>[app.blade.php]"]
  node_pagesauth["Auth pages<br/>blade pages<br/>[login.blade.php]"]
  node_pagesmain["Main pages<br/>blade pages<br/>[home.blade.php]"]
  node_pagesmanage["Manage pages<br/>blade pages<br/>[user.blade.php]"]
  node_pagesprints["Prints<br/>blade templates<br/>[dummy.blade.php]"]
  node_pageserrors["Errors<br/>blade pages<br/>[404.blade.php]"]
  node_assets["Assets<br/>frontend bundle<br/>[app.js]"]
end

subgraph group_data["Data"]
  node_migrations["Migrations<br/>schema history"]
  node_seeders["Seeders<br/>initial data"]
  node_validation["Validation<br/>locale messages<br/>[validation.php]"]
  node_pwa["PWA public<br/>public assets<br/>[manifest.json]"]
end

subgraph group_config["Config"]
  node_access["Access config<br/>auth config<br/>[permissions.php]"]
end

node_htaccess -->|"rewrite to"| node_index
node_index -->|"boot"| node_framework
node_cli -->|"dispatch"| node_console
node_framework -->|"routes"| node_router
node_framework -->|"uses"| node_db
node_framework -->|"shares"| node_helpers
node_router -->|"serves"| node_pagesauth
node_router -->|"serves"| node_pagesmain
node_router -->|"serves"| node_pagesmanage
node_router -->|"serves"| node_pagesprints
node_router -->|"falls back to"| node_pageserrors
node_router -->|"exposes"| node_searchapi
node_console -->|"runs"| node_installer
node_console -->|"runs"| node_devtool
node_console -->|"applies"| node_migrations
node_console -->|"seeds"| node_seeders
node_pagesmain -->|"wraps with"| node_layout
node_pagesauth -->|"wraps with"| node_layout
node_pagesmanage -->|"wraps with"| node_layout
node_pagesprints -->|"formats with"| node_layout
node_layout -->|"loads"| node_assets
node_assets -->|"ships with"| node_pwa
node_db -->|"evolves via"| node_migrations
node_db -->|"initializes via"| node_seeders
node_validation -->|"supports"| node_framework
node_access -->|"guards"| node_pagesmanage
node_access -->|"guards"| node_pagesmain

click node_htaccess "https://github.com/softdevhassan/minilara/blob/main/.htaccess"
click node_index "https://github.com/softdevhassan/minilara/blob/main/index.php"
click node_cli "https://github.com/softdevhassan/minilara/tree/main/bin/minilara"
click node_framework "https://github.com/softdevhassan/minilara/blob/main/app/core/Framework.php"
click node_router "https://github.com/softdevhassan/minilara/blob/main/app/core/Router.php"
click node_db "https://github.com/softdevhassan/minilara/blob/main/app/core/DB.php"
click node_console "https://github.com/softdevhassan/minilara/blob/main/app/core/Console.php"
click node_installer "https://github.com/softdevhassan/minilara/blob/main/app/core/Installer.php"
click node_devtool "https://github.com/softdevhassan/minilara/blob/main/app/core/DevTool.php"
click node_helpers "https://github.com/softdevhassan/minilara/blob/main/app/core/functions.php"
click node_searchapi "https://github.com/softdevhassan/minilara/blob/main/app/api/search.php"
click node_layout "https://github.com/softdevhassan/minilara/blob/main/app/src/layout/app.blade.php"
click node_pagesauth "https://github.com/softdevhassan/minilara/blob/main/app/src/pages/auth/login.blade.php"
click node_pagesmain "https://github.com/softdevhassan/minilara/blob/main/app/src/pages/main/home.blade.php"
click node_pagesmanage "https://github.com/softdevhassan/minilara/blob/main/app/src/pages/manage/user.blade.php"
click node_pagesprints "https://github.com/softdevhassan/minilara/blob/main/app/src/pages/prints/reports/dummy.blade.php"
click node_pageserrors "https://github.com/softdevhassan/minilara/blob/main/app/src/pages/errors/404.blade.php"
click node_assets "https://github.com/softdevhassan/minilara/blob/main/app/src/assets/js/app.js"
click node_migrations "https://github.com/softdevhassan/minilara/blob/main/app/database/migrations/2023_01_01_000001_create_users_table.php"
click node_seeders "https://github.com/softdevhassan/minilara/blob/main/app/database/seeds/AdminUserSeeder.php"
click node_validation "https://github.com/softdevhassan/minilara/blob/main/app/lang/en/validation.php"
click node_pwa "https://github.com/softdevhassan/minilara/blob/main/app/public/manifest.json"
click node_access "https://github.com/softdevhassan/minilara/blob/main/app/config/permissions.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_htaccess,node_index,node_cli toneBlue
class node_framework,node_router,node_db,node_console,node_installer,node_devtool,node_helpers,node_searchapi toneAmber
class node_layout,node_pagesauth,node_pagesmain,node_pagesmanage,node_pagesprints,node_pageserrors,node_assets toneMint
class node_migrations,node_seeders,node_validation,node_pwa toneRose
class node_access toneIndigo
```

## Components

### Entrypoints

Web and CLI runtime entry paths

- [.htaccess](https://github.com/softdevhassan/minilara/blob/main/.htaccess): web rewrite · Rewrites incoming web requests to the front controller · `.htaccess`
- [index.php](https://github.com/softdevhassan/minilara/blob/main/index.php): web entry · HTTP front controller · `index.php`
- [minilara](https://github.com/softdevhassan/minilara/tree/main/bin/minilara): cli entry · Command-line entrypoint · `bin/minilara`

### Core

Framework bootstrap, routing, console, and shared services

- [Framework](https://github.com/softdevhassan/minilara/blob/main/app/core/Framework.php): bootstrap · Bootstraps the app and coordinates runtime services · `app/core/Framework.php`
- [Router](https://github.com/softdevhassan/minilara/blob/main/app/core/Router.php): routing · Matches requests to pages or handlers · `app/core/Router.php`
- [DB](https://github.com/softdevhassan/minilara/blob/main/app/core/DB.php): database · Database access wrapper · `app/core/DB.php`
- [Console](https://github.com/softdevhassan/minilara/blob/main/app/core/Console.php): cli runtime · Dispatches framework commands · `app/core/Console.php`
- [Installer](https://github.com/softdevhassan/minilara/blob/main/app/core/Installer.php): setup tools · Initial setup and installation flow · `app/core/Installer.php`
- [DevTool](https://github.com/softdevhassan/minilara/blob/main/app/core/DevTool.php): dev tools · Developer utilities and local tooling · `app/core/DevTool.php`
- [Helpers](https://github.com/softdevhassan/minilara/blob/main/app/core/functions.php): shared functions · Common helper functions used across the app · `app/core/functions.php`
- [Search API](https://github.com/softdevhassan/minilara/blob/main/app/api/search.php): api endpoint · Standalone search endpoint · `app/api/search.php`

### UI

Blade templates and frontend assets

- [Shell](https://github.com/softdevhassan/minilara/blob/main/app/src/layout/app.blade.php): blade layout · Shared application shell and navigation · `app/src/layout/app.blade.php`
- [Auth pages](https://github.com/softdevhassan/minilara/blob/main/app/src/pages/auth/login.blade.php): blade pages · Login and authentication screens · `app/src/pages/auth/login.blade.php`
- [Main pages](https://github.com/softdevhassan/minilara/blob/main/app/src/pages/main/home.blade.php): blade pages · Home, profile, settings, and users screens · `app/src/pages/main/home.blade.php`
- [Manage pages](https://github.com/softdevhassan/minilara/blob/main/app/src/pages/manage/user.blade.php): blade pages · Administrative management screens · `app/src/pages/manage/user.blade.php`
- [Prints](https://github.com/softdevhassan/minilara/blob/main/app/src/pages/prints/reports/dummy.blade.php): blade templates · Report and document rendering templates · `app/src/pages/prints/reports/dummy.blade.php`
- [Errors](https://github.com/softdevhassan/minilara/blob/main/app/src/pages/errors/404.blade.php): blade pages · HTTP error screens · `app/src/pages/errors/404.blade.php`
- [Assets](https://github.com/softdevhassan/minilara/blob/main/app/src/assets/js/app.js): frontend bundle · CSS, JS, and Vite-built frontend assets · `app/src/assets/js/app.js`

### Data

Schema, seeds, localization, and public delivery assets

- [Migrations](https://github.com/softdevhassan/minilara/blob/main/app/database/migrations/2023_01_01_000001_create_users_table.php): schema history · Database schema evolution scripts · `app/database/migrations/2023_01_01_000001_create_users_table.php`
- [Seeders](https://github.com/softdevhassan/minilara/blob/main/app/database/seeds/AdminUserSeeder.php): initial data · Bootstrap data for installation and admin access · `app/database/seeds/AdminUserSeeder.php`
- [Validation](https://github.com/softdevhassan/minilara/blob/main/app/lang/en/validation.php): locale messages · Localized validation strings · `app/lang/en/validation.php`
- [PWA public](https://github.com/softdevhassan/minilara/blob/main/app/public/manifest.json): public assets · Manifest, service worker, and published static assets · `app/public/manifest.json`

### Config

App feature and permission configuration

- [Access config](https://github.com/softdevhassan/minilara/blob/main/app/config/permissions.php): auth config · Module and permission definitions · `app/config/permissions.php`

## Connections

- .htaccess → index.php: rewrite to · Web requests are routed to the front controller
- index.php → Framework: boot · HTTP entrypoint initializes the framework
- minilara → Console: dispatch · CLI entrypoint sends commands to the console subsystem
- Framework → Router: routes · Framework delegates request matching
- Framework → DB: uses · Framework accesses the database layer
- Framework → Helpers: shares · Framework and app code rely on common helpers
- Router → Auth pages: serves · Routes can resolve to auth pages
- Router → Main pages: serves · Routes can resolve to main screens
- Router → Manage pages: serves · Routes can resolve to management screens
- Router → Prints: serves · Routes can resolve to print templates
- Router → Errors: falls back to · Router can surface error pages
- Router → Search API: exposes · Routing also exposes a direct search API endpoint
- Console → Installer: runs · Console powers setup workflows
- Console → DevTool: runs · Console powers developer utilities
- Console → Migrations: applies · CLI is used to run schema changes
- Console → Seeders: seeds · CLI initializes baseline data
- Main pages → Shell: wraps with · Main screens share the application shell
- Auth pages → Shell: wraps with · Auth screens use the shared layout
- Manage pages → Shell: wraps with · Management screens use the shared layout
- Prints → Shell: formats with · Print templates still share common structure where needed
- Shell → Assets: loads · Shared layout pulls in frontend assets
- Assets → PWA public: ships with · Built frontend is delivered with public static assets
- DB → Migrations: evolves via · Database schema is defined by migrations
- DB → Seeders: initializes via · Database starts with seeded records
- Validation → Framework: supports · Validation messages support request handling
- Access config → Manage pages: guards · Permissions govern admin-facing screens
- Access config → Main pages: guards · Permissions govern authenticated app screens
