Build applications locally in seconds, deploy to AWS when ready
Ship applications on AWS with confidence. AWS Blocks gives you a functional local development environment with database, authentication, realtime, and more. No AWS account required until you are ready to ship.
Overview
AWS Blocks is an open source TypeScript framework that lets you compose backend capabilities from pre-built modules that generate infrastructure from code, letting you focus on business logic instead of infrastructure boilerplate. Run npm run dev and get a working application on your local machine, then deploy the same code to your AWS account with zero changes.
Benefits
Run npm run dev and get a fully functional local environment with Postgres, authentication, realtime, file storage, and background jobs. No AWS account, no infrastructure configuration, no waiting. When you deploy, infrastructure generates from the same application code you wrote locally. Your database queries, auth checks, and file operations do not change between environments.
Define your data schema once and your frontend types update automatically. No codegen step for TypeScript apps, no OpenAPI spec to maintain, no runtime type mismatches. TypeScript propagates types from your database layer through your API to your UI components.
Steering files ship directly in the npm package, guiding AI coding agents to produce correct architecture from the start. No plugin installation, no custom configuration. Agents have less freedom to misconfigure, and more freedom to test functionality end to end.
Every Block is backed by production AWS services. When you need deeper customization, drop one layer into AWS CDK and configure the underlying resources directly. You are never locked into an abstraction that cannot express what you need, and you never need to learn AWS services in depth unless you choose to.
AWS Blocks integrates with your existing resources. Connect to external Postgres services, APIs and auth providers.
Use Cases
Building blocks for your app
Define your API, database, authentication, and file storage in TypeScript. The same backend serves your web frontend through direct imports and mobile clients through generated Swift, Kotlin, and Dart bindings. Deploy once, serve every platform.
AI agents and chatbots
Build agents and conversational AI applications with the Agent Block (tool calling, conversation persistence, human-in-the-loop approval) and connect it to your data with the KnowledgeBase Block for retrieval-augmented generation. Test against any OpenAI-compatible endpoint (like Ollama on your local machine), then deploy to Bedrock in production.
Event-driven workflows
Compose background jobs, scheduled tasks, real-time notifications, and email into workflows that react to application events. AsyncJob processes uploads, CronJob generates nightly reports, Realtime pushes updates to connected clients, and EmailClient sends confirmations. Each runs locally for testing and deploys to managed compute in production.
Features
Building Blocks for your app
Each Block in AWS Blocks bundles backend logic, a type-safe API, a local testing configuration and steering files into a single import. You get 20+ Blocks covering the most common full-stack needs, each designed to work together.
-
Database provides a type-safe Postgres interface that runs locally via PGlite and deploys to managed Postgres on AWS.
-
Auth supports multiple authentication types including email/password, social login, enterprise SSO, and compatibility with existing auth providers.
-
Realtime delivers pub/sub with a local server for development and managed WebSockets in production.
-
FileBucket handles uploads and downloads with local filesystem storage that mirrors cloud behavior.
-
AsyncJob and CronJob run background work and scheduled tasks with local execution for testing and managed compute in production.
AI and observability
Build intelligent applications and monitor them with integrated observability, all using the same Block pattern.
-
Agent provides AI agent orchestration with tool calling and conversation persistence. Test locally against Ollama or any OpenAI-compatible endpoint before connecting to managed AI services in production.
-
KnowledgeBase connects your data sources to semantic retrieval with a single Block.
-
EmailClient sends email with local capture for development testing.
-
Logger, Metrics, and Tracer provide structured observability that writes to console locally and managed monitoring in production.
-
Dashboard generates observability dashboards from your metrics definitions automatically.
Local development
The local environment faithfully reproduces production behavior so your code runs identically in both contexts. No emulators to install, no Docker containers to manage, no cloud quotas to hit.
-
PGlite runs a real Postgres engine in-process for zero-latency database development.
-
Local JWT issues and validates tokens with the same claims structure as production auth.
-
Local WebSocket server provides full pub/sub semantics without an internet connection.
-
Local filesystem mirrors cloud storage API behavior for upload, download, list, and presigned URL generation.
-
Local AI runs agents and knowledge retrieval against Ollama or any OpenAI-compatible endpoint. Test tool calling, conversation flows, and RAG without API keys or cloud costs.
-
Hot reload restarts your backend on every save with sub-second feedback loops.
-
With Blocks Hosting deploy application frontends on AWS with SSR and ISR support
Frequently Asked Questions
FAQs
Open allNo. Run npm run dev and build your entire application locally. You need an AWS account only when you are ready to deploy to production.
Blocks is available at no additional charge. You pay only for the AWS resources used by your app, at standard AWS pricing.
Blocks use TypeScript generics and inference to propagate types from your schema definitions through the runtime API. When you change a column type in your database Block, your frontend code shows a type error immediately. No build step required.
Yes. Native client libraries for Swift, Kotlin, and Dart connect to the same Blocks backend that serves your web application. Authentication tokens, real-time subscriptions, and file storage work identically across platforms. You write one backend and serve web and mobile from it.
No. Blocks handle provisioning automatically. You write application code, and the framework encapsulates the CDK infrastructure code in your application. Progressive disclosure to CDK when you need deeper control, which most developers never need to touch.
When the built-in Blocks don’t cover your use case, you can create your own. A custom Block packages infrastructure, runtime logic, and local mocks into a single reusable module, shared across projects or with your team.
Getting started
npm create @aws-blocks/blocks-app@latest my-app
cd my-app
npm run dev
Your app is now running at localhost:3000 with a database, auth, and API ready to use.
Try this prompt with your AI agent:
"Add a FileBucket for user avatars, an AsyncJob that generates thumbnails on upload, and a Realtime channel that notifies the UI when processing completes."
Did you find what you were looking for today?
Let us know so we can improve the quality of the content on our pages