# amrmohamed25/moneyfellows architecture

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

- Interactive diagram: https://gitdiagram.com/amrmohamed25/moneyfellows
- Repository: https://github.com/amrmohamed25/moneyfellows

## Overview

1. This is a single Laravel monolith, not a split frontend/backend app. The user interface is server-rendered with Blade templates, while Laravel handles routing, controllers, models, auth, scheduled jobs, and persistence.

2. The presentation layer lives in `resources/views` and `app/View/Components`, with shared layouts for guest/authenticated areas. The UI is built from Bootstrap, jQuery, and compiled assets in `resources/js`, `resources/css`, and `public/` via Laravel Mix.

3. Request handling starts at `public/index.php` and flows through Laravel middleware in `app/Http/Middleware` and `app/Http/Kernel.php`. Main web routes are in `routes/web.php`; `routes/api.php`, `routes/channels.php`, and the Jetstream API-token views exist as supporting auth/platform features rather than a separate public API.

4. Authentication and account management are provided by Jetstream/Fortify. The `app/Actions/Fortify` and `app/Actions/Jetstream` classes implement registration, password reset/update, profile updates, and account deletion. The repo also includes 2FA, email verification, browser-session management, and API token management views/tests.

5. The core business domain is the “MoneyFellows” money-circle workflow, modeled around three main entities: `Category`, `Current`, and `User`. Categories are the admin-created templates; currents are active/instance money circles derived from a category; users join currents through the `current_user` pivot table.

6. `app/Http/Controllers/CategoryController.php` and `app/Http/Controllers/CurrentsController.php` are the main application controllers. Category management is the admin boundary, while currents controller likely drives user actions such as requesting to join, editing participation timing, leaving before start, and paying.

7. The persistence layer is Eloquent models plus migrations in `database/migrations`. Besides the core tables for users, categories, currents, and the current-user pivot, the schema includes notifications, sessions, failed jobs, password resets, and personal access tokens.

8. Payments are integrated through Laravel Cashier with Stripe, as described in the README. The payment flow is rendered in the `payment.blade.php` view and is tied to the current lifecycle: once a circle starts, users can pay their fee and the system tracks payment state and due dates.

9. Notifications are first-class in the architecture. `app/Notifications/NotifyUser.php` and the `notifications` table indicate Laravel’s notification system is used to alert users about starts, due dates, and payment-related events; the app relies on persisted notifications rather than only transient UI messages.

10. Time-based business logic is handled by Laravel’s scheduler and console command layer. `app/Console/Commands/everyDay.php` plus `app/Console/Kernel.php` are used to run daily checks for payment status, apply extra fees, collect payments, and update due dates. This is a key backend subsystem, not just a helper.

11. The app’s boundary between admin and user behavior is mostly business-rule driven rather than a separate role subsystem. The README describes the admin as the creator of categories, while users consume those categories to create/join currents; both use the same authentication system and diverge in controller/view behavior.

12. Operationally, this repository looks like a standard Laravel deployment with `artisan`, `config/*`, `storage/*`, and tests in `tests/`. The test suite is heavily focused on Jetstream/Fortify authentication features, which suggests the business workflows are implemented in the app code but are less exhaustively covered than the auth layer.

Main entry points: [`app/Models/Current.php`](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Models/Current.php) (Current Model), [`app/Http/Controllers/CategoryController.php`](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Http/Controllers/CategoryController.php) (Web Controllers), [`app/Console/Commands/everyDay.php`](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Console/Commands/everyDay.php) (Scheduler Command), [`app/Http/Kernel.php`](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Http/Kernel.php) (HTTP Kernel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Web App"]
  node_n1["Front Door<br/>entrypoint<br/>[index.php]"]
  node_n2["HTTP Kernel<br/>middleware stack<br/>[Kernel.php]"]
  node_n3["Web Routes<br/>routing<br/>[web.php]"]
  node_n4["Web Controllers"]
  node_n5["Blade Views<br/>server-rendered UI"]
  node_n6["UI Assets<br/>frontend assets<br/>[app.js]"]
end

subgraph group_g2["Business Domain"]
  node_n7["Category Model<br/>eloquent model<br/>[Category.php]"]
  node_n8["Current Model<br/>eloquent model<br/>[Current.php]"]
  node_n9["User Model<br/>eloquent model<br/>[User.php]"]
  node_n10[("Schema Migrations<br/>database schema")]
  node_n11["Payment Flow<br/>billing<br/>[payment.blade.php]"]
  node_n12["Currents Controller<br/>workflow controller"]
end

subgraph group_g3["Auth Platform"]
  node_n13["Auth Actions<br/>Fortify/Jetstream actions<br/>[CreateNewUser.php]"]
  node_n14["Auth Views<br/>auth UI<br/>[login.blade.php]"]
  node_n15["Session Features<br/>account features"]
  node_n16["Fortify Provider<br/>service provider"]
end

subgraph group_g4["Ops & Runtime"]
  node_n17["Scheduler Command<br/>console command<br/>[everyDay.php]"]
  node_n18["Console Kernel<br/>scheduler<br/>[Kernel.php]"]
  node_n19["Notifications<br/>[NotifyUser.php]"]
  node_n20["Framework Config<br/>bootstrap/config<br/>[app.php]"]
end

node_n1 -->|"boots"| node_n2
node_n2 -->|"dispatches"| node_n3
node_n3 -->|"invokes"| node_n4
node_n4 -->|"renders"| node_n5
node_n5 -.->|"uses"| node_n6
node_n4 -->|"manages"| node_n7
node_n4 -->|"manages"| node_n8
node_n12 -->|"updates"| node_n8
node_n12 -->|"triggers"| node_n11
node_n11 -->|"tracks"| node_n8
node_n7 -->|"persists"| node_n10
node_n8 -->|"persists"| node_n10
node_n9 -->|"persists"| node_n10
node_n13 -->|"extends"| node_n9
node_n16 -->|"wires"| node_n13
node_n14 -->|"supports"| node_n13
node_n15 -.->|"surfaces"| node_n14
node_n17 -->|"emits"| node_n19
node_n18 -->|"runs"| node_n17
node_n17 -->|"checks"| node_n8
node_n19 -->|"alerts"| node_n9
node_n20 -.->|"configures"| node_n16
node_n20 -.->|"initializes"| node_n2

click node_n1 "https://github.com/amrmohamed25/moneyfellows/blob/main/public/index.php"
click node_n2 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Http/Kernel.php"
click node_n3 "https://github.com/amrmohamed25/moneyfellows/blob/main/routes/web.php"
click node_n4 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Http/Controllers/CategoryController.php"
click node_n5 "https://github.com/amrmohamed25/moneyfellows/tree/main/resources/views"
click node_n6 "https://github.com/amrmohamed25/moneyfellows/blob/main/resources/js/app.js"
click node_n7 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Models/Category.php"
click node_n8 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Models/Current.php"
click node_n9 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Models/User.php"
click node_n10 "https://github.com/amrmohamed25/moneyfellows/tree/main/database/migrations"
click node_n11 "https://github.com/amrmohamed25/moneyfellows/blob/main/resources/views/payment.blade.php"
click node_n12 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Http/Controllers/CurrentsController.php"
click node_n13 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Actions/Fortify/CreateNewUser.php"
click node_n14 "https://github.com/amrmohamed25/moneyfellows/blob/main/resources/views/auth/login.blade.php"
click node_n15 "https://github.com/amrmohamed25/moneyfellows/blob/main/tests/Feature/TwoFactorAuthenticationSettingsTest.php"
click node_n16 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Providers/FortifyServiceProvider.php"
click node_n17 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Console/Commands/everyDay.php"
click node_n18 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Console/Kernel.php"
click node_n19 "https://github.com/amrmohamed25/moneyfellows/blob/main/app/Notifications/NotifyUser.php"
click node_n20 "https://github.com/amrmohamed25/moneyfellows/blob/main/bootstrap/app.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_n1,node_n2,node_n3,node_n4,node_n5,node_n6 toneBlue
class node_n7,node_n8,node_n9,node_n10,node_n11,node_n12 toneAmber
class node_n13,node_n14,node_n15,node_n16 toneMint
class node_n17,node_n18,node_n19,node_n20 toneRose
```

## Components

### Web App

HTTP handling, UI, and routing

- [Front Door](https://github.com/amrmohamed25/moneyfellows/blob/main/public/index.php): entrypoint · Public entry script that boots Laravel for web requests · `public/index.php`
- [HTTP Kernel](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Http/Kernel.php): middleware stack · Global middleware and request pipeline configuration · `app/Http/Kernel.php`
- [Web Routes](https://github.com/amrmohamed25/moneyfellows/blob/main/routes/web.php): routing · Main browser-facing route definitions · `routes/web.php`
- [Web Controllers](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Http/Controllers/CategoryController.php): controllers · Main request handlers for categories and currents · `app/Http/Controllers/CategoryController.php`
- [Blade Views](https://github.com/amrmohamed25/moneyfellows/tree/main/resources/views): server-rendered UI · Primary presentation layer with layouts, pages, and components · `resources/views`
- [UI Assets](https://github.com/amrmohamed25/moneyfellows/blob/main/resources/js/app.js): frontend assets · Compiled CSS and JavaScript delivered through Laravel Mix · `resources/js/app.js`

### Business Domain

Core money-circle workflow and persistence

- [Category Model](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Models/Category.php): eloquent model · Admin-created money-circle templates · `app/Models/Category.php`
- [Current Model](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Models/Current.php): eloquent model · Active money-circle instances and their lifecycle state · `app/Models/Current.php`
- [User Model](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Models/User.php): eloquent model · Authenticated users participating in circles · `app/Models/User.php`
- [Schema Migrations](https://github.com/amrmohamed25/moneyfellows/tree/main/database/migrations): database schema · Tables for users, categories, currents, pivot links, and platform storage · `database/migrations`
- [Payment Flow](https://github.com/amrmohamed25/moneyfellows/blob/main/resources/views/payment.blade.php): billing · Stripe/Cashier-backed fee collection tied to current lifecycle · `resources/views/payment.blade.php`
- [Currents Controller](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Http/Controllers/CurrentsController.php): workflow controller · User actions around joining, leaving, timing, and payment steps · `app/Http/Controllers/CurrentsController.php`

### Auth Platform

Jetstream/Fortify account and session features

- [Auth Actions](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Actions/Fortify/CreateNewUser.php): Fortify/Jetstream actions · Registration, password, profile, and account deletion logic · `app/Actions/Fortify/CreateNewUser.php`
- [Auth Views](https://github.com/amrmohamed25/moneyfellows/blob/main/resources/views/auth/login.blade.php): auth UI · Login, registration, password, 2FA, profile, and API token screens · `resources/views/auth/login.blade.php`
- [Session Features](https://github.com/amrmohamed25/moneyfellows/blob/main/tests/Feature/TwoFactorAuthenticationSettingsTest.php): account features · Browser sessions, two-factor authentication, email verification, API tokens · `tests/Feature/TwoFactorAuthenticationSettingsTest.php`
- [Fortify Provider](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Providers/FortifyServiceProvider.php): service provider · Binds Fortify authentication behavior into the app · `app/Providers/FortifyServiceProvider.php`

### Ops & Runtime

Scheduler, notifications, and deployment runtime

- [Scheduler Command](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Console/Commands/everyDay.php): console command · Daily checks for payment status, fees, and due-date updates · `app/Console/Commands/everyDay.php`
- [Console Kernel](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Console/Kernel.php): scheduler · Registers scheduled backend tasks · `app/Console/Kernel.php`
- [Notifications](https://github.com/amrmohamed25/moneyfellows/blob/main/app/Notifications/NotifyUser.php): notification · Persisted user alerts for starts, dues, and payment events · `app/Notifications/NotifyUser.php`
- [Framework Config](https://github.com/amrmohamed25/moneyfellows/blob/main/bootstrap/app.php): bootstrap/config · Application wiring for auth, database, queue, mail, and sessions · `bootstrap/app.php`

## Connections

- Front Door → HTTP Kernel: boots · Requests enter Laravel through the middleware pipeline
- HTTP Kernel → Web Routes: dispatches · Kernel hands requests to route resolution
- Web Routes → Web Controllers: invokes · Web routes map to the main application controllers
- Web Controllers → Blade Views: renders · Controllers return Blade views to the browser
- Blade Views → UI Assets: uses · Views rely on compiled CSS and JavaScript assets
- Web Controllers → Category Model: manages · Category controller works with category templates
- Web Controllers → Current Model: manages · Currents controller operates on active circles
- Currents Controller → Current Model: updates · Participation and lifecycle actions affect current state
- Currents Controller → Payment Flow: triggers · Payment-related actions lead into the billing flow
- Payment Flow → Current Model: tracks · Payments are tied to the current lifecycle and due dates
- Category Model → Schema Migrations: persists · Category data is stored through migrations and Eloquent
- Current Model → Schema Migrations: persists · Current lifecycle and pivot membership are stored in the database
- User Model → Schema Migrations: persists · Users and auth-related platform tables are schema-backed
- Auth Actions → User Model: extends · Fortify/Jetstream actions operate on the user account
- Fortify Provider → Auth Actions: wires · Service provider binds auth actions into framework flows
- Auth Views → Auth Actions: supports · Auth and profile screens match the Fortify/Jetstream actions
- Session Features → Auth Views: surfaces · Two-factor, sessions, verification, and tokens are exposed in views
- Scheduler Command → Notifications: emits · Scheduled checks generate user notifications
- Console Kernel → Scheduler Command: runs · Console kernel schedules the daily command
- Scheduler Command → Current Model: checks · Daily job updates current payment status and due dates
- Notifications → User Model: alerts · Users receive persisted in-app notifications
- Framework Config → Fortify Provider: configures · Framework bootstrap loads the auth/platform providers
- Framework Config → HTTP Kernel: initializes · Bootstrap configuration prepares the HTTP kernel stack
