# harmeet1994/demo-project architecture

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

- Interactive diagram: https://gitdiagram.com/harmeet1994/demo-project
- Repository: https://github.com/harmeet1994/demo-project

## Overview

1. This is a Laravel monolith with a mixed rendering model: the public-facing application is built with React via Inertia, while the admin area uses traditional Blade templates. The repo is not API-first; controllers directly render pages and manage form submissions.

2. HTTP entry starts at `public/index.php`, flows through Laravel middleware in `app/Http/Kernel.php`, and is split by route files in `routes/web.php`, `routes/auth.php`, and `routes/api.php`. `HandleInertiaRequests` is the key bridge between Laravel and the React frontend.

3. The public app lives in `resources/js`: `Pages`, `Components`, `Layouts`, `Contexts`, and `hooks` define the user-facing UI. React pages such as Home, Blogs, Jobs, CourseInquiry, ContactUs, and profile/auth screens are compiled by Vite into `public/build`.

4. The admin console is a separate boundary. `resources/views/admin/**` contains Blade screens, backed by `app/Http/Controllers/Admin/**` and protected by `AdminMiddleware`. It covers dashboard, users, blogs, jobs, course registrations, course inquiries, campus inquiries, and job applications.

5. Domain persistence is centered on Eloquent models and migrations. Main entities include `User`, `Organization`, `Blog`, `JobMaster`, `JobApplication`, `JobInteraction`, `CourseRegistration`, `CourseInquiry`, and `CampusInquiry`, plus the `is_admin` user flag. The architecture is a relational CRUD application with audit/review workflows around submissions.

6. Authentication is a major subsystem. There are separate controllers for standard user auth and admin login, plus registration, password reset, email verification, and profile management. `Sanctum` is present in config and migrations, indicating token support in addition to session-based web auth.

7. The public data-entry flows are lead-generation oriented: course inquiries, campus inquiries, job applications, organization submissions, and blog browsing. These flows are handled by dedicated controllers and then reviewed in the admin area, making the app a content-and-intake platform rather than a purely transactional site.

8. Jobs are a dedicated product area. Public job pages and application forms are implemented in React, while the backend stores job metadata and applications. Uploaded resume files appear in `public/resumes`, so file storage is part of the job-application flow.

9. There is also a payment/checkout-related path: `PaymentController` and the frontend `PaymentFailed` / `ThankYou` pages indicate a transactional flow with success/failure outcomes. The exact gateway is not visible in the tree, but the architecture clearly separates payment handling from content pages.

10. Google sign-in or OAuth is integrated through `GoogleController`, and mail-based account flows are supported by Laravel’s verification/reset controllers. These external touchpoints are part of the account boundary, not the core content model.

11. Static and built assets are intentionally split: legacy/vendor assets live under `public/assets`, while modern app bundles are produced into `public/build` from `resources/js` and `resources/css`. This suggests the app serves both prebuilt theme assets and a React SPA-like experience inside Laravel.

12. Tests are mostly framework feature tests for auth and profile behavior, so the repo emphasizes web-session correctness and user lifecycle rather than heavy domain-unit coverage. The overall diagram should show one Laravel backend, one React/Inertia frontend, and one Blade-based admin side sharing the same database and file storage.

Main entry points: [`routes/web.php`](https://github.com/harmeet1994/demo-project/blob/main/routes/web.php) (Web routes), [`resources/js/Pages`](https://github.com/harmeet1994/demo-project/tree/main/resources/js/Pages) (Pages), [`app/Http/Controllers`](https://github.com/harmeet1994/demo-project/tree/main/app/Http/Controllers) (Public controllers), [`app/Http/Kernel.php`](https://github.com/harmeet1994/demo-project/blob/main/app/Http/Kernel.php) (Kernel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Laravel backend"]
  node_public_index["Entry point<br/>HTTP bootstrap<br/>[index.php]"]
  node_kernel["Kernel<br/>middleware stack<br/>[Kernel.php]"]
  node_handle_inertia["Inertia bridge<br/>middleware"]
  node_admin_middleware["Admin guard<br/>middleware"]
  node_web_routes["Web routes<br/>route map<br/>[web.php]"]
  node_auth_routes["Auth routes<br/>route map<br/>[auth.php]"]
  node_api_routes["API routes<br/>route map<br/>[api.php]"]
  node_public_controllers["Public controllers<br/>web controllers"]
  node_auth_controllers["Auth controllers"]
end

subgraph group_frontend["React/Inertia frontend"]
  node_react_pages["Pages<br/>React views"]
  node_react_components["Components<br/>shared UI"]
  node_react_layouts["Layouts<br/>React shells"]
  node_react_contexts["Contexts<br/>state context"]
  node_built_assets["Built assets<br/>Vite bundles"]
end

subgraph group_admin["Admin console"]
  node_admin_controllers["Admin controllers"]
  node_blade_admin_views["Admin views<br/>Blade screens"]
end

subgraph group_data["Persistence"]
  node_models[("Domain models<br/>Eloquent models")]
  node_migrations[("Migrations<br/>schema history")]
end

subgraph group_storage["File assets"]
  node_resumes["Resume files<br/>uploaded files"]
  node_legacy_assets["Legacy assets<br/>static assets"]
end

node_public_index -->|"boot"| node_kernel
node_kernel -->|"shares"| node_handle_inertia
node_kernel -->|"guards admin"| node_admin_middleware
node_kernel -->|"dispatches"| node_web_routes
node_web_routes -->|"public flows"| node_public_controllers
node_web_routes -->|"admin flows"| node_admin_controllers
node_web_routes -->|"render react"| node_handle_inertia
node_web_routes -->|"render blade"| node_blade_admin_views
node_auth_routes -->|"auth flows"| node_auth_controllers
node_api_routes -->|"api handlers"| node_public_controllers
node_public_controllers -->|"reads/writes"| node_models
node_admin_controllers -->|"manages"| node_models
node_auth_controllers -->|"users"| node_models
node_models -->|"schema"| node_migrations
node_public_controllers -->|"inertia pages"| node_react_pages
node_react_pages -->|"compose"| node_react_components
node_react_pages -->|"wrap"| node_react_layouts
node_react_pages -->|"state"| node_react_contexts
node_react_pages -->|"compiled to"| node_built_assets
node_blade_admin_views -->|"uses"| node_legacy_assets
node_public_controllers -->|"uploads"| node_resumes

click node_public_index "https://github.com/harmeet1994/demo-project/blob/main/public/index.php"
click node_kernel "https://github.com/harmeet1994/demo-project/blob/main/app/Http/Kernel.php"
click node_handle_inertia "https://github.com/harmeet1994/demo-project/blob/main/app/Http/Middleware/HandleInertiaRequests.php"
click node_admin_middleware "https://github.com/harmeet1994/demo-project/blob/main/app/Http/Middleware/AdminMiddleware.php"
click node_web_routes "https://github.com/harmeet1994/demo-project/blob/main/routes/web.php"
click node_auth_routes "https://github.com/harmeet1994/demo-project/blob/main/routes/auth.php"
click node_api_routes "https://github.com/harmeet1994/demo-project/blob/main/routes/api.php"
click node_public_controllers "https://github.com/harmeet1994/demo-project/tree/main/app/Http/Controllers"
click node_admin_controllers "https://github.com/harmeet1994/demo-project/tree/main/app/Http/Controllers/Admin"
click node_auth_controllers "https://github.com/harmeet1994/demo-project/tree/main/app/Http/Controllers/Auth"
click node_react_pages "https://github.com/harmeet1994/demo-project/tree/main/resources/js/Pages"
click node_react_components "https://github.com/harmeet1994/demo-project/tree/main/resources/js/Components"
click node_react_layouts "https://github.com/harmeet1994/demo-project/tree/main/resources/js/Layouts"
click node_react_contexts "https://github.com/harmeet1994/demo-project/tree/main/resources/js/Contexts"
click node_blade_admin_views "https://github.com/harmeet1994/demo-project/tree/main/resources/views/admin"
click node_models "https://github.com/harmeet1994/demo-project/tree/main/app/Models"
click node_migrations "https://github.com/harmeet1994/demo-project/tree/main/database/migrations"
click node_resumes "https://github.com/harmeet1994/demo-project/tree/main/public/resumes"
click node_built_assets "https://github.com/harmeet1994/demo-project/tree/main/public/build"
click node_legacy_assets "https://github.com/harmeet1994/demo-project/tree/main/public/assets"

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_kernel,node_handle_inertia,node_admin_middleware,node_web_routes,node_auth_routes,node_api_routes,node_public_controllers,node_auth_controllers toneBlue
class node_react_pages,node_react_components,node_react_layouts,node_react_contexts,node_built_assets toneAmber
class node_admin_controllers,node_blade_admin_views toneMint
class node_models,node_migrations toneRose
class node_resumes,node_legacy_assets toneIndigo
```

## Components

### Laravel backend

HTTP entry, middleware, routing, controllers, and domain models.

- [Entry point](https://github.com/harmeet1994/demo-project/blob/main/public/index.php): HTTP bootstrap · Web requests enter Laravel here before routing and middleware. · `public/index.php`
- [Kernel](https://github.com/harmeet1994/demo-project/blob/main/app/Http/Kernel.php): middleware stack · Registers and runs the HTTP middleware pipeline. · `app/Http/Kernel.php`
- [Inertia bridge](https://github.com/harmeet1994/demo-project/blob/main/app/Http/Middleware/HandleInertiaRequests.php): middleware · Shares data and connects Laravel responses to React pages. · `app/Http/Middleware/HandleInertiaRequests.php`
- [Admin guard](https://github.com/harmeet1994/demo-project/blob/main/app/Http/Middleware/AdminMiddleware.php): middleware · Protects the admin boundary. · `app/Http/Middleware/AdminMiddleware.php`
- [Web routes](https://github.com/harmeet1994/demo-project/blob/main/routes/web.php): route map · Primary route split for browser-driven flows. · `routes/web.php`
- [Auth routes](https://github.com/harmeet1994/demo-project/blob/main/routes/auth.php): route map · Dedicated authentication and account routes. · `routes/auth.php`
- [API routes](https://github.com/harmeet1994/demo-project/blob/main/routes/api.php): route map · Programmatic endpoints for token or API access. · `routes/api.php`
- [Public controllers](https://github.com/harmeet1994/demo-project/tree/main/app/Http/Controllers): web controllers · Controllers for content, intake, payment, profile, and OAuth flows. · `app/Http/Controllers`
- [Auth controllers](https://github.com/harmeet1994/demo-project/tree/main/app/Http/Controllers/Auth): auth controllers · Session login, registration, verification, password reset, and admin login. · `app/Http/Controllers/Auth`

### React/Inertia frontend

Public user interface built from React pages and shared components.

- [Pages](https://github.com/harmeet1994/demo-project/tree/main/resources/js/Pages): React views · Route-level public pages and auth screens rendered via Inertia. · `resources/js/Pages`
- [Components](https://github.com/harmeet1994/demo-project/tree/main/resources/js/Components): shared UI · Reusable public UI controls and page fragments. · `resources/js/Components`
- [Layouts](https://github.com/harmeet1994/demo-project/tree/main/resources/js/Layouts): React shells · Shared app shells for guest and authenticated views. · `resources/js/Layouts`
- [Contexts](https://github.com/harmeet1994/demo-project/tree/main/resources/js/Contexts): state context · Client-side application state boundary. · `resources/js/Contexts`
- [Built assets](https://github.com/harmeet1994/demo-project/tree/main/public/build): Vite bundles · Compiled React and CSS output served to the browser. · `public/build`

### Admin console

Blade-based management screens and admin controllers.

- [Admin controllers](https://github.com/harmeet1994/demo-project/tree/main/app/Http/Controllers/Admin): admin controllers · Controllers that manage back-office CRUD and review workflows. · `app/Http/Controllers/Admin`
- [Admin views](https://github.com/harmeet1994/demo-project/tree/main/resources/views/admin): Blade screens · Traditional server-rendered admin pages. · `resources/views/admin`

### Persistence

Relational entities, migrations, and token/auth storage.

- [Domain models](https://github.com/harmeet1994/demo-project/tree/main/app/Models): Eloquent models · Core relational entities for users, content, jobs, registrations, and inquiries. · `app/Models`
- [Migrations](https://github.com/harmeet1994/demo-project/tree/main/database/migrations): schema history · Database schema evolution including users, organizations, blogs, registrations, and tokens. · `database/migrations`

### File assets

Uploaded and built assets served from public storage.

- [Resume files](https://github.com/harmeet1994/demo-project/tree/main/public/resumes): uploaded files · Stored resume uploads used by the job application flow. · `public/resumes`
- [Legacy assets](https://github.com/harmeet1994/demo-project/tree/main/public/assets): static assets · Prebuilt theme assets and images used alongside the modern bundle. · `public/assets`

## Connections

- Entry point → Kernel: boot · Laravel boots the HTTP middleware pipeline.
- Kernel → Inertia bridge: shares · Inertia middleware participates in request handling.
- Kernel → Admin guard: guards admin · Admin access control is enforced in the web stack.
- Kernel → Web routes: dispatches · Web requests are routed after middleware.
- Web routes → Public controllers: public flows · Browser pages and submissions are handled here.
- Web routes → Admin controllers: admin flows · Back-office routes map to admin controllers.
- Web routes → Inertia bridge: render react · Public pages are bridged into Inertia responses.
- Web routes → Admin views: render blade · Admin screens are server-rendered templates.
- Auth routes → Auth controllers: auth flows · Session, registration, reset, and verification flows.
- API routes → Public controllers: api handlers · Programmatic endpoints share backend controllers.
- Public controllers → Domain models: reads/writes · Content, intake, and profile actions persist through models.
- Admin controllers → Domain models: manages · Admin CRUD and review actions operate on the same domain entities.
- Auth controllers → Domain models: users · Authentication centers on the user record and flags.
- Domain models → Migrations: schema · Models are backed by the relational schema.
- Public controllers → Pages: inertia pages · Controllers choose the public React page to display.
- Pages → Components: compose · Pages reuse shared UI components.
- Pages → Layouts: wrap · Pages are framed by shared layouts.
- Pages → Contexts: state · Client state is provided through React context.
- Pages → Built assets: compiled to · Vite bundles the frontend into public build assets.
- Admin views → Legacy assets: uses · Admin templates rely on legacy/static assets.
- Public controllers → Resume files: uploads · Job application flows store resume files.
