SOLE — Serverless E-Commerce Platform
A fully serverless storefront on AWS, provisioned end-to-end with Terraform.
Overview
What it is
A production-style storefront built entirely on AWS serverless services. Users browse a catalog delivered through CloudFront + S3, authenticate with Cognito, place orders through API Gateway + Lambda, persist data in DynamoDB, and check out with Stripe. A separate admin dashboard provides inventory and order management. Infrastructure is managed with Terraform, while GitHub Actions automates CI/CD with AWS OIDC authentication and security scanning.
- Serverless architecture — Zero long-running servers; Lambda and managed AWS services handle application workloads.
- Authentication & checkout — Cognito supports registered-user authentication and guest checkout with JWT-based API authorization.
- E-commerce data layer — Single-table DynamoDB design supports products, carts, and orders.
- Admin dashboard — Dedicated dashboard for inventory and order management.
- DevSecOps pipeline — GitHub Actions runs linting, tests, Trivy vulnerability/IaC scanning, SonarQube analysis, Terraform plan, and deployment.
- Keyless AWS authentication — GitHub Actions assumes a scoped AWS IAM role through OIDC; no long-lived AWS credentials.
- Infrastructure as Code — Terraform manages the serverless infrastructure, IAM roles, and CloudFront configuration for repeatable deployments.
Architecture
How it's wired
Architecture at a glance
Grouped view of the stack while the real diagram is prepared
Edge / Delivery
- API Gateway
- S3
- CloudFront
Data
- DynamoDB
Identity & Secrets
- Cognito
Delivery & Ops
- Terraform
- GitHub Actions
- Stripe
Other
- AWS Lambda
- Trivy
- SonarQube

Challenges
Problems worth solving
Challenge
Keeping the storefront cheap while still feeling instant globally.
Solution
Static assets and product pages served from S3 through CloudFront with long-lived cache headers and cache invalidation on deploy.
Challenge
Avoiding a tangle of IAM policies as we added Lambdas.
Solution
One Terraform module per service that emits its own least-privilege role, so permissions live next to the code that needs them.
Challenge
Handling Stripe webhooks reliably without a persistent server.
Solution
Dedicated webhook Lambda behind API Gateway with idempotency keys stored in DynamoDB and CloudWatch alarms on failure rate.
Engineering
Decisions I made
- Chose DynamoDB over RDS to stay fully serverless and avoid VPC/NAT costs.
- Used Terraform (not CDK) to keep the infra portable and reviewable in plain HCL.
- Adopted trunk-based development with short-lived branches and PR previews.
Security
How it stays safe
- Cognito-issued JWTs required for all write endpoints via API Gateway authorizers.
- Least-privilege IAM per Lambda; no wildcard permissions.
- Secrets (Stripe keys, JWT signing keys) stored in AWS Secrets Manager.
- S3 buckets private by default; public read only through the CloudFront OAC.
CI/CD
How it ships
- GitHub Actions triggers on push and PR.
- Pipeline runs ESLint, unit tests, and terraform fmt/validate.
- terraform plan posted as a PR comment for review.
- On merge to main: terraform apply, Lambda deploy, CloudFront invalidation.
Retro
What I'd tell myself in week one
- Serverless is cheap when idle but you pay in cold starts — measure p95, not just p50.
- A good CI pipeline is a design tool: it forces you to name every environment.
- Terraform state is production data. Back it up and lock it (S3 + DynamoDB).
Next
Future improvements
- Add step functions for the order fulfillment saga.
- Introduce OpenTelemetry traces across Lambda + API Gateway.
- Add a Playwright end-to-end suite that runs against a preview environment.