Concept and Architecture

12003

WechatIMG142.png

The JianghuJS architecture is meticulously designed to meet the high standards required for enterprise-level application development. Its architecture is primarily divided into three layers: the front-end interface layer, the back-end logic layer, and the database access layer. This layered design not only ensures high cohesion and low coupling within the system but also provides robust scalability and flexibility.

Concept

Front-end Interface Layer (Page)

The front-end interface layer centers around the _ui table, which uniformly manages all front-end actions, including user interface changes and data request handling. By enabling uiAction, developers can execute methods defined in uiActionConfig through simple API calls, thereby achieving complex user interactions and data processing.

Back-end Interface Layer (Resource)

The back-end logic layer focuses on processing business logic and integrating middleware. The Resource layer offers flexible business processing strategies, allowing developers to choose between SQL or Service for data processing based on actual needs. The use of middleware provides extension points before and after request handling, enabling developers to easily implement common logic processing and permission validation features.

Data Layer (Mysql)

The database access layer simplifies data access and query operations by introducing the concept of views. The use of views not only helps standardize the development process but also enhances the efficiency of data operations, making data joins and custom statistics simple and quick.

Architecture Scalability

Front-end Scalability

  • Custom Login Page: Developers can customize the login page in the project directory to meet specific branding and design requirements.
  • Custom Navigation Bar: The style and layout of the navigation bar can be personalized according to project needs to provide a consistent user experience.
  • Custom Templates: Customization of the template layer allows developers to adjust page structure and layout based on business needs, achieving a unique user interface.

Back-end Scalability

  • Custom Middleware: Developers can create middleware based on business requirements to enhance the flexibility and reusability of request handling.
  • Custom Service: Customization of the service layer provides complete control over business logic, allowing developers to rewrite service logic according to project needs.

Database Scalability

JianghuJS supports developers in selecting and replacing databases according to project requirements. It defaults to using MySQL but also supports other relational databases such as MariaDB and Percona Server, ensuring high performance and reliability for the project.