Platform Architecture & Monorepo Overview
1. Executive Summary
Section titled “1. Executive Summary”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).
2. Multi-Vertical Monorepo Topology
Section titled “2. Multi-Vertical Monorepo Topology”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
3. Physical Directory Structure
Section titled “3. Physical Directory Structure”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:
BuildingBlocks: Bottom-most layer. Zero references to any other project in the solution.Core: Universal platform engine. Can only referenceBuildingBlocks. Zero business vertical dependencies.Health.Clinical,Health.Pharmacy,Operations: Independent business modules. They can referenceCoreandBuildingBlocks. Zero circular cross-dependencies between each other.Hosts(Web,Api,Worker,Mcp): Orchestration layer. Can reference business verticals,Core, andBuildingBlocksto register DI services and expose endpoints.Clients & Edge(Mobile,Edge): Zero direct references to domain entities or database contexts; communicate exclusively via REST API and SignalR hubs.