https://github.com/matootie/bread
🍞 Bread is a template for a full-stack serverless application built using Bun. Deploys to AWS behind CloudFront, with a Lambda Hono API and an S3 hosted React app.
https://github.com/matootie/bread
aws aws-cdk bun full-stack hono lambda react serverless tailwindcss template
Last synced: 5 days ago
JSON representation
🍞 Bread is a template for a full-stack serverless application built using Bun. Deploys to AWS behind CloudFront, with a Lambda Hono API and an S3 hosted React app.
- Host: GitHub
- URL: https://github.com/matootie/bread
- Owner: matootie
- License: mit
- Created: 2025-02-26T02:24:22.000Z (about 1 year ago)
- Default Branch: trunk
- Last Pushed: 2025-02-26T07:16:26.000Z (about 1 year ago)
- Last Synced: 2025-02-26T07:31:44.114Z (about 1 year ago)
- Topics: aws, aws-cdk, bun, full-stack, hono, lambda, react, serverless, tailwindcss, template
- Language: TypeScript
- Homepage: https://d2n13o6gwa5r0y.cloudfront.net
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Full-Stack Serverless Bun Template
A full template for a serverless application built using Bun.
Features:
- AWS CDK for infrastructure-as-code to define Cloud resources. (`packages/cdk`)
- Custom Lambda Layer for Bun that plays nicely with Hono. (`packages/bun-layer`)
- Lambda based API using Hono. (`services/api`)
- Static-hosted web application using React. (`services/client`)
- Everything is neatly configured behind a CloudFront distribution (`packages/cdk`)
How to use:
- `bun run develop` will start the development server.
- `bun run build` will bundle all code and CDK definitions.
- `bun run package` will zip up all code to deploy.
- `bun cdk [...]` alias for aws-cdk CLI in the correct working directory.
- `bun cdk synth` will synthesize a CloudFormation template.
- `bun cdk diff` will show a diff between deployed CloudFormation state and local changes.
- `bun cdk deploy` will deploy the application to AWS.
### Development Server
The development server will hot-reload client changes. When using `bun run develop` the API server will also restart when changes are made.
Additionally, there's a proxy available in the development server that mimicks the CloudFront configuration. Any requests made to `/api` or `/api/*` will be forwarded to the API server locally. This way, you can hard code in your API request URLs in the client without worrying about local/deployed servers.