# simplemarkcoin/laraapp architecture

> Architecture diagram of the GitHub repository simplemarkcoin/laraapp, 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/simplemarkcoin/laraapp
- Repository: https://github.com/simplemarkcoin/laraapp

## Overview

1. **What this repo is**
   - This is a Laravel-based trading/investment platform with three main experiences: a public marketing site, a customer dashboard, and an admin back office.
   - The domain model centers on deposits, withdrawals, investment plans, subscriptions, KYC, referrals, signals, and trading accounts.

2. **Request entry and route boundaries**
   - Routing is split by audience: `routes/web.php` for public pages, `routes/user/web.php` for customer flows, `routes/admin/web.php` for admin flows, plus `routes/api.php`, `routes/botman.php`, and `routes/channels.php`.
   - That separation is reinforced by middleware such as admin checks, IP blocking, KYC gating, and two-factor verification.

3. **Presentation layer**
   - The app uses Blade views heavily, with a large number of page-specific templates under `resources/views`.
   - There are two UI patterns: traditional server-rendered pages and Livewire-driven interactive components in `app/Http/Livewire` with matching views under `resources/views/livewire`.
   - Theme assets are substantial: `themes/dashly` appears to be the primary dashboard theme, while `dash/` and `temp/custom/` hold additional/static asset bundles and legacy template material.

4. **Authentication and account security**
   - Auth is handled with Laravel Fortify/Jetstream, extended by custom controllers for login, registration, password reset, profile updates, and account deletion.
   - Security features include two-factor auth, password confirmation, email verification, browser-session management, and a custom old-password rule.
   - Admin authentication is separated from user authentication, with its own login/reset controllers and redirect middleware.

5. **Core domain data**
   - The Eloquent models show the business objects the app is built around: `User`, `Admin`, `Deposit`, `Withdrawal`, `Kyc`, `Plans`, `User_plans`, `CryptoAccount`, `Asset`, `Notification`, `Settings`, `Theme`, `Task`, `Ipaddress`, and related transaction tables.
   - The domain suggests a ledger-like flow where user actions create transactions, which then drive status updates, notifications, and admin review screens.

6. **Customer workflows**
   - Customer controllers cover deposits, withdrawals, transfers, profile management, subscriptions, memberships/courses, trading/investment plans, crypto exchange/payment flows, social login, and verification.
   - Livewire components such as new deposit, crypto payment, crypto withdrawal, investment plan selection, and signal subscription indicate multi-step, interactive customer journeys.
   - KYC is a gate in the user journey, enforced by middleware and application requests.

7. **Admin back office**
   - Admin controllers are organized around operational domains: managing users, admins, deposits, withdrawals, assets, plans, subscriptions, KYC applications, IP addresses, topups, trading payments, and cache clearing.
   - There are dedicated admin settings areas for app configuration, payment methods, referral rules, subscription rules, and currency configuration.
   - Admin views mirror these operations with lists, detail pages, and action screens for approval/review workflows.

8. **Payments and external financial services**
   - The repo integrates multiple gateways and finance APIs through config files and traits: Paystack, Flutterwave, CoinPayment/CoinPayments, Binance API, and BitPay-related config.
   - Payment-related controllers and Livewire components split by method, which suggests the payment adapter is a major architectural boundary.
   - These integrations feed deposit, withdrawal, top-up, and crypto transaction flows.

9. **Signals, chat, and notifications**
   - There is a Botman chatbot layer with its own controller and conversation class, likely used for guided signal or support interactions.
   - Notifications are implemented through Laravel notifications and mailables for registration, welcome, deposit/withdrawal status, ROI updates, two-factor codes, and forex signals.
   - This creates an event-driven edge around the core transaction system: user/admin actions trigger emails and app notifications.

10. **Background/automation and platform services**
    - `AutoTaskController`, queued mail/notification classes, and console kernel support suggest scheduled or asynchronous automation for payouts, ROI, end-of-plan handling, and similar operational tasks.
    - Broadcasting and queue configs are present, so the app is prepared for async delivery and possibly real-time updates even if the exact channels are modestly used.

11. **Persistence and data import**
    - The app uses standard Eloquent persistence against a relational database; `app/Imports/UsersImport.php` indicates bulk user import.
    - Update SQL scripts under `update/` and the presence of many model classes imply schema-driven business data with periodic versioned database updates.

12. **Cross-cutting structure**
    - Providers such as `SettingsServiceProvider`, `FortifyServiceProvider`, `JetstreamServiceProvider`, and `TelescopeServiceProvider` wire framework services into the app.
    - Middleware and observers encapsulate cross-cutting rules like admin access, KYC enforcement, IP blocking, and user lifecycle behavior.
    - The overall architecture is a classic Laravel monolith with strong feature-based separation by audience and business function, plus a heavy theme layer for presentation.

Main entry points: [`app/Http/Controllers/Admin`](https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers/Admin) (Admin controllers), [`app/Models`](https://github.com/simplemarkcoin/laraapp/tree/master/app/Models) (Models), [`app/Http/Controllers/User`](https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers/User) (User controllers), [`resources/views`](https://github.com/simplemarkcoin/laraapp/tree/master/resources/views) (Blade views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["Routes"]
  node_routes_public["Public routes<br/>route group<br/>[web.php]"]
  node_routes_user["User routes<br/>route group<br/>[web.php]"]
  node_routes_admin["Admin routes<br/>route group<br/>[web.php]"]
  node_routes_api["API routes<br/>route group<br/>[api.php]"]
  node_routes_bot["Bot routes<br/>route group<br/>[botman.php]"]
  node_routes_channels["Broadcast channels<br/>route group<br/>[channels.php]"]
end

subgraph group_http["HTTP layer"]
  node_http_public["Public controllers"]
  node_http_user["User controllers"]
  node_http_admin["Admin controllers"]
  node_http_auth["Auth actions"]
  node_http_middleware["Middleware<br/>guards"]
  node_http_livewire["Livewire comps<br/>interactive ui"]
end

subgraph group_domain["Domain"]
  node_domain_models[("Models<br/>data model")]
  node_domain_rules["Rules & observers<br/>domain logic"]
  node_domain_repo["User repo"]
  node_domain_imports["Bulk import<br/>data import<br/>[UsersImport.php]"]
end

subgraph group_ui["UI layer"]
  node_ui_views["Blade views<br/>templates"]
  node_ui_livewire_views["Livewire views<br/>templates"]
  node_ui_themes["Dashly theme<br/>assets/theme"]
  node_ui_legacy_assets["Legacy assets<br/>static assets"]
end

subgraph group_services["Services"]
  node_services_integrations["Payments & APIs<br/>integrations"]
  node_services_notifications["Mail & notifications<br/>messaging"]
  node_services_bot["Botman layer<br/>chatbot"]
  node_services_tasks["Automation<br/>scheduler<br/>[Kernel.php]"]
  node_services_providers["Providers<br/>bootstrap wiring"]
end

node_routes_public -->|"dispatches"| node_http_public
node_routes_user -->|"dispatches"| node_http_user
node_routes_admin -->|"dispatches"| node_http_admin
node_routes_api -->|"auth/API"| node_http_auth
node_routes_bot -->|"dispatches"| node_services_bot
node_routes_channels -->|"broadcast auth"| node_services_providers
node_http_public -->|"renders"| node_ui_views
node_http_user -->|"renders"| node_ui_views
node_http_admin -->|"renders"| node_ui_views
node_http_user -->|"uses"| node_http_livewire
node_http_admin -->|"uses"| node_http_livewire
node_http_auth -->|"wired by"| node_services_providers
node_http_middleware -->|"guards"| node_routes_user
node_http_middleware -->|"guards"| node_routes_admin
node_http_user -->|"mutates"| node_domain_models
node_http_admin -->|"reviews"| node_domain_models
node_http_admin -->|"applies"| node_domain_rules
node_domain_repo -->|"accesses"| node_domain_models
node_domain_imports -->|"loads"| node_domain_models
node_ui_livewire_views -->|"pairs with"| node_http_livewire
node_ui_themes -->|"skins"| node_ui_views
node_ui_legacy_assets -->|"supports"| node_ui_views
node_services_integrations -->|"supports"| node_http_user
node_services_integrations -->|"supports"| node_http_admin
node_services_notifications -->|"emits for"| node_domain_models
node_services_tasks -->|"automates"| node_domain_models
node_services_providers -->|"boots"| node_http_auth
node_services_providers -->|"registers"| node_http_middleware
node_services_bot -->|"notifies"| node_services_notifications
node_http_livewire -->|"calls"| node_services_integrations

click node_routes_public "https://github.com/simplemarkcoin/laraapp/blob/master/routes/web.php"
click node_routes_user "https://github.com/simplemarkcoin/laraapp/blob/master/routes/user/web.php"
click node_routes_admin "https://github.com/simplemarkcoin/laraapp/blob/master/routes/admin/web.php"
click node_routes_api "https://github.com/simplemarkcoin/laraapp/blob/master/routes/api.php"
click node_routes_bot "https://github.com/simplemarkcoin/laraapp/blob/master/routes/botman.php"
click node_routes_channels "https://github.com/simplemarkcoin/laraapp/blob/master/routes/channels.php"
click node_http_public "https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers"
click node_http_user "https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers/User"
click node_http_admin "https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers/Admin"
click node_http_auth "https://github.com/simplemarkcoin/laraapp/tree/master/app/Actions"
click node_http_middleware "https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Middleware"
click node_http_livewire "https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Livewire"
click node_domain_models "https://github.com/simplemarkcoin/laraapp/tree/master/app/Models"
click node_domain_rules "https://github.com/simplemarkcoin/laraapp/tree/master/app/Rules"
click node_domain_repo "https://github.com/simplemarkcoin/laraapp/tree/master/app/Repositories/User"
click node_domain_imports "https://github.com/simplemarkcoin/laraapp/blob/master/app/Imports/UsersImport.php"
click node_ui_views "https://github.com/simplemarkcoin/laraapp/tree/master/resources/views"
click node_ui_livewire_views "https://github.com/simplemarkcoin/laraapp/tree/master/resources/views/livewire"
click node_ui_themes "https://github.com/simplemarkcoin/laraapp/tree/master/themes/dashly"
click node_ui_legacy_assets "https://github.com/simplemarkcoin/laraapp/tree/master/dash"
click node_services_integrations "https://github.com/simplemarkcoin/laraapp/tree/master/config"
click node_services_notifications "https://github.com/simplemarkcoin/laraapp/tree/master/app/Mail"
click node_services_bot "https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers/Botman"
click node_services_tasks "https://github.com/simplemarkcoin/laraapp/blob/master/app/Console/Kernel.php"
click node_services_providers "https://github.com/simplemarkcoin/laraapp/tree/master/app/Providers"

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_routes_public,node_routes_user,node_routes_admin,node_routes_api,node_routes_bot,node_routes_channels toneBlue
class node_http_public,node_http_user,node_http_admin,node_http_auth,node_http_middleware,node_http_livewire toneAmber
class node_domain_models,node_domain_rules,node_domain_repo,node_domain_imports toneMint
class node_ui_views,node_ui_livewire_views,node_ui_themes,node_ui_legacy_assets toneRose
class node_services_integrations,node_services_notifications,node_services_bot,node_services_tasks,node_services_providers toneIndigo
```

## Components

### Routes

Audience-separated HTTP and realtime entrypoints.

- [Public routes](https://github.com/simplemarkcoin/laraapp/blob/master/routes/web.php): route group · Public marketing and guest-facing web routes. · `routes/web.php`
- [User routes](https://github.com/simplemarkcoin/laraapp/blob/master/routes/user/web.php): route group · Customer dashboard and account flows. · `routes/user/web.php`
- [Admin routes](https://github.com/simplemarkcoin/laraapp/blob/master/routes/admin/web.php): route group · Back-office administration routes. · `routes/admin/web.php`
- [API routes](https://github.com/simplemarkcoin/laraapp/blob/master/routes/api.php): route group · API endpoints and token-related access. · `routes/api.php`
- [Bot routes](https://github.com/simplemarkcoin/laraapp/blob/master/routes/botman.php): route group · Botman webhook and conversation routes. · `routes/botman.php`
- [Broadcast channels](https://github.com/simplemarkcoin/laraapp/blob/master/routes/channels.php): route group · Broadcasting channel authorization rules. · `routes/channels.php`

### HTTP layer

Controllers, middleware, requests, and auth actions.

- [Public controllers](https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers): controllers · Home, front page, and general site controllers. · `app/Http/Controllers`
- [User controllers](https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers/User): controllers · Customer actions for deposits, withdrawals, transfers, subscriptions, profiles, verification, and exchange/payment flows. · `app/Http/Controllers/User`
- [Admin controllers](https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers/Admin): controllers · Operational controllers for users, finance, plans, KYC, settings, and trading admin. · `app/Http/Controllers/Admin`
- [Auth actions](https://github.com/simplemarkcoin/laraapp/tree/master/app/Actions): auth actions · Fortify/Jetstream hooks for create, update, reset, profile, and delete flows. · `app/Actions`
- [Middleware](https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Middleware): guards · Admin auth, KYC gating, IP blocking, 2FA, and redirect guards. · `app/Http/Middleware`
- [Livewire comps](https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Livewire): interactive ui · Interactive user/admin workflows for deposits, crypto, plans, signals, and back-office tools. · `app/Http/Livewire`

### Domain

Eloquent models, repositories, rules, observers, and imports.

- [Models](https://github.com/simplemarkcoin/laraapp/tree/master/app/Models): data model · Core business entities such as users, admins, deposits, withdrawals, plans, KYC, assets, notifications, and settings. · `app/Models`
- [Rules & observers](https://github.com/simplemarkcoin/laraapp/tree/master/app/Rules): domain logic · Cross-cutting validation and lifecycle behavior. · `app/Rules`
- [User repo](https://github.com/simplemarkcoin/laraapp/tree/master/app/Repositories/User): repository · Repository abstraction and implementation for user data access. · `app/Repositories/User`
- [Bulk import](https://github.com/simplemarkcoin/laraapp/blob/master/app/Imports/UsersImport.php): data import · User import pipeline for bulk population. · `app/Imports/UsersImport.php`

### UI layer

Blade views, Livewire components, layouts, and themes.

- [Blade views](https://github.com/simplemarkcoin/laraapp/tree/master/resources/views): templates · Server-rendered views for public, user, admin, auth, email, and profile experiences. · `resources/views`
- [Livewire views](https://github.com/simplemarkcoin/laraapp/tree/master/resources/views/livewire): templates · Matching Blade templates for Livewire components. · `resources/views/livewire`
- [Dashly theme](https://github.com/simplemarkcoin/laraapp/tree/master/themes/dashly): assets/theme · Primary dashboard theme assets and templates. · `themes/dashly`
- [Legacy assets](https://github.com/simplemarkcoin/laraapp/tree/master/dash): static assets · Additional dashboard and legacy frontend bundles. · `dash`

### Services

Integrations, mail, notifications, automation, and providers.

- [Payments & APIs](https://github.com/simplemarkcoin/laraapp/tree/master/config): integrations · Gateway traits and config for payment and crypto integrations. · `config`
- [Mail & notifications](https://github.com/simplemarkcoin/laraapp/tree/master/app/Mail): messaging · Mailables and notifications for deposits, withdrawals, ROI, verification, and signals. · `app/Mail`
- [Botman layer](https://github.com/simplemarkcoin/laraapp/tree/master/app/Http/Controllers/Botman): chatbot · Bot controller and conversation handling. · `app/Http/Controllers/Botman`
- [Automation](https://github.com/simplemarkcoin/laraapp/blob/master/app/Console/Kernel.php): scheduler · Console kernel and auto-task controller for scheduled or asynchronous work. · `app/Console/Kernel.php`
- [Providers](https://github.com/simplemarkcoin/laraapp/tree/master/app/Providers): bootstrap wiring · Framework bootstrapping for auth, routes, broadcasting, settings, and debugging tools. · `app/Providers`

## Connections

- Public routes → Public controllers: dispatches · Public web requests reach frontend and site controllers.
- User routes → User controllers: dispatches · Customer routes map to account and trading workflows.
- Admin routes → Admin controllers: dispatches · Admin routes map to operational controllers.
- API routes → Auth actions: auth/API · API endpoints rely on auth and token handling.
- Bot routes → Botman layer: dispatches · Bot routes enter the chatbot layer.
- Broadcast channels → Providers: broadcast auth · Channel authorization is wired through broadcasting services.
- Public controllers → Blade views: renders · Public controllers render site pages.
- User controllers → Blade views: renders · User controllers render dashboard and account pages.
- Admin controllers → Blade views: renders · Admin controllers render back-office screens.
- User controllers → Livewire comps: uses · Customer journeys use interactive Livewire components.
- Admin controllers → Livewire comps: uses · Admin tools also use Livewire for operations.
- Auth actions → Providers: wired by · Fortify and Jetstream actions are registered through providers.
- Middleware → User routes: guards · KYC, 2FA, and IP checks protect user flows.
- Middleware → Admin routes: guards · Admin access controls protect back-office routes.
- User controllers → Models: mutates · Customer actions create deposits, withdrawals, plans, and profile data.
- Admin controllers → Models: reviews · Admin actions approve and manage core records.
- Admin controllers → Rules & observers: applies · Admin operations depend on validation and lifecycle hooks.
- User repo → Models: accesses · Repository abstraction wraps user persistence.
- Bulk import → Models: loads · Bulk import populates user records.
- Livewire views → Livewire comps: pairs with · Livewire components are backed by matching views.
- Dashly theme → Blade views: skins · Theme templates and assets feed the rendered UI.
- Legacy assets → Blade views: supports · Legacy/static bundles support older frontend pages.
- Payments & APIs → User controllers: supports · Gateway integrations power deposits, withdrawals, and crypto flows.
- Payments & APIs → Admin controllers: supports · Admins configure and monitor payment adapters.
- Mail & notifications → Models: emits for · Mail and notifications follow transaction and account events.
- Automation → Models: automates · Scheduled work updates plans, ROI, payouts, and account states.
- Providers → Auth actions: boots · Providers register auth, Jetstream, Fortify, and app services.
- Providers → Middleware: registers · Providers and kernels wire middleware into the app.
- Botman layer → Mail & notifications: notifies · Bot-driven interactions can trigger messaging.
- Livewire comps → Payments & APIs: calls · Interactive payment components invoke gateway traits/config.
