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 databaseKey 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) β
- vulcan-be-coresetup - Core setup, users, groups, settings
- vulcan-be-leads - CRM, leads, customers, contacts
- vulcan-be-quotation - Quotes, work packages, articles
- vulcan-be-contracts - Contracts, e-signing integration
- vulcan-be-projects - Projects, timelines, milestones
- vulcan-be-invoicing - Invoices, payments, accounting
- vulcan-be-documents - Document storage and management
- vulcan-be-ai - AI services, MCP gateway, embeddings
- vulcan-be-planning - Planning, scheduling, resources
Gateway & Auth β
- vulcan-be-gateway - YARP API Gateway (Port 8080)
- vulcan-be-auth - Better Auth service (Port 3000)
Frontend β
- vulcan-web - React 19 web application
- vulcan-mobile - React Native mobile app
Infrastructure β
- vulcan-infrastructure - Terraform, Kubernetes, Helm
- vulcan-docs - Documentation site (VitePress)
- 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 reactivelyAuthentication 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 dataCommunication Patterns β
Synchronous (HTTP/REST) β
For real-time requests between services or from clients.
Client β API Gateway β Microservice β DatabaseAsynchronous (Message Bus) β
For background processing and event-driven communication.
Service A β Azure Service Bus β Service BTechnology Choices β
| Layer | Technology | Why? |
|---|---|---|
| Frontend | React 19 + Vite | Latest React with modern build tooling |
| Mobile | React Native + Expo | Cross-platform with minimal native code |
| Gateway | YARP (.NET) | High-performance reverse proxy from Microsoft |
| Auth | Better Auth | Modern, TypeScript-native auth solution |
| Backend | .NET 10 | LTS release with excellent performance |
| Pattern | Vertical Slice + CQRS | Feature-focused, maintainable code |
| Database | PostgreSQL 16 | Mature, reliable, excellent JSON support |
| Orchestration | Kubernetes (AKS) | Industry standard, Azure-managed |
| IaC | Terraform | Declarative infrastructure as code |
| CI/CD | GitLab CI | Integrated with our Git workflow |
Next Steps β
- Authentication Service - Better Auth with multi-tenancy
- API Gateway - YARP reverse proxy details
- Frontend Architecture - React 19 web app
- Backend Architecture - Microservices patterns
- Mobile Architecture - React Native app
- Infrastructure - Azure deployment
