How marcosgilson/intlinker works
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: Controllers Controllers · ProcessStudentCard.php Jobs & service · Student.php Student & company · index.php Front entry
Components 21
Client UI
Browser-facing Inertia/React interface and server shell.
- App shell · Server-rendered Blade wrapper for the SPA-like frontend.
resources/views/app.blade.php - JS bootstrap · Frontend bootstrapping and Inertia setup.
resources/js/app.jsx - Layouts · Authenticated and guest page frames.
resources/js/Layouts/AuthenticatedLayout.jsx - Pages · Feature-scoped React pages for admin, auth, companies, enrollments, profile, students, and home.
resources/js/Pages - UI kit · Reusable frontend primitives and widgets.
resources/js/Components
HTTP App
Laravel routing, middleware, controllers, and request validation.
- Front entry · Main HTTP bootstrap into the Laravel app.
public/index.php - Web routes · Business and portal routes.
routes/web.php - Auth routes · Login, registration, reset, and verification routes.
routes/auth.php - Controllers · Main request handlers for domain actions.
app/Http/Controllers - Form requests · Input validation and shaping for business operations.
app/Http/Requests - Middleware · Admin access control and Inertia prop sharing.
app/Http/Middleware
Domain Core
Eloquent models, policies, observers, and persistence relationships.
- Users · Core authenticated identity and role anchor.
app/Models/User.php - Student & company · Students, schools, companies, applications, and enrollments.
app/Models/Student.php - Policies · Business authorization for company and enrollment actions.
app/Policies - Company observer · Automated company lifecycle behavior.
app/Observers/CompanyObserver.php - Database & storage · 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 · Student card processing and DocuPipe adapter.
app/Jobs/ProcessStudentCard.php - Notifications & mail · Domain notifications and email templates for verification and status changes.
app/Notifications - Console ops · Operational commands including DocuPipe checks and test utilities.
routes/console.php
Ops & Quality
Containerization, deployment, tests, and automation.
- Tests · Security and workflow coverage for auth, profile, portfolio, and company application flows.
tests/Feature - Runtime & CI · Docker, queue/runtime config, and GitHub Actions automation.
Dockerfile
Connections 25
- 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.