Skip to content

Architecture Overview ​

Vulcan uses a microservices architecture with 11 independent capabilities, each owning its own database. The system includes a YARP API Gateway for routing, a Better Auth service for authentication, React 19 web frontend, and React Native mobile app.

High-Level Architecture ​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          Clients                                 β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚   β”‚  React Web  β”‚   β”‚React Native β”‚   β”‚   3rd Party β”‚          β”‚
β”‚   β”‚   (Vite)    β”‚   β”‚   (Expo)    β”‚   β”‚  Integrationsβ”‚          β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚                 β”‚                 β”‚
           β”‚                 β”‚                 β”‚ HTTPS
           β–Ό                 β–Ό                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  API Gateway (YARP - Port 8080)                  β”‚
β”‚      Rate Limiting | Health Checks | OpenAPI Aggregation        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                      β”‚                      β”‚
        β–Ό                      β–Ό                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Auth Service β”‚      β”‚   Leads      β”‚      β”‚  Quotation   β”‚
β”‚ (Port 3000)  β”‚      β”‚ (Port 5000)  β”‚      β”‚ (Port 5000)  β”‚
β”‚ Better Auth  β”‚      β”‚  .NET 10     β”‚      β”‚  .NET 10     β”‚
β”‚ Multi-tenant β”‚      β”‚ β€’ Leads      β”‚      β”‚ β€’ Quotes     β”‚
β”‚ β€’ Sign up/in β”‚      β”‚ β€’ Customers  β”‚      β”‚ β€’ Work Items β”‚
β”‚ β€’ 2FA        β”‚      β”‚ β€’ Contacts   β”‚      β”‚ β€’ Articles   β”‚
β”‚ β€’ Orgs       β”‚      β”‚              β”‚      β”‚              β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                     β”‚                     β”‚
       β–Ό                     β–Ό                     β–Ό
    [auth DB]           [leads DB]            [quotation DB]

... and 8 more microservices (contracts, projects, invoicing,
    documents, ai, planning, coresetup) each with their own database

Key Principles ​

One Database Per Capability ​

Each microservice owns its data. No shared databases.

vulcan-be-coresetup  β†’ db-vulcan-be-coresetup (port 5432)
vulcan-be-leads      β†’ db-vulcan-be-leads     (port 5433)
vulcan-be-quotation  β†’ db-vulcan-be-quotation (port 5434)
...

Vertical Slice Architecture ​

Each feature is a self-contained slice with all CRUD operations colocated.

Features/
└── Quotes/
    β”œβ”€β”€ GetAllQuotes/
    β”‚   β”œβ”€β”€ GetAllQuotesQuery.cs
    β”‚   β”œβ”€β”€ GetAllQuotesHandler.cs
    β”‚   └── GetAllQuotesResponse.cs
    β”œβ”€β”€ GetQuote/
    β”œβ”€β”€ CreateQuote/
    β”œβ”€β”€ UpdateQuote/
    └── DeleteQuote/

CQRS Pattern ​

Commands (writes) and Queries (reads) are separated.

csharp
// Query - read operation
public record GetQuoteQuery(Guid Id) : IRequest<QuoteResponse?>;

// Command - write operation
public record CreateQuoteCommand(string Name, Guid CustomerId) : IRequest<CreateQuoteResponse>;

Complete Service Inventory ​

Backend Services (.NET 10 Microservices) ​

  1. vulcan-be-coresetup - Core setup, users, groups, settings
  2. vulcan-be-leads - CRM, leads, customers, contacts
  3. vulcan-be-quotation - Quotes, work packages, articles
  4. vulcan-be-contracts - Contracts, e-signing integration
  5. vulcan-be-projects - Projects, timelines, milestones
  6. vulcan-be-invoicing - Invoices, payments, accounting
  7. vulcan-be-documents - Document storage and management
  8. vulcan-be-ai - AI services, MCP gateway, embeddings
  9. vulcan-be-planning - Planning, scheduling, resources

Gateway & Auth ​

  1. vulcan-be-gateway - YARP API Gateway (Port 8080)
  2. vulcan-be-auth - Better Auth service (Port 3000)

Frontend ​

  1. vulcan-web - React 19 web application
  2. vulcan-mobile - React Native mobile app

Infrastructure ​

  1. vulcan-infrastructure - Terraform, Kubernetes, Helm
  2. vulcan-docs - Documentation site (VitePress)
  3. vulcan-product-guide - Product team spec tool

Repository Structure ​

vulcan-workspace/
β”œβ”€β”€ repos/
β”‚   β”œβ”€β”€ vulcan-web/              # React 19 frontend
β”‚   β”œβ”€β”€ vulcan-mobile/           # React Native + Expo
β”‚   β”œβ”€β”€ vulcan-be-gateway/       # YARP API Gateway (Port 8080)
β”‚   β”œβ”€β”€ vulcan-be-auth/          # Better Auth (Port 3000)
β”‚   β”œβ”€β”€ vulcan-be-coresetup/     # Users, Groups, Settings
β”‚   β”œβ”€β”€ vulcan-be-leads/         # CRM, Leads, Customers
β”‚   β”œβ”€β”€ vulcan-be-quotation/     # Quotes, Work packages
β”‚   β”œβ”€β”€ vulcan-be-contracts/     # Contracts, E-signing
β”‚   β”œβ”€β”€ vulcan-be-projects/      # Projects, Timelines
β”‚   β”œβ”€β”€ vulcan-be-invoicing/     # Invoices, Payments
β”‚   β”œβ”€β”€ vulcan-be-documents/     # Document storage
β”‚   β”œβ”€β”€ vulcan-be-ai/            # AI services, Embeddings
β”‚   β”œβ”€β”€ vulcan-be-planning/      # Planning, Scheduling
β”‚   β”œβ”€β”€ vulcan-infrastructure/   # Terraform, Kubernetes
β”‚   β”œβ”€β”€ vulcan-docs/             # Documentation (this site)
β”‚   └── vulcan-product-guide/    # Product team tool
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Makefile
└── .agentic/ (workspace orchestration, expertise)

Data Flow ​

1. User interacts with React/React Native UI
2. TanStack Query manages API requests
3. Request hits API Gateway (YARP on port 8080)
4. Gateway validates rate limits and forwards request
5. Auth service validates JWT token (if auth route)
6. Gateway routes to appropriate microservice
7. Microservice validates JWT and extracts organization context
8. Mediator dispatches to handler (CQRS pattern)
9. Handler executes business logic
10. EF Core handles database operations
11. Response flows back through layers
12. TanStack Query caches the result
13. UI updates reactively

Authentication Flow ​

1. User enters credentials in UI
2. POST /api/auth/sign-in β†’ Auth Service
3. Auth Service validates credentials
4. Auth Service creates session + JWT token with organization context
5. Token returned to client (HttpOnly cookie for web, secure storage for mobile)
6. Client includes Authorization: Bearer <token> in all subsequent requests
7. Gateway forwards token to microservices
8. Microservices validate token and extract organizationId
9. Global query filter applied: WHERE organization_id = <organizationId>
10. User sees only their organization's data

Communication Patterns ​

Synchronous (HTTP/REST) ​

For real-time requests between services or from clients.

Client β†’ API Gateway β†’ Microservice β†’ Database

Asynchronous (Message Bus) ​

For background processing and event-driven communication.

Service A β†’ Azure Service Bus β†’ Service B

Technology Choices ​

LayerTechnologyWhy?
FrontendReact 19 + ViteLatest React with modern build tooling
MobileReact Native + ExpoCross-platform with minimal native code
GatewayYARP (.NET)High-performance reverse proxy from Microsoft
AuthBetter AuthModern, TypeScript-native auth solution
Backend.NET 10LTS release with excellent performance
PatternVertical Slice + CQRSFeature-focused, maintainable code
DatabasePostgreSQL 16Mature, reliable, excellent JSON support
OrchestrationKubernetes (AKS)Industry standard, Azure-managed
IaCTerraformDeclarative infrastructure as code
CI/CDGitLab CIIntegrated with our Git workflow

Next Steps ​

Built with VitePress | v1.2.0 | πŸš€ Week One Sprint