+
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

Using yarn

corepack enable         // enable corepack
yarn set version berry  // set yarn to latest version
yarn                    // install dependencies
Screenshot 2025-04-05 at 6 10 03 PM
yarn dev          // run the development server
Screenshot 2025-04-05 at 6 18 51 PM
yarn build        // build both client side and server side build
Screenshot 2025-04-05 at 6 17 23 PM

Additional Commands

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

CDK

yarn build:cdk    // build the cdk
yarn 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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载