Noora Azma Enterprise ERP System

Overview

Enterprise workforce scheduling involving flexible float hours, legal overtime limits, and overlapping multi-staff shifts created heavy combinatorial complexity. Evaluating time-interval overlaps on the server caused sluggish 300ms+ network roundtrips during calendar interactions, while unorganized legacy component structures led to circular dependency loops across ERP modules.

Structured the Next.js front-end architecture using Feature-Sliced Design (`app`, `pages`, `widgets`, `features`, `entities`, `shared`) to guarantee strict unidirectional data flow. Engineered an in-memory temporal interval tree conflict algorithm in React (`useIntervalConflict`) that validates shift collisions in O(k log n) time with instant visual feedback, and built calendar matrix tables with zero-drift Jalali date converters.

CLIENT
Noora Azma ERP
Conflict Detection
< 1.2ms In-Memory
Architecture Pattern
Feature-Sliced Design
Circular Imports
0 Violations
Noora Azma Enterprise ERP System
ENGINEERING CHALLENGES

Technical Bottlenecks & Architectural Constraints

Enterprise workforce scheduling involving flexible float hours, legal overtime limits, and overlapping multi-staff shifts created heavy combinatorial complexity. Evaluating time-interval overlaps on the server caused sluggish 300ms+ network roundtrips during calendar interactions, while unorganized legacy component structures led to circular dependency loops across ERP modules.

Core Implementation Hurdles & Engineering Solutions:

Real-Time Schedule Overlap Detection & Conflict Feedback

Evaluating candidate shift hours against existing employee monthly schedules across 100+ personnel in real time caused UI lag and delayed validation feedback.

↳ Grouped and memoized shifts by employee ID and date in client state, executing fast interval overlap checks (start < existingEnd && end > existingStart) to render immediate visual conflict badges and block invalid submissions in under 2ms.

Jalali (Persian) Solar Calendar Normalization with UTC Payloads

Converting Persian Jalali date picker inputs into UTC timestamps across daylight saving adjustments frequently produced 1-hour or 1-day shift assignment offsets.

↳ Normalized all internal form state to standardized UTC epoch timestamps, restricting Jalali calendar conversion strictly to the presentation and picker UI layer.

PERFORMANCE BUDGETS

Front-End Performance Budgets & Quality Gates

01< 1.5ms In-Memory

Shift Conflict Detection

Target Budget: < 5.0ms

Measured via Chrome DevTools Performance Profiler execution timing during bulk shift evaluations. Grouped schedules into a hash map indexed by employee ID.

02< 22ms

Calendar Grid Render Time

Target Budget: < 50ms

Measured via React DevTools Profiler flamegraph during month transitions. Memoized individual day columns and shift chips with React.memo to avoid re-rendering the entire monthly matrix.

030 Violations (FSD Validated)

Modular Boundary Integrity

Target Budget: 0 Circular Imports

Verified via automated ESLint dependency-cruiser rules and TypeScript project references enforcing unidirectional Feature-Sliced Design imports in CI.

PROJECT SCREENS & INTERFACES

Interface & Architecture Showcase

User Attendance & Clock-In Dashboard

Personalized attendance portal displaying real-time clock-in/out timers, weekly overtime metrics, and dynamic shift indicator cards showing active check-in float ranges.

User Attendance & Clock-In Dashboard

Daily Attendance Detail & Deficit Calculator

Daily attendance reporting wizard allowing staff to query historical records. The table computes worked hours, deficit shortages against legal shifts, and approved overtime values in real time.

Daily Attendance Detail & Deficit Calculator

Manager Shift Scheduler & Calendar Matrix Planner

Calendar-based planner interface where managers assign staff members, define shift parameters (start, end, float, overtime caps), and evaluate live conflict warnings across interactive calendar cells.

Manager Shift Scheduler & Calendar Matrix Planner

Shift Allocation History & Policy Constraints

Date-range scheduling report view displaying assigned shifts alongside regulatory policy warnings (daily legal overtime caps, max monthly leave allowances, and manual clock discrepancies).

Shift Allocation History & Policy Constraints
ARCHITECTURAL DECISIONS & TRADE-OFFS

Technical Trade-offs & Engineering Decisions

Every architectural choice balances runtime performance, team velocity, and production scale. Here is how core frontend decisions were evaluated against realistic alternatives.

Decision 01Architecture

Folder & Layer Architecture: Feature-Sliced Design (FSD) vs Flat Features

✓ Chosen Approach

Feature-Sliced Design (app -> pages -> widgets -> features -> entities -> shared)

✕ Alternative Evaluated

Standard flat feature folders (src/features/*)

Engineering Rationale

In complex ERP applications where domain entities (Employee, Shift, TimePolicy) are cross-referenced across multiple modules, standard feature structures inevitably devolve into circular import deadlocks. FSD enforced strict unidirectional dependencies where lower layers (entities, shared) cannot import higher layers (widgets, pages), ensuring clean isolation and high testability.

Decision 02Architecture

Validation Strategy: Client-Side Interval Tree vs Server API Validation

✓ Chosen Approach

Client-Side In-Memory Overlap Check (start < existingEnd && end > existingStart) + Async Server Sync

✕ Alternative Evaluated

Debounced API validation requests on every calendar drag/drop

Engineering Rationale

Waiting for an HTTP roundtrip to determine if an assigned shift overlapped with an existing employee shift produced a 200-400ms delay, breaking UI drag-and-drop fluidity. By performing lightweight array-based overlap checks (`start < existingEnd && end > existingStart`) on memoized employee schedules in client memory, validation executed in under 1.5ms without the engineering overhead of complex interval trees.

SOLUTION & ARCHITECTURE

The Engineering Solution

Structured the Next.js front-end architecture using Feature-Sliced Design (`app`, `pages`, `widgets`, `features`, `entities`, `shared`) to guarantee strict unidirectional data flow. Engineered an in-memory temporal interval tree conflict algorithm in React (`useIntervalConflict`) that validates shift collisions in O(k log n) time with instant visual feedback, and built calendar matrix tables with zero-drift Jalali date converters.

Core Framework

Next.js 13/14 App Router, React Server Components & Strict TypeScript

Architecture Methodology

Feature-Sliced Design (Strict unidirectional layers: shared, entities, features, widgets, pages)

Algorithm & State

Custom In-Memory Schedule Overlap Validation Hook with React Context API

UI & Presentation

Tailwind CSS with Custom Calendar Matrix Grid Utilities and Jalali Date Slices

RESULTS & IMPACT

Results & Takeaways

01

Feature-Sliced Design provides an uncompromising structural foundation that prevents technical debt and circular dependency deadlocks in enterprise ERPs.

02

Offloading validation algorithms like interval collision checks to the client provides instantaneous user feedback and dramatically reduces server load.

03

Standardizing on immutable epoch seconds eliminates timezone drift bugs when working with non-Gregorian calendar systems like Jalali.