# dev-segovich/folder_links architecture

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

## Overview

#### Purpose and Entry Points
This is a Laravel/PHP ticket-management application with server-rendered dashboard, project, ticket, and authentication screens, plus a programmatic API. HTTP starts at `public/index.php`, loads Laravel through `bootstrap/app.php`, and dispatches browser/API routes in `routes/web.php` and `routes/api.php`. CLI and operational tasks enter through `artisan`, including API-token support in `app/Console/Commands/ApiToken.php`.

#### HTTP, Authentication, and Authorization
Web controllers serve login, dashboard, project, and ticket workflows; API controllers expose project and ticket operations. Authentication configuration and token support are Laravel-based, with Sanctum materially indicated by `config/sanctum.php` and the personal-access-token migration. Role-based authorization is a separate middleware boundary in `app/Http/Middleware/CheckRole.php`.
- `app/Http/Controllers/LoginController.php`
- `app/Http/Controllers/Api/ProjectController.php`
- `app/Http/Middleware/CheckRole.php`

#### Core Domain: Projects and Tickets
The application centers on projects and their tickets. Tickets have associated comments, subtasks, file records, and activity/audit data; projects also support links. Eloquent models represent these relationships and controllers own the request-to-domain persistence flow.
- `app/Models/Project.php`
- `app/Models/Ticket.php`
- `app/Models/TicketComment.php`

#### Persistence and Data Lifecycle
Laravel migrations define the durable relational schema for users, projects, tickets, and ticket child entities, while seeders establish initial users/projects. The schema also includes cache and jobs tables, allowing configured database-backed cache/queue behavior. Audit logs and ticket activity timestamps make lifecycle changes an explicit persisted concern.
- `database/migrations/2026_01_01_000002_create_tickets_table.php`
- `database/migrations/2026_01_01_000006_create_audit_log_table.php`
- `database/migrations/2026_07_14_120000_add_activity_timestamps_to_tickets_table.php`

#### Browser UI and Asset Boundary
The primary UI is Blade-rendered HTML using shared layouts and reusable view partials. Controllers render dashboard, project-directory, ticket-list/detail, and creation/edit pages. Browser assets originate under `resources/` and are built with Vite into `public/build/`; deployed static output already exists there.
- `resources/views/layouts/app.blade.php`
- `resources/views/tickets/show.blade.php`
- `resources/js/app.js`

#### Infrastructure and External Integration Boundaries
Runtime dependencies are PHP/Laravel with Composer and a Node/Vite asset pipeline. Database, cache, queues, sessions, filesystem storage, mail, logging, and third-party service credentials are configuration boundaries rather than embedded service implementations. Ticket file metadata is modeled separately, while Laravel filesystem configuration governs physical storage.
- `config/database.php`
- `config/filesystems.php`
- `config/queue.php`

#### Main Control Flow
A browser request follows route → authentication/role middleware → controller → Eloquent models/database → Blade response. API calls follow the corresponding API route/controller path and use token-capable auth. Ticket mutations can update ticket activity/audit records and related comments, subtasks, or files; uploaded content is expected to cross the filesystem boundary while its metadata remains in the database.
- `routes/web.php`
- `routes/api.php`
- `app/Models/AuditLog.php`

Main entry points: [`database/migrations/2026_01_01_000002_create_tickets_table.php`](https://github.com/dev-segovich/folder_links/blob/main/database/migrations/2026_01_01_000002_create_tickets_table.php) (Relational database), [`app/Models/Ticket.php`](https://github.com/dev-segovich/folder_links/blob/main/app/Models/Ticket.php) (Ticket model), [`app/Http/Middleware/CheckRole.php`](https://github.com/dev-segovich/folder_links/blob/main/app/Http/Middleware/CheckRole.php) (Auth and role guard), [`app/Models/Project.php`](https://github.com/dev-segovich/folder_links/blob/main/app/Models/Project.php) (Project model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP application"]
  node_browser(("Browser<br/>client"))
  node_public_entry["HTTP entry point<br/>PHP entry<br/>[index.php]"]
  node_laravel_bootstrap["Laravel bootstrap<br/>application bootstrap<br/>[app.php]"]
  node_web_routes["Web routes<br/>route definitions<br/>[web.php]"]
  node_api_routes["API routes<br/>route definitions<br/>[api.php]"]
  node_auth_role["Auth and role guard<br/>middleware<br/>[CheckRole.php]"]
  node_web_controllers["Web controllers<br/>Laravel controllers"]
  node_api_controllers["Project and ticket API<br/>API controllers"]
end

subgraph group_domain["Ticket domain"]
  node_project["Project model<br/>Eloquent model<br/>[Project.php]"]
  node_ticket["Ticket model<br/>Eloquent model<br/>[Ticket.php]"]
  node_ticket_comments["Ticket comments<br/>Eloquent model<br/>[TicketComment.php]"]
  node_audit_log["Audit activity<br/>Eloquent model<br/>[AuditLog.php]"]
  node_relational_db[("Relational database<br/>persistence")]
end

subgraph group_delivery["UI and delivery"]
  node_blade_views["Blade UI<br/>server-rendered views<br/>[app.blade.php]"]
  node_vite_assets["Vite asset pipeline<br/>frontend build<br/>[app.js]"]
  node_filesystem["File storage<br/>Laravel filesystem<br/>[filesystems.php]"]
end

node_queue_cache["Queue and cache<br/>runtime infrastructure<br/>[queue.php]"]
node_artisan{{"Artisan operations<br/>CLI entry point"}}

node_browser -->|"HTTP request"| node_public_entry
node_public_entry -->|"loads"| node_laravel_bootstrap
node_laravel_bootstrap -->|"dispatches browser routes"| node_web_routes
node_laravel_bootstrap -->|"dispatches API routes"| node_api_routes
node_web_routes -->|"passes through"| node_auth_role
node_api_routes -->|"token and role checks"| node_auth_role
node_auth_role -->|"authorizes"| node_web_controllers
node_auth_role -->|"authorizes"| node_api_controllers
node_web_controllers -->|"renders"| node_blade_views
node_api_controllers -->|"manages"| node_project
node_web_controllers -->|"manages"| node_project
node_project -->|"contains"| node_ticket
node_ticket -->|"has comments"| node_ticket_comments
node_ticket -->|"records changes"| node_audit_log
node_project -->|"persists"| node_relational_db
node_ticket -->|"persists"| node_relational_db
node_ticket_comments -->|"persists"| node_relational_db
node_audit_log -->|"persists"| node_relational_db
node_ticket -->|"file content storage"| node_filesystem
node_vite_assets -->|"served static assets"| node_browser
node_artisan -->|"migrations and token operations"| node_relational_db
node_queue_cache -.->|"database-backed option"| node_relational_db

click node_public_entry "https://github.com/dev-segovich/folder_links/blob/main/public/index.php"
click node_laravel_bootstrap "https://github.com/dev-segovich/folder_links/blob/main/bootstrap/app.php"
click node_web_routes "https://github.com/dev-segovich/folder_links/blob/main/routes/web.php"
click node_api_routes "https://github.com/dev-segovich/folder_links/blob/main/routes/api.php"
click node_auth_role "https://github.com/dev-segovich/folder_links/blob/main/app/Http/Middleware/CheckRole.php"
click node_web_controllers "https://github.com/dev-segovich/folder_links/blob/main/app/Http/Controllers/LoginController.php"
click node_api_controllers "https://github.com/dev-segovich/folder_links/blob/main/app/Http/Controllers/Api/ProjectController.php"
click node_project "https://github.com/dev-segovich/folder_links/blob/main/app/Models/Project.php"
click node_ticket "https://github.com/dev-segovich/folder_links/blob/main/app/Models/Ticket.php"
click node_ticket_comments "https://github.com/dev-segovich/folder_links/blob/main/app/Models/TicketComment.php"
click node_audit_log "https://github.com/dev-segovich/folder_links/blob/main/app/Models/AuditLog.php"
click node_relational_db "https://github.com/dev-segovich/folder_links/blob/main/database/migrations/2026_01_01_000002_create_tickets_table.php"
click node_blade_views "https://github.com/dev-segovich/folder_links/blob/main/resources/views/layouts/app.blade.php"
click node_vite_assets "https://github.com/dev-segovich/folder_links/blob/main/resources/js/app.js"
click node_filesystem "https://github.com/dev-segovich/folder_links/blob/main/config/filesystems.php"
click node_queue_cache "https://github.com/dev-segovich/folder_links/blob/main/config/queue.php"
click node_artisan "https://github.com/dev-segovich/folder_links/blob/main/artisan"

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_browser,node_public_entry,node_laravel_bootstrap,node_web_routes,node_api_routes,node_auth_role,node_web_controllers,node_api_controllers toneBlue
class node_project,node_ticket,node_ticket_comments,node_audit_log,node_relational_db toneAmber
class node_blade_views,node_vite_assets,node_filesystem toneMint
class node_queue_cache,node_artisan toneNeutral
```

## Components

### HTTP application

- **Browser**: client
- [HTTP entry point](https://github.com/dev-segovich/folder_links/blob/main/public/index.php): PHP entry · `public/index.php`
- [Laravel bootstrap](https://github.com/dev-segovich/folder_links/blob/main/bootstrap/app.php): application bootstrap · `bootstrap/app.php`
- [Web routes](https://github.com/dev-segovich/folder_links/blob/main/routes/web.php): route definitions · `routes/web.php`
- [API routes](https://github.com/dev-segovich/folder_links/blob/main/routes/api.php): route definitions · `routes/api.php`
- [Auth and role guard](https://github.com/dev-segovich/folder_links/blob/main/app/Http/Middleware/CheckRole.php): middleware · Sanctum enables token-capable API authentication. · `app/Http/Middleware/CheckRole.php`
- [Web controllers](https://github.com/dev-segovich/folder_links/blob/main/app/Http/Controllers/LoginController.php): Laravel controllers · Own login, dashboard, project, and ticket workflows. · `app/Http/Controllers/LoginController.php`
- [Project and ticket API](https://github.com/dev-segovich/folder_links/blob/main/app/Http/Controllers/Api/ProjectController.php): API controllers · `app/Http/Controllers/Api/ProjectController.php`

### Ticket domain

- [Project model](https://github.com/dev-segovich/folder_links/blob/main/app/Models/Project.php): Eloquent model · Projects own tickets and links. · `app/Models/Project.php`
- [Ticket model](https://github.com/dev-segovich/folder_links/blob/main/app/Models/Ticket.php): Eloquent model · Tickets relate to comments, subtasks, files, and activity. · `app/Models/Ticket.php`
- [Ticket comments](https://github.com/dev-segovich/folder_links/blob/main/app/Models/TicketComment.php): Eloquent model · `app/Models/TicketComment.php`
- [Audit activity](https://github.com/dev-segovich/folder_links/blob/main/app/Models/AuditLog.php): Eloquent model · Persists lifecycle changes and activity timestamps. · `app/Models/AuditLog.php`
- [Relational database](https://github.com/dev-segovich/folder_links/blob/main/database/migrations/2026_01_01_000002_create_tickets_table.php): persistence · Migrations define users, projects, tickets, child records, cache, jobs, and tokens. · `database/migrations/2026_01_01_000002_create_tickets_table.php`

### UI and delivery

- [Blade UI](https://github.com/dev-segovich/folder_links/blob/main/resources/views/layouts/app.blade.php): server-rendered views · Shared layouts render dashboard, project, and ticket screens. · `resources/views/layouts/app.blade.php`
- [Vite asset pipeline](https://github.com/dev-segovich/folder_links/blob/main/resources/js/app.js): frontend build · Builds resources into deployed public assets. · `resources/js/app.js`
- [File storage](https://github.com/dev-segovich/folder_links/blob/main/config/filesystems.php): Laravel filesystem · Stores uploaded content while ticket file metadata remains relational. · `config/filesystems.php`

### Other components

- [Queue and cache](https://github.com/dev-segovich/folder_links/blob/main/config/queue.php): runtime infrastructure · May use database-backed jobs and cache tables. · `config/queue.php`
- [Artisan operations](https://github.com/dev-segovich/folder_links/blob/main/artisan): CLI entry point · Runs operational tasks including API-token support. · `artisan`

## Connections

- Browser → HTTP entry point: HTTP request
- HTTP entry point → Laravel bootstrap: loads
- Laravel bootstrap → Web routes: dispatches browser routes
- Laravel bootstrap → API routes: dispatches API routes
- Web routes → Auth and role guard: passes through
- API routes → Auth and role guard: token and role checks
- Auth and role guard → Web controllers: authorizes
- Auth and role guard → Project and ticket API: authorizes
- Web controllers → Blade UI: renders
- Project and ticket API → Project model: manages
- Web controllers → Project model: manages
- Project model → Ticket model: contains
- Ticket model → Ticket comments: has comments
- Ticket model → Audit activity: records changes
- Project model → Relational database: persists
- Ticket model → Relational database: persists
- Ticket comments → Relational database: persists
- Audit activity → Relational database: persists
- Ticket model → File storage: file content storage
- Vite asset pipeline → Browser: served static assets
- Artisan operations → Relational database: migrations and token operations
- Queue and cache → Relational database: database-backed option
