This repository was archived by the owner on Mar 17, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
docs: add projects and platforms documentation #78
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2c686de
docs: add projects and platforms overview pages
jyecusch fd546ab
docs: add missing poster img to project editor video
jyecusch 38fa4e5
docs: fix typo
jyecusch 3eb195f
chore: move files
jyecusch cbdedac
docs: add `suga edit` to the dev lifecycle description
jyecusch 5e3ae15
docs: fix comment in example code
jyecusch 5314658
docs: fix waf property name typo
jyecusch fb27e78
docs: fix DX description
jyecusch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
jyecusch marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,230 @@ | ||
| --- | ||
| title: "Platforms Overview" | ||
| description: "Understanding Suga's platforms and ecosystem" | ||
| --- | ||
|
|
||
| Platforms in Suga solve a critical challenge: delivering the seamless developer experience of modern deployment platforms while maintaining enterprise control and flexibility. They're blueprints that transform application specifications ([Projects](/projects)) into deployable infrastructure by generating Terraform HCL and providing runtime adapters that translate abstract resource operations into cloud-specific API calls. | ||
|
|
||
| Platform teams can create, customize, and govern these distributed packages to provide developers with instant deployments, automatic scaling, and zero-configuration infrastructure, while maintaining full control over security, compliance, and infrastructure standards. | ||
|
|
||
| <Card title="Browse Platforms" horizontal icon="globe" href="https://app.addsuga.com/browse/platforms"> | ||
| Explore official and community platforms in the platform browser | ||
| </Card> | ||
|
|
||
| ## What is a Platform? | ||
|
|
||
| A platform is a configuration that maps Suga's abstract resource types (services, buckets, databases, entrypoints, etc.) to specific implementations. | ||
|
|
||
| For example, the official Suga AWS platform maps: | ||
|
|
||
| - **Services** → AWS Lambda or ECS Fargate | ||
| - **Buckets** → S3 buckets | ||
| - **Entrypoints** → Amazon CloudFront CDN | ||
|
|
||
| It also includes IAM, policies and routing between the resources. Establishing routes between CloudFront and AWS Lambda/Fargate, as well as providing least-privilege access from the application containers to resources like S3 buckets. | ||
|
|
||
| This abstraction delivers concrete value: local development with emulated cloud services (no cloud bills or complex setup), application architectures that aren't locked to specific infrastructure choices, and the ability for platform teams to evolve deployment strategies without breaking developer workflows. | ||
|
|
||
| Unlike opaque abstractions that hide complexity, Suga's platform system is transparent - you can inspect the generated Terraform, customize platform behavior, and maintain full control over your infrastructure while keeping application logic cleanly separated from deployment concerns. | ||
|
|
||
| ## Platform Ecosystem | ||
|
|
||
| ### Official Platforms | ||
|
|
||
| The Suga team maintains official platforms for major cloud providers. These are general purpose, production-ready implementations: | ||
|
|
||
| - **[AWS Platform](https://app.addsuga.com/platforms/suga/aws)** - Lambda/Fargate services, S3 storage, CloudFront CDN, IAM security | ||
| - **[GCP Platform](https://app.addsuga.com/platforms/suga/gcp)** - Cloud Run services, Cloud Storage, Cloud CDN, Service Account security | ||
| - **Azure Platform** _(coming soon)_ - Container Apps services, Blob Storage, etc. | ||
|
|
||
| ```yaml title="Example: Using official platforms" | ||
| targets: | ||
| - suga/aws@1 # Deploy to AWS | ||
| - suga/gcp@1 # Deploy to GCP | ||
|
|
||
| services: | ||
| api: | ||
| # Will be deployed as Lambda (AWS) or Cloud Run (GCP) | ||
| dev: | ||
| script: npm run dev | ||
| ``` | ||
|
|
||
| ### Community Platforms | ||
|
|
||
| The platform ecosystem extends far beyond official implementations. Community members and organizations are able to publish platforms for: | ||
|
|
||
| - **Alternative cloud providers** - Azure, DigitalOcean, Linode, Vultr | ||
| - **Specialized deployments** - Kubernetes, Docker Swarm, on-premises infrastructure | ||
| - **Development environments** - Local testing, CI/CD pipelines, staging environments | ||
| - **Custom configurations** - Organization-specific security policies, compliance requirements | ||
|
|
||
| <Info> | ||
| Platform names follow the format `team/platform@version` (e.g. `acme-corp/azure@2`). | ||
|
|
||
| You can discover available platforms through the [Suga platform registry](https://app.addsuga.com/browse/platforms) or by browsing community repositories. | ||
| </Info> | ||
|
|
||
| ## Platform Components | ||
|
|
||
| Platforms operate through two key mechanisms: **Infrastructure Generation** and **Runtime Adaptation**. | ||
|
|
||
| ### Infrastructure Generation | ||
|
|
||
| When you run `suga build`, Suga uses your target platform to transform your [Project](/projects) specification into cloud-specific Terraform HCL (called stacks). This process: | ||
|
|
||
| 1. **Maps abstract resources** - Takes your high-level resource definitions (services, buckets, databases) and selects appropriate cloud implementations | ||
| 2. **Generates Terraform modules** - Creates infrastructure-as-code that provisions actual cloud resources with proper networking, security, and permissions | ||
| 3. **Applies platform policies** - Ensures generated infrastructure follows organizational security, compliance, and architectural standards | ||
|
|
||
| ### Runtime Adaptation | ||
|
|
||
| If you choose to use Suga's client code generation in your applications, Platforms provide runtime adapters that translate those abstract operations into cloud-specific API calls: | ||
|
|
||
| ```typescript | ||
| import { SugaClient } from "@/suga/client"; | ||
|
|
||
| const suga = new SugaClient(); | ||
|
|
||
| // Developer writes platform-agnostic code | ||
| await suga.files.write('file.txt', data) | ||
|
|
||
| // Platform runtime adapter translates to: | ||
| // AWS: s3.putObject() call | ||
| // GCP: storage.bucket().file().save() call | ||
| // Local dev: filesystem write | ||
| ``` | ||
|
|
||
| This dual approach unlocks portable code while platform teams control both deployment infrastructure and runtime behavior. | ||
|
|
||
| ### Resource Blueprints | ||
|
|
||
| Ultimately, Suga Platforms map Suga Resources to specific plugins and configuration, called Resource Blueprints. Blueprints specify: | ||
|
|
||
| - **Plugin**: The resource plugin to use, which contains Terraform code and optional Runtime Adapter | ||
| - **Properties**: Configuration for the plugin, typically Terraform Module variables | ||
| - **Variables**: Custom values to export as Terraform stack variables | ||
| - **Dependencies**: Other infrastructure that should be deployed before the current resource | ||
|
|
||
| ### Plugins | ||
|
|
||
| Platforms use a modular plugin system where each plugin handles a specific cloud service: | ||
|
|
||
| - `suga/aws-lambda` - AWS Lambda functions | ||
|
davemooreuws marked this conversation as resolved.
|
||
| - `suga/aws-s3-bucket` - S3 storage buckets | ||
| - `suga/gcp-cloudrun` - Google Cloud Run containers | ||
| - `suga/neon-db` - Neon PostgreSQL databases | ||
|
|
||
| #### Properties | ||
|
|
||
| Properties are key-value pairs that get passed directly as input variables to the underlying Terraform modules. They configure how the cloud resources should be deployed and behave. The visual editor provides an intuitive interface for editing blueprint properties: | ||
|
|
||
|  | ||
|
|
||
| ```yaml title="Platform blueprint with properties" | ||
| entrypoints: | ||
| default: | ||
| plugin: "suga/aws-cloudfront" | ||
| properties: | ||
| custom_domain: "api.example.com" | ||
| waf_enabled: true | ||
| cache_behavior: "optimized" | ||
| ``` | ||
|
|
||
| Properties support several value types: | ||
|
|
||
| - **Static values** - Strings, numbers, booleans, objects, and arrays | ||
| - **Variable references** - `${var.domain}` references platform variables | ||
| - **Self references** - `${self.waf_enabled}` references blueprint-specific variables | ||
| - **Infrastructure references** - `${infra.vpc.id}` references other infrastructure outputs | ||
|
|
||
| When Suga generates Terraform code, properties get resolved and passed to the module: | ||
|
|
||
| ```hcl title="Generated Terraform module call" | ||
| module "cloudfront_main" { | ||
| source = "./modules/aws-cloudfront" | ||
|
|
||
| custom_domain = "api.example.com" | ||
| waf_enabled = true | ||
| cache_behavior = "optimized" | ||
| } | ||
| ``` | ||
|
|
||
| This allows platforms to expose the full configuration surface of underlying cloud services while maintaining clean, declarative definitions. | ||
|
|
||
| ### Variables | ||
|
|
||
| Variables provide a way to defer configuration values until deployment time, making platforms flexible and reusable. Suga supports two types of variables that become Terraform stack variables: | ||
|
|
||
| #### Platform Variables | ||
|
|
||
| Platform variables are defined at the top level and can be referenced by any blueprint in the platform: | ||
|
|
||
|  | ||
|
|
||
| #### Blueprint Variables | ||
|
|
||
| Blueprint variables are specific to individual resource blueprints, allowing fine-grained customization. The visual editor shows how blueprint variables can be used as property values: | ||
|
|
||
|  | ||
|
|
||
| #### Variable Resolution | ||
|
|
||
| When you run `suga build`, variables become Terraform stack variables that can be provided at deployment time: | ||
|
|
||
| ```hcl title="Conceptual Example of Stack Variables" | ||
| variable "domain" { | ||
| type = string | ||
| description = "Custom domain for the application" | ||
| default = null | ||
| } | ||
|
|
||
| variable "entrypoints_default_enable_waf" { | ||
| type = bool | ||
| description = "Enable AWS WAF protection" | ||
| default = false | ||
| } | ||
| ``` | ||
|
|
||
| Variables can be provided during Terraform deployment: | ||
|
|
||
| ```bash title="Providing variables at deploy time" | ||
| # Via command line | ||
| terraform apply -var="domain=api.example.com" -var="entrypoints_default_enable_waf=true" | ||
|
|
||
| # Via terraform.tfvars file | ||
| echo 'domain = "api.example.com"' > terraform.tfvars | ||
| echo 'entrypoints_default_enable_waf = true' >> terraform.tfvars | ||
| terraform apply | ||
| ``` | ||
|
|
||
| #### Multi-Environment Deployments | ||
|
|
||
| Variables work seamlessly with [Terraform workspaces](https://developer.hashicorp.com/terraform/language/state/workspaces) to support deployment to multiple environments using different configurations: | ||
|
|
||
| ```bash title="Environment-specific deployments" | ||
| # Development environment | ||
| terraform workspace select dev | ||
| terraform apply -var-file="environments/dev.tfvars" | ||
|
|
||
| # Production environment | ||
| terraform workspace select prod | ||
| terraform apply -var-file="environments/prod.tfvars" | ||
| ``` | ||
|
|
||
| ```hcl title="environments/dev.tfvars" | ||
| domain = "dev-api.example.com" | ||
| services_default_memory = 512 | ||
| services_default_storage = 1024 | ||
| entrypoints_default_enable_waf = false | ||
| ``` | ||
|
|
||
| ```hcl title="environments/prod.tfvars" | ||
| domain = "api.example.com" | ||
| services_default_memory = 2048 | ||
| services_default_storage = 4096 | ||
| entrypoints_default_enable_waf = true | ||
| ``` | ||
|
|
||
| This pattern allows the same platform to scale resources appropriately across environments - smaller, cost-effective configurations for development and staging, while providing production-grade resources with enhanced security features for live deployments. | ||
|
|
||
| Platform authors can expose environment-specific variables like memory allocation, storage capacity, security settings, and performance configurations, ensuring each environment gets the right balance of cost and capability. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.