# phuclacloi/skill_up_group6 architecture

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

- Interactive diagram: https://gitdiagram.com/phuclacloi/skill_up_group6
- Repository: https://github.com/phuclacloi/skill_up_group6

## Overview

1. This repository is a two-app split: a Laravel backend in `BE_Skillup` and a Vue 3 frontend in `FE_skillUP`. The backend owns authentication, business rules, persistence, uploads, and email. The frontend is the user-facing SPA that consumes backend APIs through Axios.

2. The backend entry path is the standard Laravel request pipeline: `public/index.php` → routing in `routes/web.php` and `routes/api.php` → controllers under `app/Http/Controllers`. The app also uses Laravel middleware for access control and standard service/config layers for database, mail, queue, filesystem, sessions, and Sanctum.

3. The frontend is a Vite-powered Vue app. `src/main.js` bootstraps the SPA, `src/router/index.js` defines navigation, and `src/api/axiosClient.js` centralizes HTTP calls to the backend. The UI is organized into layouts for client, admin, and profile flows, which mirrors the backend’s role separation.

4. The domain model is course-commerce oriented. Core tables and models cover `DanhMuc` (categories), `KhoaHoc` (courses), `ChuongHoc` (course chapters), `BaiHoc` (lessons), `KhachHang` (customers), `Admin`, `DonHang` (orders), `ChiTietDonHang` (order items), `DangKyKhoaHoc` (course enrollment), and `TiemDoBaiHoc` (lesson progress). This is the main data backbone for the architecture diagram.

5. The backend has two major bounded contexts: admin management and client/student experience. Admin controllers manage courses, chapters, lessons, orders, and dashboard/auth flows. Client controllers handle login/register, course browsing, checkout/order creation, and learning/progress tracking.

6. Access control is enforced at the HTTP boundary using custom middleware: `KiemTraAdmin` and `KiemTraKhachHang`. These separate the admin console from customer-facing pages and are the key authorization gates in the architecture.

7. Authentication is token/session-capable and appears to support API access via Laravel Sanctum, since `personal_access_tokens` exists and `config/sanctum.php` is present. The backend also defines separate `Admin` and `KhachHang` identities, so admin and customer authentication are not modeled as the same user type.

8. Email is part of the onboarding flow. `app/Mail/MasterMail.php` and the Blade template under `resources/views/emails/` indicate backend-driven transactional email, likely for customer account activation. That means registration is not just a local form submit; it includes an outbound notification step.

9. File and asset handling matter to the architecture because `storage:link` is required and the lesson schema was extended with `file_tai_lieu`. So the backend is also responsible for serving uploaded course materials and any related media through Laravel’s public storage link.

10. The database is seeded and migration-driven. The provided setup expects `php artisan migrate --seed`, and seeders exist for admins, categories, customers, courses, chapters, and lessons. This means the repo is designed to boot with representative sample content, which is useful when drawing the initial data flow and startup sequence.

11. The frontend views map directly to the business flows: public/home course browsing, course detail, checkout, learning area, login/register, account activation, and profile management. Admin views cover dashboard, course/content management, and order management. This makes the SPA a presentation layer over backend APIs rather than a separate business logic tier.

12. In diagram terms, the main flows are: browser → Vue SPA → Axios → Laravel API/controller → Eloquent models → MySQL database, with side flows from Laravel to email and file storage. The clearest system boundaries are presentation (Vue), application/business/API (Laravel controllers + middleware), and persistence/infrastructure (MySQL, storage, mail, Sanctum auth).

Main entry points: [`BE_Skillup/app/Http/Controllers/Client`](https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/app/Http/Controllers/Client) (Client controllers), [`FE_skillUP/src/router/index.js`](https://github.com/phuclacloi/skill_up_group6/blob/main/FE_skillUP/src/router/index.js) (Router), [`BE_Skillup/routes/api.php`](https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/routes/api.php) (API routes), [`FE_skillUP/src/api/axiosClient.js`](https://github.com/phuclacloi/skill_up_group6/blob/main/FE_skillUP/src/api/axiosClient.js) (Axios client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Laravel backend"]
  node_be_public_index["Public entry<br/>laravel-entry<br/>[index.php]"]
  node_be_routes["API routes<br/>route-map<br/>[api.php]"]
  node_be_admin_ctrl["Admin controllers<br/>admin-api"]
  node_be_client_ctrl["Client controllers<br/>client-api"]
  node_be_middleware{{"Access gates<br/>middleware"}}
  node_be_models[("Domain models<br/>eloquent-domain")]
  node_be_db[("MySQL schema<br/>migration-data")]
  node_be_auth{{"Auth & tokens<br/>sanctum-auth<br/>[sanctum.php]"}}
  node_be_mail["Email service<br/>mailout<br/>[MasterMail.php]"]
  node_be_storage[("File storage<br/>uploads<br/>[filesystems.php]")]
  node_be_pipeline["Laravel config<br/>runtime-config<br/>[app.php]"]
end

subgraph group_frontend["Vue frontend"]
  node_fe_main["SPA entry<br/>vite-bootstrap<br/>[main.js]"]
  node_fe_router["Router<br/>spa-routing<br/>[index.js]"]
  node_fe_api["Axios client<br/>api-client<br/>[axiosClient.js]"]
  node_fe_layouts["Layouts<br/>ui-shells"]
  node_fe_views_public["Public views<br/>client-ui"]
  node_fe_views_admin["Admin views<br/>admin-ui"]
  node_fe_views_profile["Profile views<br/>account-ui"]
end

node_be_public_index -->|"dispatches"| node_be_routes
node_be_routes -->|"admin"| node_be_admin_ctrl
node_be_routes -->|"client"| node_be_client_ctrl
node_be_routes -->|"guards"| node_be_middleware
node_be_admin_ctrl -->|"uses"| node_be_models
node_be_client_ctrl -->|"uses"| node_be_models
node_be_models -->|"persisted as"| node_be_db
node_be_client_ctrl -->|"auth"| node_be_auth
node_be_admin_ctrl -->|"auth"| node_be_auth
node_be_client_ctrl -->|"sends"| node_be_mail
node_be_client_ctrl -->|"uploads"| node_be_storage
node_be_pipeline -.->|"configures"| node_be_db
node_be_pipeline -.->|"configures"| node_be_mail
node_fe_main -->|"mounts"| node_fe_router
node_fe_main -->|"initializes"| node_fe_api
node_fe_router -->|"wraps"| node_fe_layouts
node_fe_router -->|"serves"| node_fe_views_public
node_fe_router -->|"serves"| node_fe_views_admin
node_fe_router -->|"serves"| node_fe_views_profile
node_fe_views_public -->|"calls"| node_fe_api
node_fe_views_admin -->|"calls"| node_fe_api
node_fe_views_profile -->|"calls"| node_fe_api
node_fe_api -->|"requests"| node_be_routes

click node_be_public_index "https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/public/index.php"
click node_be_routes "https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/routes/api.php"
click node_be_admin_ctrl "https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/app/Http/Controllers/Admin"
click node_be_client_ctrl "https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/app/Http/Controllers/Client"
click node_be_middleware "https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/app/Http/Middleware"
click node_be_models "https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/app/Models"
click node_be_db "https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/database/migrations"
click node_be_auth "https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/config/sanctum.php"
click node_be_mail "https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/app/Mail/MasterMail.php"
click node_be_storage "https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/config/filesystems.php"
click node_be_pipeline "https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/config/app.php"
click node_fe_main "https://github.com/phuclacloi/skill_up_group6/blob/main/FE_skillUP/src/main.js"
click node_fe_router "https://github.com/phuclacloi/skill_up_group6/blob/main/FE_skillUP/src/router/index.js"
click node_fe_api "https://github.com/phuclacloi/skill_up_group6/blob/main/FE_skillUP/src/api/axiosClient.js"
click node_fe_layouts "https://github.com/phuclacloi/skill_up_group6/tree/main/FE_skillUP/src/layouts"
click node_fe_views_public "https://github.com/phuclacloi/skill_up_group6/tree/main/FE_skillUP/src/views/client"
click node_fe_views_admin "https://github.com/phuclacloi/skill_up_group6/tree/main/FE_skillUP/src/views/admin"
click node_fe_views_profile "https://github.com/phuclacloi/skill_up_group6/tree/main/FE_skillUP/src/views/client/profile"

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_be_public_index,node_be_routes,node_be_admin_ctrl,node_be_client_ctrl,node_be_middleware,node_be_models,node_be_db,node_be_auth,node_be_mail,node_be_storage,node_be_pipeline toneBlue
class node_fe_main,node_fe_router,node_fe_api,node_fe_layouts,node_fe_views_public,node_fe_views_admin,node_fe_views_profile toneAmber
```

## Components

### Laravel backend

API, auth, domain models, persistence, and infrastructure services.

- [Public entry](https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/public/index.php): laravel-entry · HTTP entrypoint that boots the Laravel app. · `BE_Skillup/public/index.php`
- [API routes](https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/routes/api.php): route-map · Request routing for web and API endpoints. · `BE_Skillup/routes/api.php`
- [Admin controllers](https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/app/Http/Controllers/Admin): admin-api · Admin auth, dashboard, course content, and order management endpoints. · `BE_Skillup/app/Http/Controllers/Admin`
- [Client controllers](https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/app/Http/Controllers/Client): client-api · Customer auth, browsing, checkout, and learning flows. · `BE_Skillup/app/Http/Controllers/Client`
- [Access gates](https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/app/Http/Middleware): middleware · Admin and customer boundary checks at the HTTP layer. · `BE_Skillup/app/Http/Middleware`
- [Domain models](https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/app/Models): eloquent-domain · Course-commerce entities, enrollment, orders, and progress tracking. · `BE_Skillup/app/Models`
- [MySQL schema](https://github.com/phuclacloi/skill_up_group6/tree/main/BE_Skillup/database/migrations): migration-data · Migrations, seeders, and token storage shaping the application data model. · `BE_Skillup/database/migrations`
- [Auth & tokens](https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/config/sanctum.php): sanctum-auth · Session/token authentication and separate admin/customer identities. · `BE_Skillup/config/sanctum.php`
- [Email service](https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/app/Mail/MasterMail.php): mailout · Transactional email for customer activation and onboarding. · `BE_Skillup/app/Mail/MasterMail.php`
- [File storage](https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/config/filesystems.php): uploads · Public storage link and lesson material file delivery. · `BE_Skillup/config/filesystems.php`
- [Laravel config](https://github.com/phuclacloi/skill_up_group6/blob/main/BE_Skillup/config/app.php): runtime-config · Database, mail, queue, session, CORS, and app runtime settings. · `BE_Skillup/config/app.php`

### Vue frontend

Vite SPA, routing, layouts, and views.

- [SPA entry](https://github.com/phuclacloi/skill_up_group6/blob/main/FE_skillUP/src/main.js): vite-bootstrap · Vite bootstraps the Vue application. · `FE_skillUP/src/main.js`
- [Router](https://github.com/phuclacloi/skill_up_group6/blob/main/FE_skillUP/src/router/index.js): spa-routing · Client-side navigation for public, auth, admin, and profile flows. · `FE_skillUP/src/router/index.js`
- [Axios client](https://github.com/phuclacloi/skill_up_group6/blob/main/FE_skillUP/src/api/axiosClient.js): api-client · Centralized HTTP client for backend API calls. · `FE_skillUP/src/api/axiosClient.js`
- [Layouts](https://github.com/phuclacloi/skill_up_group6/tree/main/FE_skillUP/src/layouts): ui-shells · Client, admin, and profile shells that frame the SPA sections. · `FE_skillUP/src/layouts`
- [Public views](https://github.com/phuclacloi/skill_up_group6/tree/main/FE_skillUP/src/views/client): client-ui · Home, course detail, login, register, and account activation screens. · `FE_skillUP/src/views/client`
- [Admin views](https://github.com/phuclacloi/skill_up_group6/tree/main/FE_skillUP/src/views/admin): admin-ui · Dashboard, course/content management, and order management screens. · `FE_skillUP/src/views/admin`
- [Profile views](https://github.com/phuclacloi/skill_up_group6/tree/main/FE_skillUP/src/views/client/profile): account-ui · Personal profile, password change, and enrolled courses pages. · `FE_skillUP/src/views/client/profile`

## Connections

- Public entry → API routes: dispatches · Laravel request pipeline hands traffic to route definitions.
- API routes → Admin controllers: admin · Admin endpoints are mapped to backend admin controllers.
- API routes → Client controllers: client · Customer-facing endpoints are mapped to client controllers.
- API routes → Access gates: guards · Role boundaries are enforced around routed requests.
- Admin controllers → Domain models: uses · Admin actions read and write domain entities.
- Client controllers → Domain models: uses · Client flows operate on courses, orders, enrollment, and progress.
- Domain models → MySQL schema: persisted as · Eloquent models are backed by migrations and seeded data.
- Client controllers → Auth & tokens: auth · Customer and admin identity flow through token/session auth.
- Admin controllers → Auth & tokens: auth · Admin login and protected actions rely on auth configuration.
- Client controllers → Email service: sends · Registration and activation workflows trigger transactional email.
- Client controllers → File storage: uploads · Course materials and lesson files are served from storage.
- Laravel config → MySQL schema: configures · Database and runtime settings support the backend stack.
- Laravel config → Email service: configures · Mail transport is part of backend runtime setup.
- SPA entry → Router: mounts · The SPA entry initializes navigation.
- SPA entry → Axios client: initializes · Frontend bootstrapping wires the shared HTTP client.
- Router → Layouts: wraps · Routes are rendered inside shared application shells.
- Router → Public views: serves · Public routes point to browsing and auth screens.
- Router → Admin views: serves · Admin routes point to management screens.
- Router → Profile views: serves · Account routes point to profile and enrollment screens.
- Public views → Axios client: calls · Public screens consume backend APIs through Axios.
- Admin views → Axios client: calls · Admin screens use the shared API client.
- Profile views → Axios client: calls · Profile pages fetch and update data through the API client.
- Axios client → API routes: requests · Frontend HTTP traffic targets Laravel API routes.
