Skip to content
/ vite-aws Public template

Template for a web server application deployed with a cost-effective scalable AWS architecture

Notifications You must be signed in to change notification settings

bebeal/vite-aws

Repository files navigation

vite-aws

Template for a web server application deployed with a cost-effective scalable AWS architecture:

  • Static content served via CloudFront distribution from S3
  • Serverless API endpoints using Lambda functions with Express routes for on-demand compute
  • Infrastructure as Code using AWS CDK for manageable deployments
  • Near-zero cost when idle, with pay-per-use pricing for both static hosting and API compute
  • Built in MDX rendering see https://vite-aws.com/posts

Features

Other Libraries

Environment Setup

After cloning, copy .env.example to .env and add your AWS credentials.

Note: Env variables are injected into the lambda function as environment variables. (except for reserved AWS variables)

Development

bun install             // install dependencies
Screenshot 2025-04-05 at 6 10 03 PM
bun dev           // run the development server
Screenshot 2025-04-05 at 6 18 51 PM
bun build         // build both client side and server side build
Screenshot 2025-04-05 at 6 17 23 PM

Additional Commands

bun clean         // clean everything thats generated in the build/dev process
bun build:client  // build the client side to dist/client
bun build:server  // build the server side to dist/server
bun lint          // run eslint
bun format        // run prettier
bun test          // run tests

CDK

bun build:cdk     // build the cdk
bun deploy        // deploy the cdk
Screenshot 2025-04-05 at 6 27 30 PM

MDX

This branch adds MDX support with the following features:

  • MDX file rendering with frontmatter support
  • Math equations with KaTeX
  • GitHub Flavored Markdown
  • Color chips for hex codes
  • Syntax highlighting with starry-night
  • Auto MDX rendering for routes under /posts