How fusion-hr-solution/fusion works
1. This repository is split into two major monorepos: a .NET backend under Backend/ and a Next.js/Turborepo frontend under Frontend/. The backend is service-oriented; the frontend is microfrontend-oriented.
2. The backend has four clear boundaries:
- EY.HRPlatform.Gateway as the single HTTP entry point
- EY.HRPlatform.Identity for authentication and user management
- EY.HRPlatform.Training for course/training APIs
- EY.HRPlatform.SharedKernel for shared domain and CQRS primitives
3. The gateway is an ASP.NET reverse proxy layer built with YARP. Its purpose is to sit in front of the services, enforce JWT validation on protected routes, add correlation IDs for request tracing, and handle cross-origin access from the frontend. In the architecture diagram, it is the main north-south traffic choke point.
4. The Identity service is the most fully implemented backend service. It contains controllers for auth and users, ASP.NET Identity-style persistence with EF Core, token issuance/rotation, a seeder, and migrations. Its domain model includes ApplicationUser, RefreshToken, and role concepts (Admin, HR, Employee, Manager), so it is both the auth provider and the user/RBAC source of truth.
5. The Training service is a separate Web API with a CoursesController, but from the repository contents it appears mostly scaffolded/stubbed compared with Identity. It still represents an independent bounded context behind the gateway and is intended to own learning/course data.
6. SharedKernel is the backend’s reusable foundation layer. It defines CQRS interfaces (ICommand, IQuery, handlers), base domain types (BaseEntity, AggregateRoot, domain events), a strongly typed value object (EmployeeId), a result/error pattern, and integration event contracts such as EmployeeCreatedIntegrationEvent. This indicates the backend is designed for domain-driven boundaries even though only some services are implemented.
7. The backend data flow is: frontend calls the gateway, the gateway routes the request to Identity or Training, and Identity persists to PostgreSQL via EF Core. Authentication flows go through login/register/refresh endpoints in Identity, with JWTs returned to the client and refresh tokens stored server-side. The presence of integration event types suggests future async/event-driven integration, but no broker is visible in the current tree.
8. The frontend is a microfrontend workspace managed by pnpm and Turborepo. It contains a shell app plus six domain apps: core, interview, learning, performance, recruitment, and onboarding. Each app is a separate Next.js application with its own page/layout/error/loading boundaries, while Frontend/packages/ui provides shared UI primitives used across apps.
9. The shell app is the host/entry point for the frontend experience. Per the README, it serves unified routing and proxies the individual MFEs under path prefixes such as /learning, /recruitment, and /onboarding. That makes shell the browser-facing composition layer, while each MFE owns its own domain screen and client-side service module.
10. Each frontend app follows the same internal shape: app router pages, domain-specific components, a small service layer, constants/hooks/types, and shared styling via Tailwind plus the shared UI package. This consistent structure means the architecture is replicated horizontally across MFEs rather than centralized in one frontend codebase.
11. Operationally, the repo depends on a few cross-cutting concerns that matter to the diagram: PostgreSQL for Identity persistence, JWT/refresh token auth, ASP.NET Identity for RBAC, Next.js for the browser layer, and YARP for service routing. The backend and frontend are independently runnable and independently deployable at the service/app level.
12. The most important diagram boundaries are therefore:
- Browser → shell / MFE apps
- Browser / shell API calls → Gateway
- Gateway → Identity / Training
- Identity → PostgreSQL
- SharedKernel consumed by backend services as a compile-time dependency, not as a runtime service
Main entry points: shell Shell · EY.HRPlatform.Identity Identity · EY.HRPlatform.SharedKernel SharedKernel · ui UI Package
Components 21
Backend
ASP.NET service-oriented monorepo
- Gateway · Single HTTP entry point; validates JWTs, adds correlation IDs, and routes traffic to backend services.
Backend/EY.HRPlatform.Gateway - Identity · Authentication and user management service; source of truth for users, roles, JWTs, and refresh tokens.
Backend/EY.HRPlatform.Identity - Training · Independent training bounded context with course APIs behind the gateway.
Backend/EY.HRPlatform.Training - SharedKernel · Reusable backend foundation for CQRS, domain primitives, value objects, results, and integration event contracts.
Backend/EY.HRPlatform.SharedKernel - Auth & Users · Identity HTTP surface for login, register, refresh, and user operations.
Backend/EY.HRPlatform.Identity/Controllers - User Model · ApplicationUser, RefreshToken, and platform role concepts.
Backend/EY.HRPlatform.Identity/Domain - Identity DB · EF Core DbContext, migrations, and seeding for identity data stored in PostgreSQL.
Backend/EY.HRPlatform.Identity/Infrastructure/Persistence - Token Service · Issues and rotates JWT/refresh tokens for authentication flows.
Backend/EY.HRPlatform.Identity/Infrastructure/Services - Courses API · Training HTTP surface for course-related operations.
Backend/EY.HRPlatform.Training/Controllers - CQRS · Command/query interfaces and handlers used across backend services.
Backend/EY.HRPlatform.SharedKernel/CQRS - Domain Base · BaseEntity, AggregateRoot, domain events, and strongly typed value objects.
Backend/EY.HRPlatform.SharedKernel/Domain - Integration Events · Event contracts such as EmployeeCreated and EmployeeDeactivated for future async integration.
Backend/EY.HRPlatform.SharedKernel/Events/IntegrationEvents - Results · Result and Error types for explicit success/failure handling.
Backend/EY.HRPlatform.SharedKernel/Results
Frontend
Next.js/Turborepo microfrontend workspace
- Shell · Browser-facing host that composes and routes microfrontends under path prefixes.
Frontend/apps/shell - Core App · Shared platform experience microfrontend for core platform screens.
Frontend/apps/core - Interview App · Microfrontend for interview workflows and scheduling.
Frontend/apps/interview - Learning App · Microfrontend for courses and learning experiences.
Frontend/apps/learning - Performance App · Microfrontend for reviews and performance workflows.
Frontend/apps/performance - Recruitment App · Microfrontend for job openings and hiring flows.
Frontend/apps/recruitment - Onboarding App · Microfrontend for new-hire onboarding flows.
Frontend/apps/onboarding - UI Package · Shared component library used across frontend apps.
Frontend/packages/ui
Connections 26
- Shell → Core App: composes · Shell provides the host experience and routes to domain apps.
- Shell → Interview App: composes · Shell exposes the interview microfrontend under a path prefix.
- Shell → Learning App: composes · Shell exposes the learning microfrontend under a path prefix.
- Shell → Performance App: composes · Shell exposes the performance microfrontend under a path prefix.
- Shell → Recruitment App: composes · Shell exposes the recruitment microfrontend under a path prefix.
- Shell → Onboarding App: composes · Shell exposes the onboarding microfrontend under a path prefix.
- Core App → UI Package: uses · Core UI is built from shared primitives.
- Interview App → UI Package: uses · Interview UI is built from shared primitives.
- Learning App → UI Package: uses · Learning UI is built from shared primitives.
- Performance App → UI Package: uses · Performance UI is built from shared primitives.
- Recruitment App → UI Package: uses · Recruitment UI is built from shared primitives.
- Onboarding App → UI Package: uses · Onboarding UI is built from shared primitives.
- Shell → Gateway: calls · Frontend shell and MFEs send API traffic to the backend entry point.
- Gateway → Identity: routes · Gateway forwards auth and user traffic to Identity.
- Gateway → Training: routes · Gateway forwards training traffic to Training.
- Identity → Auth & Users: exposes · Identity controllers implement the public auth and user API.
- Identity → User Model: owns · Identity owns the user, token, and role domain model.
- Identity → Identity DB: persists to · Identity stores users and refresh tokens via EF Core.
- Identity → Token Service: issues · Identity uses a token service for JWT issuance and rotation.
- Training → Courses API: exposes · Training controller implements the course API surface.
- Identity → SharedKernel: depends on · Identity reuses backend primitives and contracts.
- Training → SharedKernel: depends on · Training reuses backend primitives and contracts.
- SharedKernel → CQRS: contains · CQRS interfaces and handlers define command/query boundaries.
- SharedKernel → Domain Base: contains · Domain base types and value objects live here.
- SharedKernel → Integration Events: contains · Integration event contracts are defined in the shared foundation.
- SharedKernel → Results: contains · Result/error types support consistent error handling.