# ritulk/public-crowfund-application architecture

> Architecture diagram of the GitHub repository ritulk/public-crowfund-application, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ritulk/public-crowfund-application
- Repository: https://github.com/ritulk/public-crowfund-application

## Overview

##### Project type and purpose
- This is a full-stack web application built with Laravel 10.x that implements a role-based crowdfunding platform.
- Users can register, log in, create or contribute to campaigns; admins and campaign owners have special dashboards and management capabilities.

##### File structure
- Top-level directories:
- app/ (core MVC code: Controllers, Models, Middleware, Requests, View Components)
- config/, bootstrap/, public/ (entry point, assets, server config)
- resources/ (Blade templates, CSS/JS via Tailwind & Vite)
- database/ (migrations, seeders, factories)
- routes/ (web.php, auth.php, console.php)
- storage/ (cache, sessions, logs, file uploads)
- tests/ (Feature & Unit tests)
- Key indicators:
- MVC pattern (app/Http/Controllers + app/Models + resources/views)
- RoleMiddleware enforces RBAC
- Eloquent ORM for DB interactions
- Tailwind CSS and Blade for frontend
- Vite for asset bundling

##### README for additional insights
- Confirms Laravel framework, MySQL/SQLite database, Blade + Tailwind frontend.
- Mentions real-time fundraising progress (could use AJAX or Laravel Echo, though not explicitly present).
- Describes seeders for roles/users, migrations for campaigns, users, roles, sessions, cache.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Browser["Browser"]:::client
        Templates["Blade Templates"]:::views
        CSS["app.css"]:::assets
        JS["app.js"]:::assets
        PublicAssets["Compiled Assets\n(public/)"]:::assets
        Browser -->|HTTP Request| Nginx
        Browser -->|renders| Templates
        Browser -->|loads| CSS
        Browser -->|loads| JS
        Browser -->|loads| PublicAssets
    end

    %% Web Server
    subgraph "Web Server"
        direction TB
        Nginx["nginx/Apache\n(public/index.php)"]:::server
    end

    Nginx -->|forwards| Kernel

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        Kernel["HTTP Kernel\n(middleware pipeline)"]:::kernel
        Router["Router\n(routes)"]:::config
        Middleware["RoleMiddleware"]:::middleware
        Requests["Validation Requests"]:::request
        Controllers["Controllers"]:::controller
        ViewComponents["View Components"]:::viewcomponent
        ServiceProviders["Service Providers"]:::config
        Models["Eloquent Models"]:::model

        Kernel -->|handles| Router
        Router -->|uses| Middleware
        Middleware -->|guards| Controllers
        Controllers -->|validate via| Requests
        Controllers -->|render| ViewComponents
        Controllers -->|access| Models
    end

    %% Database & Persistence
    subgraph "Persistence Layer"
        direction TB
        Migrations["Migrations & Seeders"]:::database
        DB["MySQL / SQLite"]:::database
        Cache["Cache & Session Store"]:::database
        Storage["File Storage"]:::external
        Mail["Mail Service"]:::external
        Queue["Queue System"]:::external
        RealTime["Real-Time (Pusher/Echo)"]:::externalOpt

        Models --> DB
        Migrations --> DB
        Controllers -->|queue events| Queue
        Queue -.->|processes| Mail
        Controllers -->|store files| Storage
        Controllers -->|cache/session| Cache
        Controllers -.->|broadcast| RealTime
    end

    %% CI/Test Layer
    subgraph "CI / Test Layer"
        direction TB
        Tests["Feature & Unit Tests"]:::test
        Tests --> Controllers
        Tests --> Models
    end

    %% Click Events
    click Templates "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/resources/views"
    click CSS "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/resources/css/app.css"
    click JS "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/resources/js/app.js"
    click PublicAssets "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/public"
    click Nginx "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/public/index.php"
    click Router "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/routes/web.php"
    click Router "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/routes/auth.php"
    click Router "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/routes/console.php"
    click Controllers "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/app/Http/Controllers"
    click Controllers "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/app/Http/Controllers/Auth/"
    click Controllers "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/app/Http/Controllers/CampaignController.php"
    click Controllers "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/app/Http/Controllers/AdminController.php"
    click Controllers "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/app/Http/Controllers/OwnerController.php"
    click Controllers "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/app/Http/Controllers/ProfileController.php"
    click Middleware "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/app/Http/Middleware/RoleMiddleware.php"
    click Requests "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/app/Http/Requests"
    click ViewComponents "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/app/View/Components"
    click Models "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/app/Models"
    click Migrations "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/database/migrations"
    click Migrations "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/database/seeders"
    click Migrations "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/database/factories/UserFactory.php"
    click DB "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/config/database.php"
    click Cache "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/config/cache.php"
    click Cache "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/config/session.php"
    click Storage "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/config/filesystems.php"
    click Mail "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/config/mail.php"
    click Queue "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/config/queue.php"
    click ServiceProviders "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/app/Providers/AppServiceProvider.php"
    click Tests "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/tests/Feature"
    click Tests "https://github.com/ritulk/public-crowfund-application/tree/main/ritul2-app/tests/Unit"
    click CSS "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/vite.config.js"
    click JS "https://github.com/ritulk/public-crowfund-application/blob/main/ritul2-app/tailwind.config.js"

    %% Styles
    classDef client fill:#D6E9FE,stroke:#1E70BF,color:#1E70BF
    classDef views fill:#E8F5E9,stroke:#388E3C,color:#388E3C
    classDef assets fill:#FFF3E0,stroke:#F57C00,color:#F57C00
    classDef server fill:#E3F2FD,stroke:#1976D2,color:#1976D2
    classDef kernel fill:#F3E5F5,stroke:#8E24AA,color:#8E24AA
    classDef config fill:#ECEFF1,stroke:#546E7A,color:#546E7A
    classDef middleware fill:#FFEBEE,stroke:#C62828,color:#C62828
    classDef request fill:#FFFDE7,stroke:#F9A825,color:#F9A825
    classDef controller fill:#E1F5FE,stroke:#039BE5,color:#039BE5
    classDef viewcomponent fill:#F9FBE7,stroke:#7CB342,color:#7CB342
    classDef model fill:#EDE7F6,stroke:#5E35B1,color:#5E35B1
    classDef database fill:#EFEBE9,stroke:#6D4C41,color:#6D4C41
    classDef external fill:#E0F2F1,stroke:#00796B,color:#00796B
    classDef externalOpt fill:#FAFAFA,stroke:#BDBDBD,color:#757575,stroke-dasharray: 5 5
    classDef test fill:#F1F8E9,stroke:#33691E,color:#33691E
```
