# aredo97/luac architecture

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

- Interactive diagram: https://gitdiagram.com/aredo97/luac
- Repository: https://github.com/aredo97/luac

## Overview

#### Purpose and entry points
This is a Laravel server-rendered application for managing users, events, and projects, including role-gated approval workflows, notifications, and reporting. HTTP enters through `public/index.php`, is bootstrapped by `bootstrap/app.php`, and is mapped in `routes/web.php` and `routes/auth.php`. CLI/scheduled operations use `artisan` and `routes/console.php`.

#### HTTP and access control
Route handlers are conventional MVC controllers under `app/Http/Controllers`. Core domain endpoints are represented by `app/Http/Controllers/EventController.php`, `app/Http/Controllers/ProjectController.php`, and `app/Http/Controllers/UserController.php`. Authentication, registration, password recovery, and email verification are supplied through dedicated controllers in `app/Http/Controllers/Auth`. `app/Http/Middleware/RoleMiddleware.php` establishes a key authorization boundary for role-specific actions.

#### Domain persistence and workflows
Eloquent models `app/Models/User.php`, `app/Models/Event.php`, and `app/Models/Project.php` form the central data model. Database schema evolution defines the workflow state: user roles in `database/migrations/2026_06_18_071443_add_role_to_users_table.php`; event creation/status transitions in `database/migrations/2026_06_18_115706_create_events_table.php` and `database/migrations/2026_06_19_162921_update_event_status_enum.php`; and projects in `database/migrations/2026_06_20_053840_create_projects_table.php`. Controllers mediate state changes and select views for pending, approved, archived, posted, and completed records.

#### Event management
The event flow is centered on `EventController`: users create/upload events, while the application separates posted, completed, and archived presentation states. Its primary UI boundary is in `resources/views/Events/uploadEvent.blade.php`, `resources/views/Events/postedEvents.blade.php`, and `resources/views/Events/completedEvents.blade.php`. Event lifecycle changes can notify users through `app/Notifications/eventsNotification.php` and `app/Notifications/eventCompleted.php`.

#### Project approval lifecycle
Projects have explicit submission and review states surfaced in `app/Http/Controllers/ProjectController.php`. Views distinguish creation, pending review, approval, rejection, and archival via `resources/views/projects/create_project.blade.php`, `resources/views/projects/pending_projects.blade.php`, and `resources/views/projects/approved_projects.blade.php`. Approval/rejection side effects are encapsulated in `app/Notifications/projectApprovalNotification.php`, `app/Notifications/projectRejectedNotification.php`, and `app/Mail/projectApprovedMail.php`.

#### Messaging and reporting
Laravel mail and database-style notification mechanisms are used for user-facing lifecycle communication. Notification classes cover verification, new projects, project decisions, and events under `app/Notifications`; mailables include onboarding and report delivery in `app/Mail/WelcomeMail.php` and `app/Mail/UsersReportMail.php`. The console command `app/Console/Commands/SendUsersReport.php` is the batch/reporting entry point, rendering `resources/views/emails/user-report.blade.php`; scheduling is expected to be defined through `routes/console.php`.

#### Runtime, UI, and infrastructure
The runtime is PHP/Laravel with Eloquent database access, configurable cache/session/queue/mail drivers in `config/database.php`, `config/queue.php`, and `config/mail.php`. The application is Blade-rendered using shared application/guest layouts (`resources/views/layouts/app.blade.php`, `resources/views/layouts/guest.blade.php`) rather than an API-first frontend. Vite-managed JavaScript and CSS provide client assets, including dashboard charts at `resources/js/charts/dashboard-charts.js`; uploaded or generated files are bounded by Laravel storage directories under `storage/app`.

Main entry points: [`app/Http/Controllers/EventController.php`](https://github.com/aredo97/luac/blob/email-system/app/Http/Controllers/EventController.php) (Event controller), [`app/Http/Controllers/ProjectController.php`](https://github.com/aredo97/luac/blob/email-system/app/Http/Controllers/ProjectController.php) (Project controller), [`app/Models/User.php`](https://github.com/aredo97/luac/blob/email-system/app/Models/User.php) (User), [`bootstrap/app.php`](https://github.com/aredo97/luac/blob/email-system/bootstrap/app.php) (Application bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Laravel Runtime"]
  node_public_index{{"HTTP entry<br/>PHP entry point<br/>[index.php]"}}
  node_bootstrap["Application bootstrap<br/>Laravel bootstrap<br/>[app.php]"]
  node_storage[("File storage<br/>Laravel storage")]
end

subgraph group_http["HTTP &amp; Access"]
  node_web_routes["Web routes<br/>route map<br/>[web.php]"]
  node_auth_routes["Auth routes<br/>route map<br/>[auth.php]"]
  node_role_middleware["Role authorization<br/>middleware<br/>[RoleMiddleware.php]"]
  node_auth_controllers["Authentication controllers<br/>auth controllers"]
end

subgraph group_domain["Domain Workflows"]
  node_event_controller["Event controller<br/>MVC controller"]
  node_project_controller["Project controller<br/>MVC controller"]
  node_user_controller["User controller<br/>MVC controller<br/>[UserController.php]"]
  node_user_model["User<br/>Eloquent model<br/>[User.php]"]
  node_event_model["Event<br/>Eloquent model<br/>[Event.php]"]
  node_project_model["Project<br/>Eloquent model<br/>[Project.php]"]
  node_database[("Application database<br/>persistence")]
end

subgraph group_ui["Blade UI"]
  node_event_views["Event views<br/>Blade screens"]
  node_project_views["Project views<br/>Blade screens"]
  node_layouts["Shared layouts<br/>Blade layout<br/>[app.blade.php]"]
end

subgraph group_ops["Reporting &amp; Delivery"]
  node_notifications["Lifecycle notifications<br/>Laravel notifications"]
  node_report_command{{"User report command<br/>Artisan command"}}
  node_console_routes["Schedule definition<br/>console routes<br/>[console.php]"]
  node_report_mail["User report mail<br/>Mailable"]
  node_report_template["Report email template<br/>Blade email"]
end

node_public_index -->|"boots"| node_bootstrap
node_bootstrap -->|"loads"| node_web_routes
node_bootstrap -->|"loads"| node_auth_routes
node_web_routes -->|"applies"| node_role_middleware
node_role_middleware -->|"authorizes"| node_event_controller
node_role_middleware -->|"authorizes"| node_project_controller
node_web_routes -->|"dispatches"| node_user_controller
node_auth_routes -->|"dispatches"| node_auth_controllers
node_event_controller -->|"updates"| node_event_model
node_project_controller -->|"reviews"| node_project_model
node_user_controller -->|"manages"| node_user_model
node_auth_controllers -->|"authenticates"| node_user_model
node_user_model -->|"persists"| node_database
node_event_model -->|"persists"| node_database
node_project_model -->|"persists"| node_database
node_event_controller -->|"renders"| node_event_views
node_project_controller -->|"renders"| node_project_views
node_event_views -->|"uses"| node_layouts
node_project_views -->|"uses"| node_layouts
node_event_controller -->|"notifies lifecycle changes"| node_notifications
node_project_controller -->|"notifies decisions"| node_notifications
node_event_controller -->|"stores uploads"| node_storage
node_console_routes -->|"schedules"| node_report_command
node_report_command -->|"queries users"| node_user_model
node_report_command -->|"sends"| node_report_mail
node_report_mail -->|"renders"| node_report_template

click node_public_index "https://github.com/aredo97/luac/blob/email-system/public/index.php"
click node_bootstrap "https://github.com/aredo97/luac/blob/email-system/bootstrap/app.php"
click node_web_routes "https://github.com/aredo97/luac/blob/email-system/routes/web.php"
click node_auth_routes "https://github.com/aredo97/luac/blob/email-system/routes/auth.php"
click node_role_middleware "https://github.com/aredo97/luac/blob/email-system/app/Http/Middleware/RoleMiddleware.php"
click node_event_controller "https://github.com/aredo97/luac/blob/email-system/app/Http/Controllers/EventController.php"
click node_project_controller "https://github.com/aredo97/luac/blob/email-system/app/Http/Controllers/ProjectController.php"
click node_user_controller "https://github.com/aredo97/luac/blob/email-system/app/Http/Controllers/UserController.php"
click node_auth_controllers "https://github.com/aredo97/luac/tree/email-system/app/Http/Controllers/Auth"
click node_user_model "https://github.com/aredo97/luac/blob/email-system/app/Models/User.php"
click node_event_model "https://github.com/aredo97/luac/blob/email-system/app/Models/Event.php"
click node_project_model "https://github.com/aredo97/luac/blob/email-system/app/Models/Project.php"
click node_event_views "https://github.com/aredo97/luac/blob/email-system/resources/views/Events/uploadEvent.blade.php"
click node_project_views "https://github.com/aredo97/luac/blob/email-system/resources/views/projects/create_project.blade.php"
click node_layouts "https://github.com/aredo97/luac/blob/email-system/resources/views/layouts/app.blade.php"
click node_notifications "https://github.com/aredo97/luac/blob/email-system/app/Notifications/eventsNotification.php"
click node_report_command "https://github.com/aredo97/luac/blob/email-system/app/Console/Commands/SendUsersReport.php"
click node_console_routes "https://github.com/aredo97/luac/blob/email-system/routes/console.php"
click node_report_mail "https://github.com/aredo97/luac/blob/email-system/app/Mail/UsersReportMail.php"
click node_report_template "https://github.com/aredo97/luac/blob/email-system/resources/views/emails/user-report.blade.php"
click node_storage "https://github.com/aredo97/luac/tree/email-system/storage/app"

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_public_index,node_bootstrap,node_storage toneBlue
class node_web_routes,node_auth_routes,node_role_middleware,node_auth_controllers toneAmber
class node_event_controller,node_project_controller,node_user_controller,node_user_model,node_event_model,node_project_model,node_database toneMint
class node_event_views,node_project_views,node_layouts toneRose
class node_notifications,node_report_command,node_console_routes,node_report_mail,node_report_template toneIndigo
```

## Components

### Laravel Runtime

- [HTTP entry](https://github.com/aredo97/luac/blob/email-system/public/index.php): PHP entry point · `public/index.php`
- [Application bootstrap](https://github.com/aredo97/luac/blob/email-system/bootstrap/app.php): Laravel bootstrap · `bootstrap/app.php`
- [File storage](https://github.com/aredo97/luac/tree/email-system/storage/app): Laravel storage · Bounds uploaded and generated files. · `storage/app`

### HTTP & Access

- [Web routes](https://github.com/aredo97/luac/blob/email-system/routes/web.php): route map · `routes/web.php`
- [Auth routes](https://github.com/aredo97/luac/blob/email-system/routes/auth.php): route map · `routes/auth.php`
- [Role authorization](https://github.com/aredo97/luac/blob/email-system/app/Http/Middleware/RoleMiddleware.php): middleware · Gates role-specific actions. · `app/Http/Middleware/RoleMiddleware.php`
- [Authentication controllers](https://github.com/aredo97/luac/tree/email-system/app/Http/Controllers/Auth): auth controllers · Registration, recovery, verification, and login flows. · `app/Http/Controllers/Auth`

### Domain Workflows

- [Event controller](https://github.com/aredo97/luac/blob/email-system/app/Http/Controllers/EventController.php): MVC controller · Creates uploads and manages event lifecycle states. · `app/Http/Controllers/EventController.php`
- [Project controller](https://github.com/aredo97/luac/blob/email-system/app/Http/Controllers/ProjectController.php): MVC controller · Submits and reviews project approvals. · `app/Http/Controllers/ProjectController.php`
- [User controller](https://github.com/aredo97/luac/blob/email-system/app/Http/Controllers/UserController.php): MVC controller · `app/Http/Controllers/UserController.php`
- [User](https://github.com/aredo97/luac/blob/email-system/app/Models/User.php): Eloquent model · Includes role-based access state. · `app/Models/User.php`
- [Event](https://github.com/aredo97/luac/blob/email-system/app/Models/Event.php): Eloquent model · Persists posted, completed, and archived lifecycle state. · `app/Models/Event.php`
- [Project](https://github.com/aredo97/luac/blob/email-system/app/Models/Project.php): Eloquent model · Persists submission and approval state. · `app/Models/Project.php`
- **Application database**: persistence · Eloquent-backed users, events, and projects.

### Blade UI

- [Event views](https://github.com/aredo97/luac/blob/email-system/resources/views/Events/uploadEvent.blade.php): Blade screens · Upload, posted, and completed event interfaces. · `resources/views/Events/uploadEvent.blade.php`
- [Project views](https://github.com/aredo97/luac/blob/email-system/resources/views/projects/create_project.blade.php): Blade screens · Creation, pending review, and approved project interfaces. · `resources/views/projects/create_project.blade.php`
- [Shared layouts](https://github.com/aredo97/luac/blob/email-system/resources/views/layouts/app.blade.php): Blade layout · Shared authenticated application shell. · `resources/views/layouts/app.blade.php`

### Reporting & Delivery

- [Lifecycle notifications](https://github.com/aredo97/luac/blob/email-system/app/Notifications/eventsNotification.php): Laravel notifications · Delivers event and project status changes. · `app/Notifications/eventsNotification.php`
- [User report command](https://github.com/aredo97/luac/blob/email-system/app/Console/Commands/SendUsersReport.php): Artisan command · Generates and delivers the user report. · `app/Console/Commands/SendUsersReport.php`
- [Schedule definition](https://github.com/aredo97/luac/blob/email-system/routes/console.php): console routes · `routes/console.php`
- [User report mail](https://github.com/aredo97/luac/blob/email-system/app/Mail/UsersReportMail.php): Mailable · `app/Mail/UsersReportMail.php`
- [Report email template](https://github.com/aredo97/luac/blob/email-system/resources/views/emails/user-report.blade.php): Blade email · `resources/views/emails/user-report.blade.php`

## Connections

- HTTP entry → Application bootstrap: boots
- Application bootstrap → Web routes: loads
- Application bootstrap → Auth routes: loads
- Web routes → Role authorization: applies
- Role authorization → Event controller: authorizes
- Role authorization → Project controller: authorizes
- Web routes → User controller: dispatches
- Auth routes → Authentication controllers: dispatches
- Event controller → Event: updates
- Project controller → Project: reviews
- User controller → User: manages
- Authentication controllers → User: authenticates
- User → Application database: persists
- Event → Application database: persists
- Project → Application database: persists
- Event controller → Event views: renders
- Project controller → Project views: renders
- Event views → Shared layouts: uses
- Project views → Shared layouts: uses
- Event controller → Lifecycle notifications: notifies lifecycle changes
- Project controller → Lifecycle notifications: notifies decisions
- Event controller → File storage: stores uploads
- Schedule definition → User report command: schedules
- User report command → User: queries users
- User report command → User report mail: sends
- User report mail → Report email template: renders
