How gedaaaa/personal-serverless-web-app works
Project Type and Purpose
• This is a full-stack monorepo designed as a personal serverless web framework for rapid prototyping and tech exploration.
• Frontend is a SvelteKit/Svelte 5 application deployed via SST.
• Backend consists of multiple Kotlin/Micronaut microservices, each deployed as AWS Lambda functions.
• Infrastructure is defined and deployed with AWS CDK (Java/TypeScript), and content is delivered via Cloudflare.
High-Level Architecture Components
• Developer Environment: VS Code Dev Container, Docker, local‐env scripts, NX/pnpm workspace
• CI/CD: GitHub Actions workflows (ci-pr.yml, cd-merge.yml)
• Frontend (apps/frontend/demo-website): SvelteKit app deployed by SST → CloudFront/CDN (Cloudflare)
• Backend Microservices (apps/backend/\<service\>/{app,infra}):
• Service Code (Kotlin/Micronaut) → AWS Lambda functions
• Infra Code (AWS CDK stacks) → API Gateway, DynamoDB tables, SQS queues, IAM, Parameter Store
• Shared Library (libs/jvm-shared-lib): common DynamoDB, SQS, SSM, security, types, utilities
• AWS Services at runtime:
• API Gateway
• Lambda Functions (Auth, Email, Memo, Helloworld)
• DynamoDB (one table per service)
• SQS Queues (for email & notification messages)
• SSM Parameter Store (config)
• CloudFront + Cloudflare CDN
Relationships and Data Flows
a. Browser → Cloudflare CDN → Frontend SvelteKit app
b. Frontend → HTTP(S) calls to API Gateway endpoints (e.g. /auth/*, /memo/*)
c. API Gateway → routes to corresponding AWS Lambda (Microservice handler)
d. Lambda (Auth/Memo) ↔ DynamoDB for reads/writes
e. Lambda (Memo) → publishes notification messages to SQS → triggers Lambda in Email service
f. Email Lambda → pulls message from SQS → sends email via external provider (Resend)
g. All Lambdas read config/credentials from SSM Parameter Store
h. CDK stacks → define and deploy all AWS resources
Architectural Patterns & Principles
• Microservices: each domain (auth, memo, email, helloworld) is isolated into its own service and infra stack
• Serverless: compute via AWS Lambda, auto-scaling, pay-per-use
• Event-driven: SQS queues decouple memo notifications from email sending
• Infrastructure as Code: AWS CDK definitions live alongside application code
• Shared Library: centralize cross-cutting concerns (DynamoDB config, SQS config, security, types)
Essential Elements to Capture
• Frontend (SST stack)
• API Gateway routing to each Lambda
• Lambda functions for Auth, Memo, Email, Helloworld
• DynamoDB tables per service
• SQS queues and event triggers
• SSM Parameter Store for configuration
• Shared library dependency
• CI/CD pipeline and DevContainer local workflow