How getprobo/probo works
Project Type and Purpose
• Probo is a full-stack, open-source compliance platform. It comprises:
• Two Single-Page Applications (SPAs): “console” for authenticated users, and “trust” for public trust center access.
• A monolithic Go backend exposing two GraphQL API endpoints (/console/v1 and /trust/v1).
• A PostgreSQL database, observability stack (Prometheus, Grafana, Loki, Tempo), and ancillary services (cert-manager, mailer, file manager).
File-Structure Highlights and Architectural Patterns
• apps/console & apps/trust: React+TypeScript SPAs, each built with Vite and Relay.
• pkg/server/api/console/v1 & pkg/server/api/trust/v1: GraphQL schema, resolvers, HTTP handlers.
• pkg/probo & pkg/trust & pkg/coredata: Service layer and data-access layer (domain logic, migrations).
• compose/: Docker Compose definitions for infrastructure.
• pkg/connector, pkg/certmanager, pkg/mailer, pkg/filemanager, etc.: Modular helper services.
API Layer Overview
• Two GraphQL endpoints:
• Console API (/console/v1) handles user/organization management, controls, audits, documents, tasks, snapshots, vendor and trust-center operations.
• Trust API (/trust/v1) serves the public trust center: limited view of audits, documents, NDA workflows, and vendor status.
• HTTP Server (pkg/server/server.go) routes traffic to the appropriate GraphQL handler or static file handler (statichandler for SPAs).
• Resolvers delegate to application services in pkg/probo or pkg/trust, which encapsulate business logic.
• Domain services use pkg/coredata for ORM-style entities and run SQL migrations via embedded migration files.
• Authentication & Authorization:
• pkg/auth, pkg/authz implement session management, JWTs, and permission checks.
• Console API enforces organization-scoped RBAC, Trust API uses token-based trust auth.
Main Components and Interactions
[Frontend]
• Console SPA (React/Relay) ⇄ Console GraphQL endpoint
• Trust SPA (React/Relay) ⇄ Trust GraphQL endpoint
[API Layer]
• HTTP Router → GraphQL handlers (gqlgen) → Resolvers
• Resolvers → Application services (pkg/probo / pkg/trust)
[Service Layer]
• Application services → Domain logic & validation (pkg/coredata, pkg/filevalidation)
• Auxiliary services: connector (OAuth2), certmanager (Let’s Encrypt), mailer (emails via packages/emails), html2pdf, watermarkpdf
[Data Layer]
• Services → PostgreSQL (via pkg/coredata migrations)
• File storage (attachments) via S3 or local blob store configured in cfg/*.yaml
[Infrastructure & Observability]
• Docker Compose orchestrates: PostgreSQL, Pebble (ACME testing CA), Prometheus, Grafana, Tempo
• OpenTelemetry instrumentation in Go code (pkg/server/graphql/tracing.go)
Architectural Patterns & Design Principles
• Monolithic, modular service design: single binary (“probod”) serving multiple APIs.
• Layered architecture: HTTP → GraphQL → Resolvers → Services → Data access.
• Schema-first GraphQL (gqlgen) with code generation for type safety.
• Domain-driven modules in pkg/*, helper libraries in packages/*, UI component library in packages/ui.
• Containerized local development and infrastructure via Docker Compose.
API Layer Focus
• /console/graphql → gqlgen Console resolver set
• /trust/graphql → gqlgen Trust resolver set
• How generated GraphQL types (pkg/server/api/*/types) map to domain entities (pkg/coredata).
• Middleware chain: OpenTelemetry traces → AuthN/AuthZ → Logging → Rate-Limiting → GraphQL execution.