A full-stack e-commerce project with a React frontend and AWS-backed infrastructure. It supports product browsing, cart + checkout flow, authentication via Cognito (Google + email/password), and protected admin operations.
- Product listing and details
- Cart and checkout flow
- Order creation and success page
- My Orders Page
- User Profile Page
- Admin product create, update and delete
- Authentication via Cognito (Google + email/password)
- Protected admin routes (
admingroup required) - Order confirmation emails for customers
- Order notification emails for admin users
- Automated CI/CD with GitHub Actions, AWS IAM Roles, and OIDC-based authentication
- React 19, Vite, TypeScript
- TanStack Router, TanStack Query
- Zustand (cart state)
- Tailwind CSS + Radix UI
- AWS CDK (TypeScript)
- S3 (frontend hosting, product images)
- CloudFront (CDN)
- Lambda (API)
- API Gateway (Cognito authorizer)
- Cognito (auth + groups)
- DynamoDB (products, orders)
- SNS (order events)
- SES (email notifications)
- SQS Dead Letter Queue (DLQ)
- GitHub Actions (CI/CD)
- AWS IAM
- OpenID Connect (OIDC)
- Frontend is built with Vite and deployed to S3
- CloudFront serves both frontend and product images
- API Gateway routes requests to Lambda functions
- Lambda functions handle products, orders and notification workflows
- DynamoDB stores product and order data
- Cognito handles authentication and authorization
- SNS publishes order events
- Email notifications are sent via SES
- Failed message processing is routed to an SQS Dead Letter Queue (DLQ)
- GitHub Actions automates build and deployment workflows
VITE_PRODUCT_API_URL=
VITE_ORDERS_API_URL=
VITE_COGNITO_DOMAIN=
VITE_COGNITO_CLIENT_ID=
VITE_COGNITO_AUTHORITY=GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
FROM_EMAIL=
USER_POOL_ID=Before deploying the application for the first time, complete the following setup steps.
Bootstrap the target AWS account and region:
cd infra
npx cdk bootstrapThis only needs to be done once per AWS account and region.
Create OAuth credentials in Google Cloud Console.
Add the generated values to infra/.env:
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=These credentials are used to configure Google as an identity provider for Cognito.
Open AWS SES and verify an email address or domain that will be used to send emails.
Example:
Add the verified email address to the GitHub secret:
FROM_EMAIL
Email notifications will fail if the sender identity is not verified.
Create an OIDC Identity Provider in AWS:
Provider URL:
https://token.actions.githubusercontent.com
Audience:
sts.amazonaws.com
Create an IAM Role that:
- Trusts the GitHub OIDC provider
- Can be assumed by this repository
- Has permissions required for CDK deployment
Typical permissions include:
- CloudFormation
- IAM
- Lambda
- API Gateway
- Cognito
- DynamoDB
- S3
- CloudFront
- SNS
- SQS
- SES
Add the following repository secrets:
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
FROM_EMAIL
USER_POOL_ID
pnpm deploypnpm install
cd frontend
pnpm devApp runs on http://localhost:3000
pnpm deployThis:
- Builds frontend
- Deploys CDK stack
- Uploads assets to S3
- Invalidates CloudFront cache
- Serves the application through CloudFront
src/
api/ # API calls (products, orders)
components/ # UI + feature components
hooks/ # React Query hooks
routes/ # File-based routes
store/ # Zustand store
integrations/ # Providers
lib/ # Utilities
types/ # Types
infra/
# CDK definitions for:
# - S3 (frontend + images)
# - CloudFront distributions
# - Lambda functions
# - API Gateway
# - Cognito (auth, Google provider, groups)
# - DynamoDB (products, orders)
//product/:id/cart/checkout/order-success/:orderId/my-ordersprofile/admin/createProduct(protected)/admin/listProducts(protected)/admin/orders(protected)
-
Authenticated users:
- View profile
- View their orders
- Create orders
-
Admin users (Cognito group:
admin):- Create products
- Update products
- Delete products
pnpm build:frontend
pnpm deploy:infra
pnpm deployGitHub Actions is used to automate validation and deployment.
On pull requests:
- Install dependencies
- Typecheck frontend
- Build the frontend
On merges to the main branch:
- Install dependencies
- Configure AWS Credentials
- Build frontend assets
- Deploy AWS infrastructure using CDK
- Upload frontend assets to S3
- Update CloudFront-served application
Deployments authenticate to AWS using GitHub OIDC and an IAM role configured for GitHub Actions.
This eliminates the need to store long-lived AWS access keys as GitHub secrets and allows deployments to assume temporary AWS credentials through OpenID Connect.
ISC