This project uses npm workspaces to manage a React TypeScript webapp built with Vite.js and a CDK stack for deployment to AWS.
packages/webapp: React TypeScript application built with Vite.jspackages/cdk: AWS CDK stack for deploying the webapp to S3 and CloudFrontpackages/api-mock: Local development server for testing API Gateway and Lambda functions
- Node.js (v18 or later recommended)
- AWS CLI configured with your credentials
- AWS CDK installed globally (
npm install -g aws-cdk)
- Install dependencies:
npm run setup
-
Run the mock-api locally:
npm run start:web -
Run the API mock server locally:
npm run start:api
-
Deploy to AWS (builds all workspaces and deploys the CDK stack):
npm run deployThis command will:
- Build the webapp
- Build the CDK stack
- Bootstrap the CDK environment if needed
- Deploy all CDK stacks
- S3 bucket for hosting the webapp
- CloudFront distribution for content delivery
- Frontend: React 19 with TypeScript
- Build Tool: Vite.js 6
- Infrastructure: AWS CDK v2
- Deployment: AWS S3 + CloudFront
npm run setup: Install all dependenciesnpm run start: Start the webapp in development modenpm run deploy: Build all workspaces and deploy to AWSnpm run lint --workspace=webapp: Run ESLint on the webappnpm run test --workspace=cdk: Run tests for the CDK stack