# marcosgilson/intlinker architecture

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

- Interactive diagram: https://gitdiagram.com/marcosgilson/intlinker
- Repository: https://github.com/marcosgilson/intlinker

## Overview

1. **What this repository is**
   - A Laravel 11 application with a React frontend wired through Inertia.js.
   - The domain is centered on **students, schools, companies, company applications, enrollments, and worker/staff profiles**.
   - It behaves like a portal with authenticated user flows plus an admin back office.

2. **Request/response architecture**
   - HTTP traffic enters through `public/index.php` into Laravel’s routing layer.
   - `routes/web.php` and `routes/auth.php` split the app into authenticated business pages and built-in auth flows.
   - `resources/views/app.blade.php` is the server-side shell that boots the Inertia SPA-like experience.

3. **Frontend boundary**
   - UI is implemented in `resources/js` using React components, layouts, and page modules.
   - Pages are grouped by feature area: `Admin`, `Auth`, `Companies`, `Company`, `Enrollments`, `Profile`, `Students`, and `Home/Inicio`.
   - Shared UI primitives live in `resources/js/Components`, while page composition is handled by `AuthenticatedLayout` and `GuestLayout`.

4. **Backend application layer**
   - Controllers in `app/Http/Controllers` are the main orchestration point for domain actions.
   - Form validation and input shaping are pushed into `app/Http/Requests`, which keeps controller logic thin.
   - `app/Http/Middleware/AdminMiddleware.php` creates the admin boundary, and `HandleInertiaRequests.php` bridges Laravel data into Inertia props.

5. **Core domain model**
   - Persistence is organized around Eloquent models: `User`, `Student`, `School`, `Company`, `CompanyApplication`, `Enrollment`, and `ErrorLog`.
   - The schema shows the main relationships:
     - users can become students or workers,
     - students relate to schools,
     - companies have employees and applications,
     - enrollments connect students and companies.
   - `CompanyObserver` indicates some company lifecycle behavior is handled automatically at the model layer.

6. **Primary business flows**
   - **Student flow:** profile updates, becoming a student, portfolio management, profile photo handling, and student verification/rejection notifications.
   - **Company flow:** company creation/management, company applications, and enrollment views.
   - **Enrollment flow:** students are enrolled into companies through dedicated controllers, requests, policies, and indexed pages.
   - **Worker/admin flow:** worker applications are tracked and verified, with admin-facing review pages.

7. **Authorization and security boundaries**
   - `CompanyPolicy` and `EnrollmentPolicy` protect business actions at the model/resource level.
   - Auth is handled using Laravel’s standard authentication stack with registration, login, password reset, and email verification controllers.
   - Feature tests explicitly cover admin security and company application security, so access control is a first-class concern.

8. **Async processing and external integration**
   - `app/Jobs/ProcessStudentCard.php` indicates at least one background job for post-processing student card data.
   - `app/Services/DocuPipeService.php` is the main external integration point, likely for document/card processing or generation.
   - The presence of a `CheckDocuPipeStatus` console command suggests polling or operational checks against that service.

9. **Notifications and email**
   - Business events trigger notifications such as student verified/rejected, worker verified, and new worker application alerts for admins.
   - Email templates live in `resources/views/emails`, including verification and status-change emails.
   - This makes email a downstream delivery channel for domain events rather than a separate subsystem.

10. **Storage and media**
   - The app uses Laravel’s filesystem and public storage for user-uploaded assets such as profile photos and work-card-related images/text.
   - `app/Helpers/ImageHelper.php` suggests image manipulation or normalization is done centrally.
   - `database/migrations/2026_05_30_000000_alter_work_card_image_to_text.php` shows the work-card payload evolved over time, which matters for diagrams showing data shape changes.

11. **Operational runtime and deployment**
   - The repository is containerized with `Dockerfile`, `docker-compose.yml`, and Podman instructions in the README.
   - Local development exposes the Laravel app, Vite HMR, and MySQL separately.
   - Queueing and scheduled/console operations are supported through `artisan`, `Procfile`, and `routes/console.php`.

12. **Automation and quality gates**
   - GitHub Actions run tests, migrations on push, issues/PR automation, and changelog updates.
   - The test suite is feature-heavy, especially around auth, profile, portfolio, and security-sensitive workflows.
   - Seeders and factories exist for bootstrapping demo/test data, especially around companies and users.

13. **How to draw the architecture**
   - A good diagram should show:
     - browser/client UI on the left,
     - Inertia/React pages and Laravel controllers in the middle,
     - Eloquent models + MySQL as the persistence core,
     - queue/job processing and DocuPipe/email as external side effects,
     - admin/auth/policy boundaries around sensitive routes.
   - The main architectural split is not microservices; it is a **monolith with clear domain modules, async jobs, and external service adapters**.

Main entry points: [`app/Http/Controllers`](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Http/Controllers) (Controllers), [`app/Jobs/ProcessStudentCard.php`](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Jobs/ProcessStudentCard.php) (Jobs & service), [`app/Models/Student.php`](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Models/Student.php) (Student & company), [`public/index.php`](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/public/index.php) (Front entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client UI"]
  node_app_blade["App shell<br/>Inertia shell<br/>[app.blade.php]"]
  node_inertia_boot["JS bootstrap<br/>React entry<br/>[app.jsx]"]
  node_auth_layout["Layouts<br/>UI layout"]
  node_ui_pages["Pages"]
  node_ui_components["UI kit<br/>shared components"]
end

subgraph group_http["HTTP App"]
  node_public_index["Front entry<br/>http entrypoint<br/>[index.php]"]
  node_routes_web["Web routes<br/>route map<br/>[web.php]"]
  node_routes_auth["Auth routes<br/>[auth.php]"]
  node_controllers["Controllers<br/>orchestration layer"]
  node_requests["Form requests<br/>validation layer"]
  node_middleware["Middleware<br/>boundary layer"]
end

subgraph group_domain["Domain Core"]
  node_users[("Users<br/>account model<br/>[User.php]")]
  node_student_company[("Student & company<br/>domain models<br/>[Student.php]")]
  node_policies["Policies<br/>authorization"]
  node_observer(("Company observer<br/>model hook"))
  node_storage_db[("Database & storage<br/>persistence")]
end

subgraph group_async["Async & Integrations"]
  node_job_service["Jobs & service<br/>async integration"]
  node_notifications_email["Notifications & mail<br/>delivery layer"]
  node_console["Console ops<br/>artisan commands<br/>[console.php]"]
end

subgraph group_ops["Ops & Quality"]
  node_tests["Tests"]
  node_deploy["Runtime & CI<br/>ops"]
end

node_public_index -->|"dispatches"| node_routes_web
node_public_index -->|"auth flow"| node_routes_auth
node_routes_web -->|"routes to"| node_controllers
node_routes_auth -->|"auth controllers"| node_controllers
node_controllers -->|"validates via"| node_requests
node_controllers -->|"passes through"| node_middleware
node_middleware -->|"shares props"| node_app_blade
node_app_blade -->|"boots"| node_inertia_boot
node_inertia_boot -->|"composes"| node_auth_layout
node_auth_layout -->|"renders"| node_ui_pages
node_ui_pages -->|"uses"| node_ui_components
node_controllers -->|"orchestrates"| node_users
node_controllers -->|"manages"| node_student_company
node_student_company -->|"protected by"| node_policies
node_student_company -->|"triggers"| node_observer
node_controllers -->|"queues"| node_job_service
node_job_service -->|"emits"| node_notifications_email
node_controllers -->|"notifies"| node_notifications_email
node_job_service -->|"reads/writes"| node_storage_db
node_controllers -->|"persists"| node_storage_db
node_console -->|"operates"| node_job_service
node_tests -.->|"covers"| node_controllers
node_tests -.->|"verifies"| node_policies
node_deploy -->|"runs"| node_public_index
node_deploy -->|"supports"| node_console

click node_public_index "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/public/index.php"
click node_routes_web "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/routes/web.php"
click node_routes_auth "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/routes/auth.php"
click node_app_blade "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/resources/views/app.blade.php"
click node_inertia_boot "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/resources/js/app.jsx"
click node_auth_layout "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/resources/js/Layouts/AuthenticatedLayout.jsx"
click node_ui_pages "https://github.com/marcosgilson/intlinker/tree/desarrollo-react/resources/js/Pages"
click node_ui_components "https://github.com/marcosgilson/intlinker/tree/desarrollo-react/resources/js/Components"
click node_controllers "https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Http/Controllers"
click node_requests "https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Http/Requests"
click node_middleware "https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Http/Middleware"
click node_users "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Models/User.php"
click node_student_company "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Models/Student.php"
click node_policies "https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Policies"
click node_observer "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Observers/CompanyObserver.php"
click node_job_service "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Jobs/ProcessStudentCard.php"
click node_notifications_email "https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Notifications"
click node_console "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/routes/console.php"
click node_storage_db "https://github.com/marcosgilson/intlinker/blob/desarrollo-react/database/migrations/2024_01_01_100001_create_students_table.php"
click node_tests "https://github.com/marcosgilson/intlinker/tree/desarrollo-react/tests/Feature"
click node_deploy "https://github.com/marcosgilson/intlinker/tree/desarrollo-react/Dockerfile"

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_app_blade,node_inertia_boot,node_auth_layout,node_ui_pages,node_ui_components toneBlue
class node_public_index,node_routes_web,node_routes_auth,node_controllers,node_requests,node_middleware toneAmber
class node_users,node_student_company,node_policies,node_observer,node_storage_db toneMint
class node_job_service,node_notifications_email,node_console toneRose
class node_tests,node_deploy toneIndigo
```

## Components

### Client UI

Browser-facing Inertia/React interface and server shell.

- [App shell](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/resources/views/app.blade.php): Inertia shell · Server-rendered Blade wrapper for the SPA-like frontend. · `resources/views/app.blade.php`
- [JS bootstrap](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/resources/js/app.jsx): React entry · Frontend bootstrapping and Inertia setup. · `resources/js/app.jsx`
- [Layouts](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/resources/js/Layouts/AuthenticatedLayout.jsx): UI layout · Authenticated and guest page frames. · `resources/js/Layouts/AuthenticatedLayout.jsx`
- [Pages](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/resources/js/Pages): feature pages · Feature-scoped React pages for admin, auth, companies, enrollments, profile, students, and home. · `resources/js/Pages`
- [UI kit](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/resources/js/Components): shared components · Reusable frontend primitives and widgets. · `resources/js/Components`

### HTTP App

Laravel routing, middleware, controllers, and request validation.

- [Front entry](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/public/index.php): http entrypoint · Main HTTP bootstrap into the Laravel app. · `public/index.php`
- [Web routes](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/routes/web.php): route map · Business and portal routes. · `routes/web.php`
- [Auth routes](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/routes/auth.php): auth routes · Login, registration, reset, and verification routes. · `routes/auth.php`
- [Controllers](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Http/Controllers): orchestration layer · Main request handlers for domain actions. · `app/Http/Controllers`
- [Form requests](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Http/Requests): validation layer · Input validation and shaping for business operations. · `app/Http/Requests`
- [Middleware](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Http/Middleware): boundary layer · Admin access control and Inertia prop sharing. · `app/Http/Middleware`

### Domain Core

Eloquent models, policies, observers, and persistence relationships.

- [Users](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Models/User.php): account model · Core authenticated identity and role anchor. · `app/Models/User.php`
- [Student & company](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Models/Student.php): domain models · Students, schools, companies, applications, and enrollments. · `app/Models/Student.php`
- [Policies](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Policies): authorization · Business authorization for company and enrollment actions. · `app/Policies`
- [Company observer](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Observers/CompanyObserver.php): model hook · Automated company lifecycle behavior. · `app/Observers/CompanyObserver.php`
- [Database & storage](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/database/migrations/2024_01_01_100001_create_students_table.php): persistence · Migrations, seeders, and filesystem-backed uploads. · `database/migrations/2024_01_01_100001_create_students_table.php`

### Async & Integrations

Background jobs, console commands, notifications, email, and external service adapters.

- [Jobs & service](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/app/Jobs/ProcessStudentCard.php): async integration · Student card processing and DocuPipe adapter. · `app/Jobs/ProcessStudentCard.php`
- [Notifications & mail](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/app/Notifications): delivery layer · Domain notifications and email templates for verification and status changes. · `app/Notifications`
- [Console ops](https://github.com/marcosgilson/intlinker/blob/desarrollo-react/routes/console.php): artisan commands · Operational commands including DocuPipe checks and test utilities. · `routes/console.php`

### Ops & Quality

Containerization, deployment, tests, and automation.

- [Tests](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/tests/Feature): feature tests · Security and workflow coverage for auth, profile, portfolio, and company application flows. · `tests/Feature`
- [Runtime & CI](https://github.com/marcosgilson/intlinker/tree/desarrollo-react/Dockerfile): ops · Docker, queue/runtime config, and GitHub Actions automation. · `Dockerfile`

## Connections

- Front entry → Web routes: dispatches · HTTP requests enter routing through the web stack.
- Front entry → Auth routes: auth flow · Built-in auth endpoints are separated from business routes.
- Web routes → Controllers: routes to · Business pages and actions are handled by controllers.
- Auth routes → Controllers: auth controllers · Authentication pages and actions use dedicated controllers.
- Controllers → Form requests: validates via · Input shaping and validation are delegated to form requests.
- Controllers → Middleware: passes through · Admin and Inertia middleware guard and enrich requests.
- Middleware → App shell: shares props · Inertia data bridge into the frontend shell.
- App shell → JS bootstrap: boots · Blade shell loads the React/Inertia client.
- JS bootstrap → Layouts: composes · Layouts frame authenticated and guest experiences.
- Layouts → Pages: renders · Page modules are composed inside layout shells.
- Pages → UI kit: uses · Feature pages reuse shared UI primitives.
- Controllers → Users: orchestrates · Controllers operate on the authenticated account model.
- Controllers → Student & company: manages · Core flows update students, schools, companies, applications, and enrollments.
- Student & company → Policies: protected by · Company and enrollment actions are authorization-gated.
- Student & company → Company observer: triggers · Company lifecycle behavior is handled through an observer.
- Controllers → Jobs & service: queues · Student card work is pushed into background processing and external integration.
- Jobs & service → Notifications & mail: emits · Verification and status changes fan out to notifications and email.
- Controllers → Notifications & mail: notifies · Business events notify students, workers, and admins.
- Jobs & service → Database & storage: reads/writes · Jobs and integration depend on persisted records and uploaded assets.
- Controllers → Database & storage: persists · Application state is stored through Eloquent and filesystem-backed media.
- Console ops → Jobs & service: operates · Console commands support integration checks and operational tasks.
- Tests → Controllers: covers · Feature tests exercise controller-driven workflows and security boundaries.
- Tests → Policies: verifies · Security-sensitive access control is asserted in tests.
- Runtime & CI → Front entry: runs · Container/runtime configuration serves the Laravel entrypoint.
- Runtime & CI → Console ops: supports · Queues, scheduling, and deployment automation rely on console tooling.
