AWS Blocks is a backend toolkit for building full-stack applications on AWS. Each Block is a self-contained backend capability that bundles your application code, a local development setup, and the infrastructure to run it. Pick the Blocks you need, compose them, and AWS Blocks defines the AWS infrastructure for you following AWS best practices. Your entire application runs locally without an AWS account β when you're ready, deploy the same code to AWS without changing it.
π Documentation: AWS Blocks Developer Guide
Requires Node.js 22 or later and npm 10 or later.
npm create @aws-blocks/blocks-app@latest my-app
cd my-app
npm install
npm run devnpm run dev starts a local development server at http://localhost:3000 with every Block running a local implementation β no AWS account or credentials required. Define your backend in aws-blocks/index.ts and your frontend in src/; types flow end to end with no code generation step.
- Start from a specific template with
--template <name>. Available templates:default,nextjs,react,auth-cognito,demo,bare,backend,amplify. - Run the command inside an existing project (omit the directory, or pass
.) to add anaws-blocks/backend to it. The CLI auto-detects an AWS Amplify Gen 2 project and integrates with it.
For a full walkthrough, see Getting started with AWS Blocks.
AWS Blocks uses Node.js conditional exports to load different code for each context:
- Local development β Blocks use in-memory and filesystem storage; your app runs on your machine.
- CDK synthesis β Blocks produce CDK constructs, and AWS Blocks generates a CloudFormation template.
- AWS Lambda runtime β Blocks call AWS services through the SDK.
The same new KVStore(scope, 'todos') line becomes a local store in development, an Amazon DynamoDB table at deploy time, and SDK calls in production β with no code changes.
A Block is a module that gives you a complete feature: cloud resources, a runtime API, and a local implementation. Each Block is published as an npm package, and the umbrella package @aws-blocks/blocks re-exports every Block plus the core runtime.
| Category | Blocks |
|---|---|
| Data & storage | KVStore, DistributedTable, Database, DistributedDatabase, FileBucket |
| Authentication | AuthBasic, AuthCognito, AuthOIDC |
| Compute & background | AsyncJob, CronJob |
| AI | Agent, KnowledgeBase |
| Communication | Realtime, EmailClient |
| Configuration | AppSetting |
| Observability | Logger, Metrics, Tracer, Dashboard |
| Hosting | Hosting |
For the full catalog and per-Block API reference, see the AWS Blocks Developer Guide.
Type safety extends from your backend all the way to your client across web frameworks (Next.js, Nuxt, Astro, React, Vue, Svelte, Angular), native mobile (Swift, Kotlin, Dart/Flutter), and desktop applications.
Native clients are build-time code generators that produce type-safe client code from a Blocks spec (blocks.spec.json), paired with a runtime library that calls your backend over JSON-RPC:
- kotlin β Kotlin Multiplatform (Android, iOS, JVM). Gradle plugin + KMP runtime.
- swift β Swift Package (iOS, macOS). SwiftPM build plugin + Foundation-based runtime.
- dart β Dart / Flutter client. Generates a typed Dart client from your Blocks spec.
blocks/
βββ packages/ # Blocks, the core runtime, and the create-blocks-app CLI (published to npm)
βββ native/ # Native client SDKs (Kotlin, Swift, Dart)
βββ test-apps/ # Example applications and end-to-end tests
βββ scripts/ # Repository tooling and automation
Requires Node.js 22 or later.
npm install
npm run build
npm testContributions, feedback, and questions are welcome.
Apache-2.0