How phuclacloi/skill_up_group6 works
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: Client Client controllers · index.js Router · api.php API routes · axiosClient.js Axios client
Components 18
Laravel backend
API, auth, domain models, persistence, and infrastructure services.
- Public entry · HTTP entrypoint that boots the Laravel app.
BE_Skillup/public/index.php - API routes · Request routing for web and API endpoints.
BE_Skillup/routes/api.php - Admin controllers · Admin auth, dashboard, course content, and order management endpoints.
BE_Skillup/app/Http/Controllers/Admin - Client controllers · Customer auth, browsing, checkout, and learning flows.
BE_Skillup/app/Http/Controllers/Client - Access gates · Admin and customer boundary checks at the HTTP layer.
BE_Skillup/app/Http/Middleware - Domain models · Course-commerce entities, enrollment, orders, and progress tracking.
BE_Skillup/app/Models - MySQL schema · Migrations, seeders, and token storage shaping the application data model.
BE_Skillup/database/migrations - Auth & tokens · Session/token authentication and separate admin/customer identities.
BE_Skillup/config/sanctum.php - Email service · Transactional email for customer activation and onboarding.
BE_Skillup/app/Mail/MasterMail.php - File storage · Public storage link and lesson material file delivery.
BE_Skillup/config/filesystems.php - Laravel 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 · Vite bootstraps the Vue application.
FE_skillUP/src/main.js - Router · Client-side navigation for public, auth, admin, and profile flows.
FE_skillUP/src/router/index.js - Axios client · Centralized HTTP client for backend API calls.
FE_skillUP/src/api/axiosClient.js - Layouts · Client, admin, and profile shells that frame the SPA sections.
FE_skillUP/src/layouts - Public views · Home, course detail, login, register, and account activation screens.
FE_skillUP/src/views/client - Admin views · Dashboard, course/content management, and order management screens.
FE_skillUP/src/views/admin - Profile views · Personal profile, password change, and enrolled courses pages.
FE_skillUP/src/views/client/profile
Connections 23
- 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.