EASE Architecture

Welcome to the EASE architecture documentation. This section provides comprehensive coverage of the platform's architecture, design decisions, and implementation patterns.

What You'll Learn

This guide covers the complete EASE platform architecture, from high-level system design to detailed implementation patterns.


Architecture Topics

πŸ“ System Design

πŸ” Security Architecture

  • JWT-based Authentication - Token-based auth with refresh tokens
  • RBAC Implementation - Three-layer role-based access control
  • SSO Integration - SAML, OAuth, and OpenID Connect support
  • API Gateway Security - Kong-based security policies

πŸ’Ύ Data Architecture

  • Oracle Database Design - Schema design, VPD policies, and partitioning
  • Multi-Tenancy Data Isolation - PDB, schema-level, and row-level strategies
  • Caching Strategy - Redis for sessions and API responses
  • Search Integration - PostgreSQL for full-text search and AI embeddings

πŸš€ Service Architecture

  • Microservices Design - .NET Core service patterns
  • API Gateway (Kong) - Routing, auth, rate limiting, and integration
  • Real-time Services - Node.js WebSocket services
  • AI Services - FastAPI-based BACH chatbot integration

🎨 Frontend Architecture

  • Next.js Architecture - App Router, SSR, and static generation
  • Component Design - Reusable UI components with shadcn/ui
  • State Management - Client and server state patterns
  • Authentication Flow - JWT cookie-based authentication

πŸ“Š Observability

  • Logging Strategy - Centralized logging with ELK stack
  • Metrics & Monitoring - Prometheus and Grafana
  • Distributed Tracing - Jaeger for request tracing
  • Health Checks - Service health monitoring

Architecture Principles

EASE is built on these core principles:

1. Defense in Depth

Security at multiple layers:

  • Network (WAF, DDoS protection)
  • Gateway (JWT validation, rate limiting)
  • Application (input validation, RBAC)
  • Database (VPD, TDE, audit logging)

2. Multi-Tenancy First

Every component designed for tenant isolation:

  • Automatic tenant context injection
  • VPD for database-level isolation
  • Tenant-scoped caching
  • Isolated logging and metrics

3. Developer Experience

Focus on productivity:

  • Base classes for common patterns
  • Automatic OpenAPI documentation
  • Comprehensive error handling
  • Self-documenting code

4. Performance & Scalability

Built for enterprise scale:

  • Horizontal scaling for all services
  • Oracle RAC for database clustering
  • Redis for distributed caching
  • CDN for static assets

5. Hybrid Technology Strategy

Leverage existing investments:

  • .NET Core for Oracle integration
  • Next.js for modern frontend
  • Kong for API gateway
  • FastAPI for AI workloads

System Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Users / Mobile Apps                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚ HTTPS
                           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Kong API Gateway                        β”‚
β”‚  β€’ Routing            β€’ Rate Limiting    β€’ OAuth/JWT         β”‚
β”‚  β€’ Load Balancing     β€’ Caching         β€’ SAP/ERP Proxy     β”‚
β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚          β”‚          β”‚          β”‚            β”‚
     β–Ό          β–Ό          β–Ό          β–Ό            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Next.js β”‚ β”‚  .NET  β”‚ β”‚Node.jsβ”‚ β”‚ FastAPIβ”‚ β”‚  External  β”‚
β”‚Frontend β”‚ β”‚  Core  β”‚ β”‚WebSocketβ”‚ β”‚  BACH  β”‚ β”‚  Systems   β”‚
β”‚         β”‚ β”‚Servicesβ”‚ β”‚       β”‚ β”‚Chatbot β”‚ β”‚ (SAP, ERP) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚         β”‚          β”‚
                 β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β–Ό
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚    Data Layer        β”‚
            β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
            β”‚ β€’ Oracle (Primary)   β”‚
            β”‚ β€’ Redis (Cache)      β”‚
            β”‚ β€’ PostgreSQL (AI)    β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Stack

LayerTechnologyPurpose
FrontendNext.js 15 + React + TypeScriptDeveloper portal UI
UI Componentsshadcn/ui + Tailwind CSSBeautiful, accessible components
API GatewayKongRouting, auth, rate limiting, integration
Backend.NET Core 8Business logic, Oracle integration
Real-timeNode.js + Socket.ioWebSocket, notifications
AI ChatbotFastAPI + PythonBACH integration, RAG pipeline
DatabaseOracle 19c+Primary data store with VPD
CacheRedisSessions, API cache, rate limiting
SearchPostgreSQLFull-text search, AI embeddings
MonitoringPrometheus + GrafanaMetrics and dashboards
LoggingELK StackCentralized log aggregation
TracingJaegerDistributed request tracing

Key Architectural Patterns

Repository Pattern

All data access through repositories for testability and maintainability.

public interface IBookingRepository { Task<IEnumerable<Booking>> GetAllAsync(int tenantId); Task<Booking> GetByIdAsync(int id, int tenantId); Task<Booking> CreateAsync(Booking booking); }

Service Layer Pattern

Business logic separated from controllers.

public class BookingService : IBookingService { private readonly IBookingRepository _repository; public async Task<Booking> CreateBookingAsync(CreateBookingDto dto, int tenantId) { // Business logic here return await _repository.CreateAsync(booking); } }

Dependency Injection

All components use DI for loose coupling and testability.

builder.Services.AddScoped<IBookingRepository, BookingRepository>(); builder.Services.AddScoped<IBookingService, BookingService>();

Base Classes

Common functionality in base classes to reduce boilerplate.

public abstract class BaseController : ControllerBase { protected int TenantId => GetTenantIdFromClaims(); protected int UserId => GetUserIdFromClaims(); }

Data Flow Examples

API Request Flow

1. User β†’ Next.js Frontend (with JWT cookie)
2. Frontend β†’ Kong Gateway
3. Kong validates JWT, extracts claims
4. Kong β†’ .NET Service (with headers: tenant_id, user_id)
5. Service extracts context from claims
6. Service β†’ Repository with tenant context
7. Repository β†’ Oracle (VPD auto-filters by tenant)
8. Oracle β†’ Repository β†’ Service β†’ Kong β†’ Frontend β†’ User

Authentication Flow

1. User submits credentials
2. Next.js β†’ Kong β†’ AuthService
3. AuthService validates against Oracle
4. AuthService loads user roles/permissions
5. AuthService generates JWT with claims
6. Kong sets secure HTTP-only cookie
7. User redirected to dashboard

Chatbot Query Flow

1. User presses Ctrl+/
2. Frontend β†’ FastAPI Chatbot Service
3. Chatbot extracts context (page, user role)
4. Chatbot searches docs (RAG with PostgreSQL)
5. Chatbot builds enriched prompt
6. Chatbot β†’ BACH API
7. BACH β†’ Chatbot β†’ Frontend β†’ User

Quick Links

Essential Reading

Deep Dives

  • Security Architecture - Defense in depth strategy (coming soon)
  • Performance Optimization - Scaling strategies (coming soon)
  • Deployment Guide - Production deployment (coming soon)

Architecture Decision Records (ADRs)

For detailed architectural decisions, see the ADR documents:

  • EASE Enterprise Architecture ADR - Complete platform architecture
  • MCP Client Orchestration ADR - AI/Chatbot architecture
  • Implementation Instructions - Build and deployment guide

Questions?


Ready to dive deeper? Start with the Architecture Overview β†’