1. Giới thiệu



2. Kiến trúc hệ thống


Ứng dụng tuân thủ mô hình kiến trúc phân tán (distributed architecture), tách biệt rõ ràng giữa tầng trình bày (presentation layer) và tầng xử lý nghiệp vụ (business logic layer). Điều này giúp tăng khả năng maintainability, scalability, testability và đảm bảo separation of concerns.

+-------------------+         HTTP (RESTful API)         +-------------------+
|   Frontend (FE)   | <------------------------------->  |   Backend (BE)    |
|  Next.js / React  |                                    | Node.js / Express |
+-------------------+                                    +-------------------+
                                                                   |
                                                                   v
+-------------------+     +-------------------+     +-------------------+     +-------------------+     +-------------------+
|   Presentation,   |     |    Application    |     |      Domain       |     |  Infrastructure   |     |      Database     |
|   (controllers,   | --> |    (usecases,     | --> |     (entities,    | --> |  (repositories)   | --> |     (MongoDB)     |
|    middlewares,   |     |    validators)    |     |    repositories)  |     |                   |     |                   |
|    routes)        |     |                   |     |                   |     |                   |     |                   |
+-------------------+     +-------------------+     +-------------------+     +-------------------+     +-------------------+
         |                          |                         |                         |                        |
         +-------------------------------------------------------------------------------------------------------+
                                                              |
                                                   +---------------------+
                                                   |       Shared        |
                                                   | (constants, types,  |
                                                   |       utils)        |
                                                   +---------------------+

Hệ thống bao gồm 2 project:

Phía FE giao tiếp với phía BE thông qua giao thức HTTP (RESTful API).


3. Frontend (Next.js/React - Component-based Architecture)


Frontend sử dụng kiến trúc component-based, tách biệt rõ ràng giữa UI, logic xử lý và gọi API.

3.1. Tổng quan các thành phần

Components/Pages: