Skip to Content
Terragate Documentation is under active development. Check back often for updates!
ArchitectureOverview

Architecture Overview

Terragate is built as an enterprise-grade microservices platform designed for scalability, security, and reliability.

High-Level Architecture

┌─────────────────────────────────────────────────────────────────┐ │ Terragate Platform │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ Dashboard │ │ Landing │ │ Mobile │ │ │ │ (Next.js) │ │ (Next.js) │ │ (React │ │ │ │ │ │ │ │ Native) │ │ │ └──────┬───────┘ └──────────────┘ └──────────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────────────────────────────────────────────┐ │ │ │ API Gateway (NestJS) │ │ │ │ • Authentication & Authorization │ │ │ │ • Rate Limiting & Security Middleware │ │ │ │ • Request Validation & Transformation │ │ │ └──────────────────────────┬───────────────────────────────┘ │ │ │ │ │ ┌───────────────────┼───────────────────┐ │ │ ▼ ▼ ▼ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ User & │ │ Workspace │ │ Execution │ │ │ │ Auth │ │ Service │ │ Service │ │ │ │ Service │ │ │ │ (Go) │ │ │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │ │ │ │ │ │ │ ▼ ▼ ▼ │ │ ┌──────────────────────────────────────────────────────────┐ │ │ │ Data Layer │ │ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │ │ │PostgreSQL│ │ Redis │ │ RabbitMQ │ │ S3 │ │ │ │ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │ │ └──────────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────┘

Core Components

Frontend Applications

ApplicationTechnologyPurpose
DashboardNext.js 15, React 19Main user interface for workspace management
LandingNext.js 15Marketing site and documentation
MobileReact NativeMobile app for monitoring and approvals

Backend Services

ServiceTechnologyPurpose
API GatewayNestJSCentral entry point, auth, routing
Execution EngineGoTerraform/Terragrunt execution
Worker ServicesPythonAI processing, analytics

Data Stores

StorePurpose
PostgreSQLPrimary database (users, workspaces, jobs)
RedisCaching, sessions, real-time features
RabbitMQAsync job processing, events
S3Terraform state, artifacts, backups

Key Design Principles

1. Multi-Tenant by Default

Every resource is scoped to an organization. Row-level security ensures data isolation.

2. Event-Driven Architecture

Async operations use RabbitMQ with the outbox pattern for reliability.

3. Observability First

Full distributed tracing (Jaeger), metrics (Prometheus), and logs (Loki).

4. Security Layers

  • API key authentication for services
  • JWT for users with refresh token rotation
  • AES-256-GCM encryption for credentials
  • Audit logging for compliance

Next Steps

Last updated on