A streaming AI chat agent built on AWS Blocks — username/password auth, per-user conversation history, and token-by-token responses. Runs fully locally with no AWS account.
Requires Node.js ≥ 20.19 and pnpm.
pnpm install
pnpm devOpen http://localhost:3000, create an account, and start chatting.
Locally the agent replies with a built-in canned mock (no setup, no cost). For real responses, run Ollama — the agent picks it up automatically:
ollama serve
ollama pull llama3.1:8b| Path | Purpose |
|---|---|
aws-blocks/index.ts |
Backend (IFC): Scope, AuthBasic, Agent, ApiNamespace |
src/lib/ |
Framework boundary — auth and chat services (no React) |
src/hooks/ |
Logic — useAuth, useAuthForm, useAgentChat |
src/components/ |
UI — AuthForm, Chat, shadcn primitives under ui/ |
src/App.tsx |
App shell |
| Command | Description |
|---|---|
pnpm dev |
API + web dev servers |
pnpm typecheck |
tsc --noEmit |
pnpm check |
Biome lint + format (check:fix to apply) |
pnpm knip |
Find unused files, dependencies, and exports |
pnpm build |
Production build |
Requires AWS credentials and a CDK-bootstrapped account. The same code that runs locally deploys unchanged — the agent runs on Amazon Bedrock.
pnpm sandbox # fast, ephemeral deploy for testing
pnpm deploy # full production deployThe backend is infrastructure-from-code: the Blocks in aws-blocks/index.ts synthesize to AWS CDK / CloudFormation. Generate the template without deploying:
pnpm dlx cdk synthCustomize or add raw CDK resources in aws-blocks/index.cdk.ts.