# shahed-b22d/career_ai_la architecture

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

- Interactive diagram: https://gitdiagram.com/shahed-b22d/career_ai_la
- Repository: https://github.com/shahed-b22d/career_ai_la

## Overview

1. **Overall shape**
This is a single Laravel monolith that serves both browser pages and JSON/API endpoints. The app is organized around a career/job platform domain: job seekers, companies, jobs, AI-assisted career planning, complaints, and admin moderation.

2. **Request entry points**
All traffic enters through Laravel’s normal HTTP front door in `public/index.php`, then routes are split across `routes/web.php` and `routes/api.php`. `app/Http/Kernel.php` and the middleware stack enforce auth, CSRF for web flows, and an explicit admin gate via `EnsureAdmin`.

3. **Core domain boundaries**
The main Eloquent models show the business boundaries clearly:
- `User` as the primary identity
- `JobSeeker` and `Company` as profile extensions
- `Job` for listings
- `Shortlist` for saved/candidate selection workflows
- `Complaint` for moderation/support cases
- `UserResume`, `UserRoadmap`, and `UserQuiz` for the AI/career-planning side

4. **Authentication and roles**
`AuthController` handles login/registration/reset flows, while `User` has role data added by migrations and enforced by middleware. The data model includes admin-specific changes and company verification fields, so authorization is role-driven rather than being a separate subsystem.

5. **AI career subsystem**
`AiController` plus `app/Services/AiCareerService.php` form a dedicated AI boundary. The presence of `test_gemini.php`, `test_ai_endpoints.php`, and `test_ats_cv_output.php` suggests the app calls an external LLM/AI provider and uses it for resume analysis, career roadmap generation, quiz-like assessments, and ATS-style CV feedback. The AI layer is service-based, keeping provider-specific logic out of controllers.

6. **Job marketplace flow**
`JobController` and the `Job`/`Company` models represent the marketplace side: companies create and manage jobs, and job seekers interact with listings and shortlist records. The database migrations show this is a first-class relational workflow, not just a content page.

7. **Complaints and admin moderation**
`ComplaintController` and `AdminController` support support-ticket / moderation workflows. Migrations add admin response fields and company verification, indicating that admins resolve complaints and likely approve or review companies. This is a separate operational boundary from the core user experience.

8. **Notifications and background work**
Notifications are handled in two ways: Laravel notifications for password reset and a custom `FcmService` for push notifications. The console command `SendMotivationalNotifications` suggests scheduled/background outreach, likely targeted at users based on career progress or engagement. `app/Console/Kernel.php` is the scheduling boundary.

9. **Data persistence and file storage**
The database schema is migration-driven and includes authentication tables, personal access tokens, resumes, roadmaps, quizzes, jobs, complaints, shortlists, company verification, and FCM tokens. Files such as resumes or commercial registration documents are stored through Laravel’s filesystem under `storage/app` and `storage/app/public`.

10. **Presentation layer**
The project uses Blade views for at least auth reset flows, a welcome page, and a mock checkout page, while `resources/js` and `resources/css` are built with Vite. That means the repo is not API-only; it mixes server-rendered pages with API-driven interactions.

11. **Infrastructure and integrations**
Relevant platform pieces include Sanctum for token-based API auth, mail configuration for password reset and notifications, broadcasting config for real-time features, and CORS/session/cache configuration for web/API coexistence. External dependencies appear to include an AI provider and FCM for push notifications.

12. **Testing and verification**
The repository includes HTTP client files (`api_tests.http`), standalone PHP test scripts, and standard Laravel feature/unit tests. That indicates the team validates endpoints both through automated tests and manual API probes, which is useful when drawing the system’s external interaction boundaries.

Main entry points: [`routes/web.php`](https://github.com/shahed-b22d/career_ai_la/blob/main/routes/web.php) (Web Routes), [`routes/api.php`](https://github.com/shahed-b22d/career_ai_la/blob/main/routes/api.php) (API Routes), [`app/Http/Kernel.php`](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Kernel.php) (HTTP Kernel), [`database/migrations/2014_10_12_000000_create_users_table.php`](https://github.com/shahed-b22d/career_ai_la/blob/main/database/migrations/2014_10_12_000000_create_users_table.php) (Schema & Migrations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry & Routing"]
  node_public_index["Front Door<br/>entrypoint<br/>[index.php]"]
  node_web_routes["Web Routes<br/>route map<br/>[web.php]"]
  node_api_routes["API Routes<br/>route map<br/>[api.php]"]
end

subgraph group_http["HTTP Layer"]
  node_http_kernel["HTTP Kernel<br/>middleware stack<br/>[Kernel.php]"]
  node_auth_mw["Auth Gate<br/>middleware<br/>[Authenticate.php]"]
  node_admin_mw["Admin Gate<br/>middleware<br/>[EnsureAdmin.php]"]
  node_auth_ctrl["Auth Controller<br/>[AuthController.php]"]
  node_job_ctrl["Jobs Controller<br/>[JobController.php]"]
  node_complaint_ctrl["Complaint Controller"]
  node_admin_ctrl["Admin Controller"]
  node_ai_ctrl["AI Controller<br/>[AiController.php]"]
end

subgraph group_domain["Core Domain"]
  node_user_identity(("Users & Profiles<br/>models<br/>[User.php]"))
  node_marketplace(("Jobs & Shortlists<br/>models<br/>[Job.php]"))
  node_moderation(("Complaints<br/>model<br/>[Complaint.php]"))
  node_career_ai_models(("Career Data<br/>models<br/>[UserResume.php]"))
end

subgraph group_ai["AI & Notifications"]
  node_ai_service["AI Career Service"]
  node_fcm_service["FCM Service<br/>[FcmService.php]"]
  node_reset_notice["Reset Notice<br/>notification"]
end

subgraph group_data["Data & Storage"]
  node_schema[("Schema & Migrations<br/>database schema")]
  node_storage["Storage Layer<br/>filesystem"]
end

subgraph group_ui["Presentation"]
  node_views["Blade Views<br/>presentation<br/>[welcome.blade.php]"]
  node_assets["Frontend Assets<br/>frontend build<br/>[app.js]"]
end

subgraph group_ops["Operations"]
  node_scheduler["Console Scheduler<br/>scheduled job<br/>[Kernel.php]"]
  node_motivational_cmd["Motivation Command<br/>artisan command"]
  node_config["Platform Config<br/>configuration<br/>[app.php]"]
  node_tests["Verification<br/>tests<br/>[ExampleTest.php]"]
end

node_public_index -->|"serves web"| node_web_routes
node_public_index -->|"serves api"| node_api_routes
node_web_routes -->|"uses middleware"| node_http_kernel
node_api_routes -->|"uses middleware"| node_http_kernel
node_http_kernel -->|"auth checks"| node_auth_mw
node_http_kernel -->|"admin gate"| node_admin_mw
node_web_routes -->|"auth flow"| node_auth_ctrl
node_api_routes -->|"token auth"| node_auth_ctrl
node_web_routes -->|"marketplace"| node_job_ctrl
node_api_routes -->|"job api"| node_job_ctrl
node_web_routes -->|"support flow"| node_complaint_ctrl
node_web_routes -->|"moderation"| node_admin_ctrl
node_api_routes -->|"ai api"| node_ai_ctrl
node_auth_ctrl -->|"manages"| node_user_identity
node_job_ctrl -->|"manages"| node_marketplace
node_complaint_ctrl -->|"creates"| node_moderation
node_admin_ctrl -->|"resolves"| node_moderation
node_ai_ctrl -->|"reads/writes"| node_career_ai_models
node_ai_ctrl -->|"delegates"| node_ai_service
node_ai_service -->|"analyzes"| node_career_ai_models
node_ai_service -->|"stores files"| node_storage
node_fcm_service -->|"push tokens"| node_user_identity
node_reset_notice -->|"mail config"| node_config
node_scheduler -->|"runs"| node_motivational_cmd
node_motivational_cmd -->|"sends push"| node_fcm_service
node_schema -->|"defines"| node_user_identity
node_schema -->|"defines"| node_marketplace
node_schema -->|"defines"| node_career_ai_models
node_schema -->|"defines"| node_moderation
node_views -->|"rendered by"| node_web_routes
node_assets -->|"enhances"| node_views
node_config -->|"shapes runtime"| node_http_kernel
node_tests -->|"verifies"| node_web_routes
node_tests -->|"verifies"| node_api_routes
node_tests -->|"probes"| node_ai_service

click node_public_index "https://github.com/shahed-b22d/career_ai_la/blob/main/public/index.php"
click node_web_routes "https://github.com/shahed-b22d/career_ai_la/blob/main/routes/web.php"
click node_api_routes "https://github.com/shahed-b22d/career_ai_la/blob/main/routes/api.php"
click node_http_kernel "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Kernel.php"
click node_auth_mw "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Middleware/Authenticate.php"
click node_admin_mw "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Middleware/EnsureAdmin.php"
click node_auth_ctrl "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/AuthController.php"
click node_job_ctrl "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/JobController.php"
click node_complaint_ctrl "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/ComplaintController.php"
click node_admin_ctrl "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/AdminController.php"
click node_ai_ctrl "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/AiController.php"
click node_user_identity "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Models/User.php"
click node_marketplace "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Models/Job.php"
click node_moderation "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Models/Complaint.php"
click node_career_ai_models "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Models/UserResume.php"
click node_ai_service "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Services/AiCareerService.php"
click node_fcm_service "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Services/FcmService.php"
click node_reset_notice "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Notifications/ResetPasswordNotification.php"
click node_scheduler "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Console/Kernel.php"
click node_motivational_cmd "https://github.com/shahed-b22d/career_ai_la/blob/main/app/Console/Commands/SendMotivationalNotifications.php"
click node_schema "https://github.com/shahed-b22d/career_ai_la/blob/main/database/migrations/2014_10_12_000000_create_users_table.php"
click node_storage "https://github.com/shahed-b22d/career_ai_la/tree/main/storage/app/public"
click node_views "https://github.com/shahed-b22d/career_ai_la/blob/main/resources/views/welcome.blade.php"
click node_assets "https://github.com/shahed-b22d/career_ai_la/blob/main/resources/js/app.js"
click node_config "https://github.com/shahed-b22d/career_ai_la/blob/main/config/app.php"
click node_tests "https://github.com/shahed-b22d/career_ai_la/blob/main/tests/Feature/ExampleTest.php"

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_web_routes,node_api_routes,node_scheduler,node_motivational_cmd,node_config,node_tests toneBlue
class node_http_kernel,node_auth_mw,node_admin_mw,node_auth_ctrl,node_job_ctrl,node_complaint_ctrl,node_admin_ctrl,node_ai_ctrl toneAmber
class node_user_identity,node_marketplace,node_moderation,node_career_ai_models toneMint
class node_ai_service,node_fcm_service,node_reset_notice toneRose
class node_schema,node_storage toneIndigo
class node_views,node_assets toneTeal
```

## Components

### Entry & Routing

HTTP front door and route split

- [Front Door](https://github.com/shahed-b22d/career_ai_la/blob/main/public/index.php): entrypoint · Laravel HTTP entry point · `public/index.php`
- [Web Routes](https://github.com/shahed-b22d/career_ai_la/blob/main/routes/web.php): route map · Browser-facing routes · `routes/web.php`
- [API Routes](https://github.com/shahed-b22d/career_ai_la/blob/main/routes/api.php): route map · JSON and token routes · `routes/api.php`

### HTTP Layer

Middleware, controllers, and request handling

- [HTTP Kernel](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Kernel.php): middleware stack · Global middleware and request pipeline · `app/Http/Kernel.php`
- [Auth Gate](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Middleware/Authenticate.php): middleware · Authentication and guest redirects · `app/Http/Middleware/Authenticate.php`
- [Admin Gate](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Middleware/EnsureAdmin.php): middleware · Admin-only access check · `app/Http/Middleware/EnsureAdmin.php`
- [Auth Controller](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/AuthController.php): controller · Login, registration, and reset flows · `app/Http/Controllers/AuthController.php`
- [Jobs Controller](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/JobController.php): controller · Listing and marketplace actions · `app/Http/Controllers/JobController.php`
- [Complaint Controller](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/ComplaintController.php): controller · Support and moderation cases · `app/Http/Controllers/ComplaintController.php`
- [Admin Controller](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/AdminController.php): controller · Admin moderation and review flows · `app/Http/Controllers/AdminController.php`
- [AI Controller](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Http/Controllers/AiController.php): controller · Career AI endpoints · `app/Http/Controllers/AiController.php`

### Core Domain

Marketplace, identity, and moderation models

- [Users & Profiles](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Models/User.php): models · User, seeker, and company identity · `app/Models/User.php`
- [Jobs & Shortlists](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Models/Job.php): models · Jobs and candidate selection workflow · `app/Models/Job.php`
- [Complaints](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Models/Complaint.php): model · Support and admin review cases · `app/Models/Complaint.php`
- [Career Data](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Models/UserResume.php): models · Resumes, roadmaps, and quizzes · `app/Models/UserResume.php`

### AI & Notifications

Career AI and outbound messaging

- [AI Career Service](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Services/AiCareerService.php): service · Provider-facing career intelligence layer · `app/Services/AiCareerService.php`
- [FCM Service](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Services/FcmService.php): service · Push notification integration · `app/Services/FcmService.php`
- [Reset Notice](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Notifications/ResetPasswordNotification.php): notification · Password reset email notification · `app/Notifications/ResetPasswordNotification.php`

### Data & Storage

Schema, persistence, and file storage

- [Schema & Migrations](https://github.com/shahed-b22d/career_ai_la/blob/main/database/migrations/2014_10_12_000000_create_users_table.php): database schema · Relational tables and role/verification fields · `database/migrations/2014_10_12_000000_create_users_table.php`
- [Storage Layer](https://github.com/shahed-b22d/career_ai_la/tree/main/storage/app/public): filesystem · Uploaded resumes and documents · `storage/app/public`

### Presentation

Blade views and frontend assets

- [Blade Views](https://github.com/shahed-b22d/career_ai_la/blob/main/resources/views/welcome.blade.php): presentation · Server-rendered pages and auth views · `resources/views/welcome.blade.php`
- [Frontend Assets](https://github.com/shahed-b22d/career_ai_la/blob/main/resources/js/app.js): frontend build · Vite-bundled JS and CSS · `resources/js/app.js`

### Operations

Console scheduling, config, and verification

- [Console Scheduler](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Console/Kernel.php): scheduled job · Motivational notification command · `app/Console/Kernel.php`
- [Motivation Command](https://github.com/shahed-b22d/career_ai_la/blob/main/app/Console/Commands/SendMotivationalNotifications.php): artisan command · Background outreach job · `app/Console/Commands/SendMotivationalNotifications.php`
- [Platform Config](https://github.com/shahed-b22d/career_ai_la/blob/main/config/app.php): configuration · Auth, mail, Sanctum, CORS, and services · `config/app.php`
- [Verification](https://github.com/shahed-b22d/career_ai_la/blob/main/tests/Feature/ExampleTest.php): tests · HTTP probes and automated tests · `tests/Feature/ExampleTest.php`

## Connections

- Front Door → Web Routes: serves web · Requests enter via the web route file
- Front Door → API Routes: serves api · Requests enter via the API route file
- Web Routes → HTTP Kernel: uses middleware · Web routes run through the HTTP kernel
- API Routes → HTTP Kernel: uses middleware · API routes run through the HTTP kernel
- HTTP Kernel → Auth Gate: auth checks · Authentication is enforced in the middleware stack
- HTTP Kernel → Admin Gate: admin gate · Admin-only access is enforced via middleware
- Web Routes → Auth Controller: auth flow · Browser auth actions are routed here
- API Routes → Auth Controller: token auth · API auth endpoints share the same controller boundary
- Web Routes → Jobs Controller: marketplace · Job browsing and management routes
- API Routes → Jobs Controller: job api · Job data exposed through JSON endpoints
- Web Routes → Complaint Controller: support flow · Complaint submission and tracking
- Web Routes → Admin Controller: moderation · Admin review workflows
- API Routes → AI Controller: ai api · AI career endpoints
- Auth Controller → Users & Profiles: manages · Authentication centers on the user identity model
- Jobs Controller → Jobs & Shortlists: manages · Jobs and shortlist workflows
- Complaint Controller → Complaints: creates · Complaint lifecycle management
- Admin Controller → Complaints: resolves · Admin moderation acts on complaints
- AI Controller → Career Data: reads/writes · Career AI works with resumes, roadmaps, and quizzes
- AI Controller → AI Career Service: delegates · Controller delegates provider-specific work to the service
- AI Career Service → Career Data: analyzes · AI service processes user career data
- AI Career Service → Storage Layer: stores files · Generated outputs and uploaded documents live in storage
- FCM Service → Users & Profiles: push tokens · FCM delivery is tied to user records
- Reset Notice → Platform Config: mail config · Password reset uses mail settings
- Console Scheduler → Motivation Command: runs · Scheduler executes the notification command
- Motivation Command → FCM Service: sends push · Motivational notifications are delivered via FCM
- Schema & Migrations → Users & Profiles: defines · Migrations define the identity and role schema
- Schema & Migrations → Jobs & Shortlists: defines · Migrations define jobs and shortlist tables
- Schema & Migrations → Career Data: defines · Migrations define AI/career-planning tables
- Schema & Migrations → Complaints: defines · Migrations define complaint and admin fields
- Blade Views → Web Routes: rendered by · Blade views are reached through web routes
- Frontend Assets → Blade Views: enhances · Vite assets support the rendered pages
- Platform Config → HTTP Kernel: shapes runtime · Platform config influences middleware and HTTP behavior
- Verification → Web Routes: verifies · Feature tests and HTTP probes exercise web endpoints
- Verification → API Routes: verifies · Feature tests and HTTP probes exercise API endpoints
- Verification → AI Career Service: probes · Standalone scripts validate AI integrations
