Skip to content

Platform Architecture & Monorepo Overview

GERCIA is an enterprise software engineering company operating a high-performance multi-vertical SaaS platform monorepo. The foundation layer (Foundation/) provides an industry-agnostic SaaS engine designed to host pluggable business verticals.

The Healthcare vertical (Health/) is the flagship business vertical, responsible for the triangulation between Doctors (Clinical), Patients (Mobile), and Compounding Pharmacies (Pharmacy).


graph TD
    subgraph FoundationLayer [Universal Platform Foundation]
        BB["Gercia.BuildingBlocks<br>(Universal DDD Primitives)"]
        CORE["Gercia.Core<br>(Tenancy, Postgres RLS, Master Identity, AES Crypto, GCS)"]
    end
    
    subgraph VerticalsLayer [Pluggable Business Verticals]
        HEALTH["Health Vertical<br>(Clinical, Pharmacy, Patient Mobile)"]
        OPS["Operations Domain<br>(SaaS Billing, Subscriptions, Contracts)"]
        FUTURE["Future Verticals<br>(Finance, Legal, Logistics)"]
    end
    
    subgraph HostsLayer [Orchestration Hosts & Edge Agent]
        API["Gercia.Api (Gateway & OpenIddict STS)"]
        WEB["Gercia.Web (Blazor Host)"]
        WORKER["Gercia.Worker (Daemon)"]
        MCP["Gercia.Mcp (AI FastMCP Host)"]
        EDGE["Gercia.Edge (Hardware Station Agent)"]
    end

    BB --> CORE
    CORE --> HEALTH
    CORE --> OPS
    CORE --> FUTURE
    HEALTH --> HostsLayer
    OPS --> HostsLayer

gercia-platform/
├── .agents/ # Architecture guidelines, Plane orchestration, and AI agent rules
├── deploy/ # Centralized Google Cloud Build CI/CD pipeline (cloudbuild.app.yaml)
├── docs/ # Documentation portals built with Astro Starlight
│ ├── private/ # Internal Engineering & Architecture Portal (eng.gercia.com.br)
│ └── public/ # Public Help Center & User Manuals (docs.gercia.com.br)
├── dotnet/ # Enterprise .NET 10 Ecosystem (C# 14 / .NET 10)
│ ├── src/
│ │ ├── Foundation/ # Universal SaaS Platform Engine (Schema: core)
│ │ │ ├── Gercia.BuildingBlocks/ # Universal DDD primitives (Entity, ValueObject, UnitOfWork)
│ │ │ └── Gercia.Core/ # Multi-tenancy, Postgres RLS, User Identity, AES Crypto, GCS
│ │ ├── Operations/ # Operations Domain (Schema: operations)
│ │ │ └── Gercia.Operations/ # SaaS billing, subscriptions, contracts
│ │ ├── Health/ # Healthcare Vertical
│ │ │ ├── Gercia.Health.Clinical/ # Clinical domain, Patients, EHR, CFM (Schema: clinical)
│ │ │ ├── Gercia.Health.Pharmacy/ # Compounding formulas, Work orders (Schema: pharmacy)
│ │ │ └── Gercia.Health.Mobile/ # Patient mobile app (NET MAUI Blazor Hybrid)
│ │ ├── Hosts/ # Application Orchestration Hosts
│ │ │ ├── Gercia.Web/ # Blazor Web Host (Code-Behind pattern)
│ │ │ ├── Gercia.Api/ # REST API Gateway & OpenIddict Server
│ │ │ ├── Gercia.Worker/ # Background daemon worker
│ │ │ └── Gercia.Mcp/ # FastMCP AI host
│ │ └── Edge/ # Local Hardware Edge Agent
│ │ └── Gercia.Edge/ # Serial scales & thermal label printing
│ └── tst/ # Automated Test Suites (xUnit, FluentAssertions, NetArchTest)
│ ├── Foundation/ # BuildingBlocks & Core unit/integration tests
│ └── Health/ # Clinical & Pharmacy vertical tests
└── website/ # Public institutional website built with Astro (gercia.com.br)

4. Strict Dependency Boundaries (Clean Architecture)

Section titled “4. Strict Dependency Boundaries (Clean Architecture)”

To maintain clean hexagonal boundaries, monorepo dependencies must strictly adhere to the following rules:

  1. BuildingBlocks: Bottom-most layer. Zero references to any other project in the solution.
  2. Core: Universal platform engine. Can only reference BuildingBlocks. Zero business vertical dependencies.
  3. Health.Clinical, Health.Pharmacy, Operations: Independent business modules. They can reference Core and BuildingBlocks. Zero circular cross-dependencies between each other.
  4. Hosts (Web, Api, Worker, Mcp): Orchestration layer. Can reference business verticals, Core, and BuildingBlocks to register DI services and expose endpoints.
  5. Clients & Edge (Mobile, Edge): Zero direct references to domain entities or database contexts; communicate exclusively via REST API and SignalR hubs.