Frontend Architecture
The Ever Gauzy frontend is built with Angular (v19+) using the Nebular UI component library and ngx-admin dashboard template.
Application Structureβ
The primary web application is in apps/gauzy/:
apps/gauzy/
βββ src/
β βββ app/
β β βββ @core/ # Core services, guards, and interceptors
β β βββ @shared/ # Shared components, pipes, directives
β β βββ @theme/ # Theme definitions and layout components
β β βββ auth/ # Login, register, and password pages
β β βββ pages/ # Main application pages
β β β βββ dashboard/ # Dashboard views
β β β βββ employees/ # Employee management
β β β βββ time-tracker/ # Time tracking views
β β β βββ tasks/ # Task management
β β β βββ projects/ # Project views
β β β βββ invoices/ # Invoice management
β β β βββ expenses/ # Expense tracking
β β β βββ contacts/ # CRM contacts
β β β β ββ pipelines/ # Sales pipelines
β β β βββ candidates/ # ATS candidates
β β β βββ goals/ # Goals and KPIs
β β β βββ reports/ # Reports and analytics
β β β βββ settings/ # Organization settings
β β β βββ integrations/ # Third-party integrations
β β β βββ inventory/ # Inventory management
β β βββ app.module.ts # Root Angular module
β β βββ app-routing.module.ts # Root routing configuration
β β βββ app.component.ts # Root component
β βββ assets/ # Static assets (images, icons, i18n)
β βββ environments/ # Auto-generated environment configs
β βββ styles/ # Global SCSS stylesheets
βββ angular.json # Angular CLI configuration
βββ tsconfig.json # TypeScript configuration
Module Architectureβ
Lazy Loadingβ
Feature modules are lazy-loaded for performance:
// app-routing.module.ts
const routes: Routes = [
{
path: "pages",
loadChildren: () =>
import("./pages/pages.module").then((m) => m.PagesModule),
canActivate: [AuthGuard],
},
{
path: "auth",
loadChildren: () => import("./auth/auth.module").then((m) => m.AuthModule),
},
];
Core Module (@core/)β
Provides singleton services available throughout the application:
- AuthService β JWT token management, login/logout
- Store β global application state
- ServerDataSource β ng2-smart-table server-side data adapter
- HTTP Interceptors β automatic JWT attachment, error handling
- Guards β route guards for authentication and roles
Shared Module (@shared/)β
Reusable components, pipes, and directives:
- Components β header selectors, date pickers, status badges
- Pipes β moment/date formatting, currency formatting, truncation
- Directives β click outside, auto-focus, permission-based visibility
- Dialogs β confirmation, input, and custom modal dialogs
Theme Module (@theme/)β
Layout and theming infrastructure:
- Layouts β one-column, two-column, three-column layouts
- Header β top navigation bar with organization/project selectors
- Sidebar β collapsible navigation sidebar
- Theme Switcher β dark, light, corporate, material themes
UI Library Packagesβ
@gauzy/ui-coreβ
Core UI library shared across applications:
packages/ui-core/src/lib/
βββ core/ # Core services (ServerDataSource, etc.)
βββ shared/ # Shared components and modules
βββ common/ # Common utilities
βββ modules/ # Feature-specific UI modules
@gauzy/ui-configβ
Configuration and feature flag management for the UI:
- Environment detection (production, development, demo)
- Feature flag evaluation
- API URL configuration
@gauzy/ui-sdkβ
SDK for building external UI extensions and plugins.
State Managementβ
The application uses a combination of state management approaches:
1. Store Serviceβ
A central Store service manages global application state:
@Injectable({ providedIn: "root" })
export class Store {
// Selected organization
selectedOrganization$: BehaviorSubject<IOrganization>;
// Selected employee
selectedEmployee$: BehaviorSubject<ISelectedEmployee>;
// Selected project
selectedProject$: BehaviorSubject<IOrganizationProject>;
// Selected date range
selectedDateRange$: BehaviorSubject<IDateRangePicker>;
// Current user
user$: BehaviorSubject<IUser>;
}
2. Angular Servicesβ
Feature-specific services manage local state with RxJS:
@Injectable()
export class TimeTrackerService {
private timeLogs$ = new BehaviorSubject<ITimeLog[]>([]);
getTimeLogs(): Observable<ITimeLog[]> {
return this.timeLogs$.asObservable();
}
}
3. Route Stateβ
Route parameters and query params carry navigation state:
// Navigating with state
this.router.navigate(["/pages/employees", employeeId], {
queryParams: { date: this.selectedDate },
});
Header Selectorsβ
The application header provides contextual selectors that filter data across all pages:
- Organization Selector β switches between organizations (Admin-level users)
- Project Selector β filters data to specific project
- Employee Selector β filters data to specific employee (Admin view)
- Date Range Picker β filters time-based data by date range
These selectors emit values to the Store service, which all page components subscribe to.
Routing Structureβ
/ β Redirect to /pages/dashboard
/auth/login β Login page
/auth/register β Registration page
/auth/confirm-email β Email confirmation
/pages/
βββ dashboard/ β Main dashboard
βββ accounting/
β βββ invoices/ β Invoice management
β βββ income/ β Income tracking
β βββ expenses/ β Expense management
β βββ payments/ β Payment records
βββ employees/ β Employee list and profiles
βββ time-tracking/ β Time logs and timesheets
βββ tasks/ β Task board and list
βββ projects/ β Project management
βββ contacts/ β CRM contacts
βββ candidates/ β ATS candidate management
βββ goals/ β Goals and KPIs
βββ pipelines/ β Sales pipelines
βββ reports/ β Reports and analytics
βββ settings/ β Organization settings
βββ integrations/ β Third-party integration setup
βββ inventory/ β Product/inventory management
βββ jobs/ β Job board
Internationalization (i18n)β
The frontend supports multiple languages through @ngx-translate:
src/assets/i18n/
βββ en.json # English (default)
βββ es.json # Spanish
βββ fr.json # French
βββ ru.json # Russian
β ββ bg.json # Bulgarian
βββ he.json # Hebrew
βββ ar.json # Arabic
βββ pt.json # Portuguese
βββ zh.json # Chinese
βββ de.json # German
βββ ...
Usage in templates:
<span>{{ 'HEADER.ORGANIZATION' | translate }}</span>
Translations are managed via Crowdin for community contributions.
Themingβ
The application supports multiple themes via Nebular's Eva Design System:
| Theme | Description |
|---|---|
| Default (Light) | Light backgrounds, standard colors |
| Dark | Dark backgrounds, light text |
| Corporate | Professional, muted color palette |
| Material | Material Design-inspired theme |
| Custom | Custom themes via CSS variables |
Theme switching is handled by NbThemeService:
this.themeService.changeTheme("dark");
Build Configurationβ
Developmentβ
yarn start:ui # Start with hot reload on :4200
Production Buildβ
yarn build:gauzy # AOT-compiled production bundle
Build Optimizationβ
- AOT Compilation β ahead-of-time compilation for production
- Tree Shaking β removes unused code
- Lazy Loading β feature modules loaded on demand
- Bundle Splitting β vendor and main bundles separated
Related Pagesβ
- Architecture Overview β system-wide design
- State Management β detailed state patterns
- Theming β theme customization
- UI Components β component library
- i18n β internationalization setup