Shared UI Libraries
Relevant source files
The following files were used as context for generating this wiki page:
- packages/ui-core/src/index.ts
- packages/ui-auth/src/index.ts
- packages/desktop-ui-lib/src/index.ts
- packages/ui-core/package.json
- packages/desktop-ui-lib/package.json
- packages/ui-core/shared/src/index.ts
- packages/plugins/public-layout-ui/package.json
- packages/plugins/job-proposal-ui/package.json
- packages/plugins/legal-ui/package.json
- packages/desktop-ui-lib/src/lib/settings/plugins/component/plugin-marketplace/plugin-marketplace-item/plugin-marketplace-item.component.html
The Gauzy platform utilizes a modular, Angular-based architecture for its frontend applications. Central to this architecture are shared UI libraries that provide reusable components, directives, pipes, and services. This approach ensures a consistent user experience across different parts of the application, including the main web interface and the desktop applications, while promoting code reusability and simplifying development.
These libraries encapsulate common UI patterns and business logic, ranging from core components and theming to specialized features for desktop environments and pluggable modules. The system is built upon a foundation of popular open-source libraries like Angular, Nebular, and ngx-admin, providing a rich set of pre-built UI elements.
Core UI Libraries
Gauzy's UI is primarily structured around two core libraries: @gauzy/ui-core for the web application and @gauzy/desktop-ui-lib for the Electron-based desktop clients.
This diagram illustrates the dependency flow from applications to the shared UI libraries and their extension via plugins.
@gauzy/ui-core
This is the foundational UI library for the entire Gauzy framework. It contains a comprehensive collection of essential components, utilities, and modules required to build the main user interfaces.
- Purpose: To provide flexible and reusable building blocks for constructing user interfaces in Gauzy's Angular applications.
- Technology Stack: Built on Angular, it heavily leverages
@nebular/themefor theming and UI components, and integrates a wide array of third-party libraries for specific functionalities.
Sources: packages/ui-core/package.json:3-5
Key Dependencies
The power of @gauzy/ui-core comes from its integration of various specialized libraries:
| Library | Role |
|---|---|
@angular/core, @angular/common | Core framework for building components. |
@nebular/theme, @nebular/auth | Primary UI component library and authentication toolkit. |
angular2-smart-table | Provides powerful data grids. |
ng2-charts, echarts | Used for data visualization and reports. |
@ngx-translate/core | Handles internationalization (i18n). |
ngx-permissions | Manages role-based access control on the frontend. |
@datorama/akita | State management pattern. |
ckeditor4-angular | Rich text editor integration. |
@bluehalo/ngx-leaflet | Interactive maps. |
Sources: packages/ui-core/package.json:33-102
Exported Modules & Features
@gauzy/ui-core exports a vast number of feature-specific modules, components, and utilities. These are made available to the rest of the application through a shared entry point.
The diagram below shows a high-level view of the modular structure within @gauzy/ui-core.
A selection of key exported features includes:
| Feature Area | Description |
|---|---|
appointments | Components for scheduling and managing appointments. |
employee | UI for employee management, profiles, and rates. |
invoice | Components for creating, viewing, and managing invoices. |
organizations | UI for managing multiple organizations, departments, and teams. |
project | Components for project and task management. |
table-components / table-filters | Reusable components for data tables and filtering. |
tags | UI for creating and applying tags/labels. |
time-tracker / timesheet | Components for time tracking and timesheet management. |
dialogs | A set of common dialogs (e.g., confirmation, forms). |
pipes | Various data transformation pipes for use in templates. |
Sources: packages/ui-core/shared/src/index.ts:4-81
@gauzy/desktop-ui-lib
This library is specifically tailored for the Gauzy Desktop applications, built with Electron. It extends @gauzy/ui-core with desktop-specific functionalities.
- Purpose: To provide UI components and services needed for the Electron desktop environment, such as settings management, plugin marketplace UI, and native integrations.
- Key Dependencies: In addition to inheriting dependencies from
@gauzy/ui-core, it includes Electron-specific packages.
| Library | Role |
|---|---|
@electron/remote | Access Electron main process modules from the renderer process. |
electron-log | Logging for the desktop application. |
electron-store | Simple data persistence for the desktop app. |
@datorama/akita | State management, used extensively in the desktop UI. |
Sources: packages/desktop-ui-lib/package.json:3-5, 30-61
An example of a complex component within this library is the PluginMarketplaceItemComponent, which displays details for a single plugin, including its status, versions, source code information, and actions like install, uninstall, and update.
UI Plugins
Gauzy's frontend is extensible through a plugin system. Each UI plugin is an Angular library (ng-package) that provides a specific feature set. These plugins depend on @gauzy/ui-core for common components and services.
| Plugin Package | Description |
|---|---|
@gauzy/plugin-public-layout-ui | Provides reusable components and layouts for public-facing pages. |
@gauzy/plugin-job-proposal-ui | A UI plugin for managing job proposals. |
@gauzy/plugin-legal-ui | Provides components and modules for managing legal documents and agreements. |
@gauzy/plugin-maintenance-ui | UI for the application's maintenance mode. |
@gauzy/plugin-integration-make-com-ui | UI for integrating Make.com for automation workflows. |
Sources: packages/plugins/public-layout-ui/package.json:3, packages/plugins/job-proposal-ui/package.json:3, packages/plugins/legal-ui/package.json:3, packages/plugins/maintenance-ui/package.json:3, packages/plugins/integration-make-com-ui/package.json:3
Summary
The shared UI libraries are a cornerstone of the Gauzy platform's frontend architecture. By centralizing common UI components, styles, and logic into @gauzy/ui-core and extending it for specific environments like @gauzy/desktop-ui-lib, the project achieves a high degree of code reuse and visual consistency. This modular design, further enhanced by a plugin system, allows for scalable and maintainable development of a complex, feature-rich business management platform.