memory-bank/systemPatterns.md
Gitpod follows a microservices architecture designed to be Scalable, Resilient, Extensible, and Secure.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│Git Platforms│ │User Browser │ │IDE Clients │
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
│ │ │
└────────┬───────┴────────┬───────┘
▼ ▼
┌───────────────────────────────┐
│ API Gateway │
└───────────────────────────────┘
│ │
┌────────┴───────┐ ┌─────┴────────┐
│ Auth Service │ │ Dashboard │
└────────────────┘ └──────────────┘
│ │
┌────────┴───────┐ ┌─────┴────────┐
│ WS Manager │ │Image Builder │
└────────────────┘ └──────────────┘
│ │
┌────────┴────────────────┴────────┐
│ Kubernetes Infrastructure │
└───────────────────────────────────┘
| Component | Purpose |
|---|---|
| Workspace Manager | Orchestrates workspace lifecycle (creation, starting, stopping, deletion) |
| Workspace Daemon | Manages workspace resources and file system operations on each node |
| Image Builder | Builds and caches Docker images for workspaces |
| Content Service | Manages file content, git operations, and synchronization |
| IDE Service | Manages IDE instances (VS Code, JetBrains) |
| Dashboard | Web UI for workspace and user management |
| Auth Service | Handles authentication and authorization |
| Proxy | Routes traffic to appropriate services and workspaces |
| Component | Purpose |
|---|---|
| Registry Facade | Efficient access to container images |
| Blobserve | Serves static content from container images |
| Supervisor | Manages workspace internal services |
| Public API | Programmatic access to Gitpod functionality |
components/ directory-api suffixed packages.proto)BUILD.yaml for build configurationleeway.Dockerfile for containerized components| Language | Key Practices |
|---|---|
| Go | Standard conventions (gofmt), explicit error handling, context propagation, structured logging |
| TypeScript | Type safety, React for UI, functional components with hooks, ESLint/Prettier |
| Pattern | Implementation |
|---|---|
| Microservices | Loosely coupled services with specific responsibilities |
| Container Orchestration | Kubernetes for deployment, scaling, and operations |
| Event-Driven Architecture | Asynchronous communication for scalability and resilience |
| API Gateway | Central routing with cross-cutting concerns handling |
| Immutable Infrastructure | Configuration changes create new environments |
Key components: ws-manager-mk2, ws-daemon, ws-manager-bridge, server, image-builder-mk3
| Decision | Rationale |
|---|---|
| Kubernetes-Based | Scalability and standardized infrastructure |
| Multi-IDE Support | Flexibility for different user preferences |
| Prebuild System | Significantly reduced startup times |
| Workspace Pods | Isolation and resource management |
| TypeScript & Go | Balance of developer productivity and performance |
| gRPC Communication | Efficient, typed service communication |
| Leeway Build System | Management of complex component dependencies |
| K8s Deployment Config | Centralized in install/installer for consistency |
| Public API Architecture | gRPC services defined in Protocol Buffers |
| SpiceDB Authorization | Fine-grained relationship-based access control |
yarn commands defined in package.json.
yarn build: Compile the component.yarn test: Run tests.yarn lint: Check code style.yarn watch: Watch for changes and rebuild.go build ./...: Build all packages.
go test ./...: Test all packages.go run main.go: Build and run.leeway build components/component-name:app: Build a specific component.leeway build -D components/component-name:app: Build with dependencies.leeway exec --package components/component-name:app -- command: Run a command for a package.test/ directorymemory-bank/components/Document for each component:
Update documentation in:
memory-bank/components/techContext.md for significant patterns