How alexhddev/cdk-course-resources works
Purpose and Repository Layout
This is a collection of AWS CDK course projects. The primary application is space-finder: a serverless “spaces” API with authentication, data storage, monitoring, and a separately deployed React frontend. cdk-starter and cdk-cicd are smaller CDK examples/templates; s3template.json is a standalone CloudFormation template.
Primary Application Entry Points
CDK deployment composition starts at space-finder/src/infra/Launcher.ts, which instantiates infrastructure stacks. Lambda service entry points are organized under space-finder/src/services, notably spaces/handler.ts for the spaces API and monitor/handler.ts for monitoring. The browser application starts at space-finder-frontend/src/main.tsx and renders space-finder-frontend/src/App.tsx.
Infrastructure Stack Boundaries
space-finder/src/infra/stacks/AuthStack.ts provisions the authentication boundary, while DataStack.ts owns persistence resources. LambdaStack.ts packages and exposes backend Lambda functions; ApiStack.ts connects HTTP API routes to those functions. This separates resource ownership from API wiring and allows stacks to exchange generated resource references.
Spaces API and Domain Flow
Requests enter the API infrastructure, invoke the spaces Lambda handler, then dispatch to operation-specific services:
• Read: space-finder/src/services/spaces/GetSpaces.ts
• Create: space-finder/src/services/spaces/PostSpaces.ts and document-aware PostSpacesWithDoc.ts
• Update/delete: space-finder/src/services/spaces/UpdateSpace.ts, DeleteSpace.ts
• Routing/error boundary: space-finder/src/services/spaces/handler.ts
Domain types reside in space-finder/src/services/model/Model.ts. Shared validation and response/utilities are centralized in space-finder/src/services/shared/Validator.ts and space-finder/src/services/shared/Utils.ts.
Frontend and Backend Integration
The Vite/React frontend presents login, navigation, listing, and space creation workflows through space-finder-frontend/src/components/LoginComponent.tsx, components/spaces/Spaces.tsx, and components/spaces/CreateSpace.tsx. It crosses the browser/service boundary through space-finder-frontend/src/services/AuthService.ts and src/services/DataService.ts, which should consume deployed auth and API endpoints rather than direct infrastructure resources.
Deployment, Hosting, and Operations
space-finder/src/infra/stacks/UiDeploymentStack.ts deploys the frontend, implying static-site hosting backed by AWS infrastructure. MonitorStack.ts and services/monitor/handler.ts form a distinct monitoring path, likely collecting or reporting operational signals independently of CRUD handlers. Material runtime/services are TypeScript on Node.js, AWS CDK/CloudFormation, Lambda, an API layer, authentication service, data store, and static UI hosting.
Supporting CDK Examples
cdk-starter/bin/cdk-starter.ts launches a basic stack set including PhotosStack.ts and PhotosHandlerStack.ts. cdk-cicd/bin/cdk-cicd.ts launches a CI/CD-oriented CDK app composed from lib/cdk-cicd-stack.ts, PipelineStage.ts, and LambdaStack.ts; its sample Lambda is cdk-cicd/services/hello.ts.
Main entry points: Launcher.ts CDK launcher · GetSpaces.ts Space operations · LambdaStack.ts Lambda stack · AuthService.ts Auth and data clients
Components 19
Space Finder
Primary serverless application.
- Authentication
- Spaces data store
- Spaces HTTP API
- Spaces handler · Routes requests and handles errors.
space-finder/src/services/spaces/handler.ts - Space operations · Read, create, document create, update, and delete operations.
space-finder/src/services/spaces/GetSpaces.ts - Domain and shared utilities · Models, validation, and response utilities.
space-finder/src/services/model/Model.ts - Monitor handler · Independent operational reporting path.
space-finder/src/services/monitor/handler.ts
CDK Infrastructure
- CDK launcher · Composes the primary deployment stacks.
space-finder/src/infra/Launcher.ts - Auth stack · Owns authentication resources.
space-finder/src/infra/stacks/AuthStack.ts - Data stack · Owns persistence resources.
space-finder/src/infra/stacks/DataStack.ts - Lambda stack · Packages backend functions.
space-finder/src/infra/stacks/LambdaStack.ts - API stack · Wires HTTP routes to functions.
space-finder/src/infra/stacks/ApiStack.ts - UI deployment stack · Deploys static frontend hosting.
space-finder/src/infra/stacks/UiDeploymentStack.ts - Monitor stack · Deploys the monitoring path.
space-finder/src/infra/stacks/MonitorStack.ts
React Frontend
- Frontend bootstrap
space-finder-frontend/src/main.tsx - Spaces UI · Login, listing, and creation workflows.
space-finder-frontend/src/App.tsx - Auth and data clients · Consumes deployed auth and API endpoints.
space-finder-frontend/src/services/AuthService.ts
CDK Examples
- Starter CDK app · Launches photo-related stacks.
cdk-starter/bin/cdk-starter.ts - CI/CD CDK app · Composes pipeline, stack, and sample Lambda.
cdk-cicd/bin/cdk-cicd.ts
Connections 22
- CDK launcher → Auth stack: instantiates
- CDK launcher → Data stack: instantiates
- CDK launcher → Lambda stack: instantiates
- CDK launcher → API stack: instantiates
- CDK launcher → UI deployment stack: instantiates
- CDK launcher → Monitor stack: instantiates
- Auth stack → Authentication: provisions
- Data stack → Spaces data store: provisions
- Lambda stack → Spaces handler: packages
- Lambda stack → Monitor handler: packages
- API stack → Spaces HTTP API: exposes
- Spaces HTTP API → Spaces handler: invokes
- Spaces handler → Space operations: dispatches
- Space operations → Domain and shared utilities: uses
- Space operations → Spaces data store: reads and writes
- UI deployment stack → Frontend bootstrap: deploys
- Frontend bootstrap → Spaces UI: renders
- Spaces UI → Auth and data clients: uses
- Auth and data clients → Authentication: authenticates with
- Auth and data clients → Spaces HTTP API: calls
- Monitor stack → Monitor handler: deploys
- Starter CDK app → CI/CD CDK app