# shakilahmedbhuiyan/crown architecture

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

- Interactive diagram: https://gitdiagram.com/shakilahmedbhuiyan/crown
- Repository: https://github.com/shakilahmedbhuiyan/crown

## Overview

1. This is a Laravel monolith built around server-rendered Blade views plus Livewire components. The app is not a pure SPA; most user interaction is handled by Laravel HTTP routes, Blade layouts, and Livewire-backed partial updates.

2. The application has two clear UI zones: a public/guest storefront and an authenticated admin dashboard. Guest pages live under `app/Http/Livewire/Guest` and `resources/views/livewire/guest`, while admin pages live under `app/Http/Livewire/Admin` and `resources/views/livewire/admin`.

3. The domain model centers on a menu/catalog structure: `FoodCategory`, `FoodItems`, `Attribute`, `SKU`, `CategoryNote`, and `ZipCode`. These are persisted via Eloquent models and migrations, and they appear to back the admin CRUD screens and the public browsing experience.

4. The admin subsystem is implemented mostly with Livewire “page” components: category management, item create/edit/index flows, attribute tables, SKU creation, zip-code management, and an API page. The admin UI also has reusable Livewire components for header and sidebar navigation.

5. The guest-facing subsystem is focused on discovery and navigation: home, menu, category-product, and contact pages, plus shared components such as hero, navigation, category sidebar, product cards, collections, newsletter, and cart button. This suggests a content/catalog experience rather than a transaction-heavy checkout flow.

6. Authentication and account management are handled by Jetstream and Fortify. The `app/Actions/Fortify` and `app/Actions/Jetstream` classes cover user creation, password validation/reset/update, profile updates, and account deletion, while the `resources/views/auth` and `resources/views/profile` folders provide the corresponding screens.

7. Access control is enforced by middleware and role checks. In addition to standard Laravel middleware, there are custom `isAdminMiddleware`, `isUserMiddleware`, and `CheckAccessToken`, which indicates separate authorization paths for dashboard users and token-based API access.

8. There is an API and integration boundary around POS-related functionality. `PosApi` is a model, `config/pos-api.php` holds its settings, and the admin includes an API page. This points to an external point-of-sale integration or credential management surface inside the app.

9. Several small controllers handle cross-cutting public features: `GoogleController` for Google-related authentication or linkage, `SitemapGeneratorController` for SEO sitemap output, and `EulaServiceController` for serving policy/terms/EULA content from markdown sources.

10. Storage and assets are a major part of the runtime layout. Public images and uploaded files live under `storage/app/public` and are exposed through `public/storage`, while the frontend assets are built with Laravel Mix/Vite-era tooling (`webpack.mix.js`, `resources/js`, `resources/css`, `public/js`, `public/css`, `tailwind.config.js`).

11. The app uses standard Laravel infrastructure for persistence and background/runtime services: migrations and seeders define the schema and initial admin account, session and cache configuration are explicit, and the test suite focuses heavily on auth and Jetstream flows. This suggests a conventional Laravel deployment with authenticated web requests, database-backed state, and server-side rendering as the primary architecture.

Main entry points: [`app/Http/Livewire/Admin/Pages`](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Admin/Pages) (Admin pages), [`routes/web.php`](https://github.com/shakilahmedbhuiyan/crown/blob/master/routes/web.php) (Routes), [`app/Http/Livewire/Guest/Pages`](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Guest/Pages) (Guest pages), [`app/Models`](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Models) (Catalog models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_ui["UI zones"]
  node_n_guest_pages["Guest pages<br/>livewire pages"]
  node_n_guest_components["Guest comps<br/>livewire ui"]
  node_n_admin_pages["Admin pages<br/>livewire pages"]
  node_n_admin_components["Admin comps<br/>livewire ui"]
  node_n_layouts["Layouts<br/>blade shells"]
  node_n_auth_views["Auth screens<br/>blade auth"]
  node_n_markdown["Policy content<br/>markdown pages"]
end

subgraph group_g_domain["Domain & data"]
  node_n_catalog_models[("Catalog models<br/>eloquent domain")]
  node_n_pos_api_model[("POS API<br/>integration model<br/>[PosApi.php]")]
  node_n_seeders["Seeders<br/>database bootstrap"]
end

subgraph group_g_platform["Platform"]
  node_n_routes["Routes<br/>http routing<br/>[web.php]"]
  node_n_fortify_actions["Fortify actions<br/>auth workflows"]
  node_n_jetstream_actions["Jetstream actions<br/>account workflows"]
  node_n_controllers["Controllers"]
  node_n_middleware["Middleware<br/>request guards"]
  node_n_providers["Providers<br/>bootstrap wiring"]
  node_n_views_api["API views<br/>blade api"]
  node_n_storage_assets[("Storage assets<br/>files and uploads")]
end

node_n_routes -->|"serves"| node_n_guest_pages
node_n_routes -->|"serves"| node_n_admin_pages
node_n_routes -->|"invokes"| node_n_controllers
node_n_guest_pages -->|"composes"| node_n_guest_components
node_n_guest_pages -->|"wraps"| node_n_layouts
node_n_admin_pages -->|"composes"| node_n_admin_components
node_n_admin_pages -->|"wraps"| node_n_layouts
node_n_auth_views -->|"backed by"| node_n_fortify_actions
node_n_auth_views -->|"backed by"| node_n_jetstream_actions
node_n_controllers -->|"renders"| node_n_markdown
node_n_admin_pages -->|"manages"| node_n_catalog_models
node_n_guest_pages -->|"browses"| node_n_catalog_models
node_n_catalog_models -->|"uses media"| node_n_storage_assets
node_n_pos_api_model -->|"configured by"| node_n_admin_pages
node_n_middleware -->|"protects"| node_n_admin_pages
node_n_middleware -->|"filters"| node_n_routes
node_n_providers -->|"registers"| node_n_fortify_actions
node_n_providers -->|"registers"| node_n_jetstream_actions
node_n_providers -->|"boots"| node_n_routes
node_n_seeders -->|"seeds"| node_n_catalog_models
node_n_seeders -.->|"supports"| node_n_auth_views
node_n_views_api -->|"manages"| node_n_pos_api_model

click node_n_routes "https://github.com/shakilahmedbhuiyan/crown/blob/master/routes/web.php"
click node_n_guest_pages "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Guest/Pages"
click node_n_guest_components "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Guest/Components"
click node_n_admin_pages "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Admin/Pages"
click node_n_admin_components "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Admin/Components"
click node_n_layouts "https://github.com/shakilahmedbhuiyan/crown/tree/master/resources/views/layouts"
click node_n_auth_views "https://github.com/shakilahmedbhuiyan/crown/tree/master/resources/views/auth"
click node_n_markdown "https://github.com/shakilahmedbhuiyan/crown/tree/master/resources/markdown"
click node_n_catalog_models "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Models"
click node_n_pos_api_model "https://github.com/shakilahmedbhuiyan/crown/blob/master/app/Models/PosApi.php"
click node_n_fortify_actions "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Actions/Fortify"
click node_n_jetstream_actions "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Actions/Jetstream"
click node_n_controllers "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Controllers"
click node_n_middleware "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Middleware"
click node_n_providers "https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Providers"
click node_n_views_api "https://github.com/shakilahmedbhuiyan/crown/tree/master/resources/views/api"
click node_n_storage_assets "https://github.com/shakilahmedbhuiyan/crown/tree/master/storage/app/public"
click node_n_seeders "https://github.com/shakilahmedbhuiyan/crown/tree/master/database/seeders"

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_n_guest_pages,node_n_guest_components,node_n_admin_pages,node_n_admin_components,node_n_layouts,node_n_auth_views,node_n_markdown toneBlue
class node_n_catalog_models,node_n_pos_api_model,node_n_seeders toneAmber
class node_n_routes,node_n_fortify_actions,node_n_jetstream_actions,node_n_controllers,node_n_middleware,node_n_providers,node_n_views_api,node_n_storage_assets toneMint
```

## Components

### UI zones

Server-rendered guest and admin experiences built with Blade and Livewire.

- [Guest pages](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Guest/Pages): livewire pages · Public storefront screens for home, menu, category browsing, and contact. · `app/Http/Livewire/Guest/Pages`
- [Guest comps](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Guest/Components): livewire ui · Reusable storefront pieces like navigation, hero, product cards, cart button, and sidebar. · `app/Http/Livewire/Guest/Components`
- [Admin pages](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Admin/Pages): livewire pages · Authenticated dashboard flows for categories, items, attributes, SKUs, zip codes, and API settings. · `app/Http/Livewire/Admin/Pages`
- [Admin comps](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Livewire/Admin/Components): livewire ui · Shared dashboard chrome such as header, sidebar, and table widgets. · `app/Http/Livewire/Admin/Components`
- [Layouts](https://github.com/shakilahmedbhuiyan/crown/tree/master/resources/views/layouts): blade shells · App, guest, and dashboard layouts that wrap the server-rendered views. · `resources/views/layouts`
- [Auth screens](https://github.com/shakilahmedbhuiyan/crown/tree/master/resources/views/auth): blade auth · Login, registration, password reset, verification, and profile screens. · `resources/views/auth`
- [Policy content](https://github.com/shakilahmedbhuiyan/crown/tree/master/resources/markdown): markdown pages · EULA, terms, and policy content rendered into Blade views. · `resources/markdown`

### Domain & data

Catalog, auth, and integration models plus persistence.

- [Catalog models](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Models): eloquent domain · FoodCategory, FoodItems, Attribute, SKU, CategoryNote, and ZipCode domain records. · `app/Models`
- [POS API](https://github.com/shakilahmedbhuiyan/crown/blob/master/app/Models/PosApi.php): integration model · POS integration credential/state model and related config surface. · `app/Models/PosApi.php`
- [Seeders](https://github.com/shakilahmedbhuiyan/crown/tree/master/database/seeders): database bootstrap · Initial data loading, including the admin user seed. · `database/seeders`

### Platform

Laravel runtime, security, routing, and shared infrastructure.

- [Routes](https://github.com/shakilahmedbhuiyan/crown/blob/master/routes/web.php): http routing · Web and API route entrypoints for the application. · `routes/web.php`
- [Fortify actions](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Actions/Fortify): auth workflows · User creation, password rules, reset, update, and profile actions. · `app/Actions/Fortify`
- [Jetstream actions](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Actions/Jetstream): account workflows · Account deletion and Jetstream-backed profile lifecycle behavior. · `app/Actions/Jetstream`
- [Controllers](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Controllers): http controllers · Cross-cutting controllers for Google linkage, sitemap output, and EULA serving. · `app/Http/Controllers`
- [Middleware](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Http/Middleware): request guards · Custom access checks plus standard auth, CSRF, and request filters. · `app/Http/Middleware`
- [Providers](https://github.com/shakilahmedbhuiyan/crown/tree/master/app/Providers): bootstrap wiring · Service providers that register Fortify, Jetstream, routes, and app services. · `app/Providers`
- [API views](https://github.com/shakilahmedbhuiyan/crown/tree/master/resources/views/api): blade api · API token management and API-related dashboard screens. · `resources/views/api`
- [Storage assets](https://github.com/shakilahmedbhuiyan/crown/tree/master/storage/app/public): files and uploads · Public images, profile photos, and other persisted assets exposed through storage. · `storage/app/public`

## Connections

- Routes → Guest pages: serves · Web routes mount the public Livewire pages.
- Routes → Admin pages: serves · Dashboard routes mount authenticated admin pages.
- Routes → Controllers: invokes · Specific endpoints delegate to controllers for sitemap, policy, and Google flows.
- Guest pages → Guest comps: composes · Guest pages assemble shared storefront widgets.
- Guest pages → Layouts: wraps · Guest screens render inside the guest/application layouts.
- Admin pages → Admin comps: composes · Admin pages reuse dashboard chrome and table widgets.
- Admin pages → Layouts: wraps · Admin screens render inside the dashboard layout.
- Auth screens → Fortify actions: backed by · Auth screens are powered by Fortify account workflows.
- Auth screens → Jetstream actions: backed by · Profile and account management screens rely on Jetstream actions.
- Controllers → Policy content: renders · Policy and EULA content is sourced from markdown files.
- Admin pages → Catalog models: manages · CRUD pages operate on the catalog and inventory models.
- Guest pages → Catalog models: browses · Public browsing pages read the catalog structure.
- Catalog models → Storage assets: uses media · Catalog records are associated with uploaded images and public assets.
- POS API → Admin pages: configured by · The API admin page manages POS integration state.
- Middleware → Admin pages: protects · Admin access is gated by custom role and token middleware.
- Middleware → Routes: filters · Middleware is applied at the HTTP kernel and route boundary.
- Providers → Fortify actions: registers · Fortify service provider wires auth actions into the app.
- Providers → Jetstream actions: registers · Jetstream service provider wires account management behavior.
- Providers → Routes: boots · Route and application providers initialize request handling.
- Seeders → Catalog models: seeds · Seeders initialize database state for the core domain.
- Seeders → Auth screens: supports · Seed data includes the initial admin user used by auth flows.
- API views → POS API: manages · API token screens expose the POS integration surface.
