Skip to content

aws-devtools-labs/aws-blocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

AWS Blocks

npm versionweekly downloadsbuild status

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

Getting started

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 dev

npm 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 an aws-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.

How it works

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.

Blocks

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.

Supported platforms

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.

Repository layout

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

Building from source

Requires Node.js 22 or later.

npm install
npm run build
npm test

Contributing

Contributions, feedback, and questions are welcome.

License

Apache-2.0

About

Composable building blocks for full-stack AWS apps β€” define infrastructure and runtime code together with end-to-end type safety, local mocking, and native client codegen for Kotlin, Swift, and TypeScript.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors