πŸ—οΈ Architecture

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:

Diagram; its source is available below
Diagram source
graph LR
    Logo["Logo"] --- Org["Organization β–Ό"]
    Org --- Proj["Project β–Ό"]
    Proj --- Emp["Employee β–Ό"]
    Emp --- Date["Date Range β–Ό"]
  • 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:

ThemeDescription
Default (Light)Light backgrounds, standard colors
DarkDark backgrounds, light text
CorporateProfessional, muted color palette
MaterialMaterial Design-inspired theme
CustomCustom 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

Edit this page

Copyright Β© 2023-Present Ever Co. LTD.Docs by Sourcey