AWSome Agency is a fictional Digital B2B Agency that wants to allow ordering digital products online.
1/ The front-end is a static SPA website Vite + React deployed to S3 + CloudFront.
2/ The API is a HTTP API running in API Gateway and Lambda.
3/ tRPC is used in the API layer for e-2-e type safety.
4/ Data is stored in DynamoDB with Lambda processing the stream.
5/ Events go to Domain specific SQS queues and are processed by Lambda.
NB/ Only the Marketing SQS is set up and sends a slack message when a new Order is created. This is a mono-repo with workspaces for web and services. Dependencies are managed at the top level project.
In order for the API Url to be passed to the Static Website. A config.json file is created at deploy time. The React app gets the URL from this file.
If you are running the web dev server locally create a config.json in the web public folder.
If you have a slack URL to use, you can store in AWS SSM Param store with the below CLI command - replace value with actual slack url.
aws ssm put-parameter \
--name "/awesome-agency/slack-url" \
--type "String" \
--value "/services/UUID1/UUID2/UUID3" \
--overwrite
yarn cdk deploy --all
deploy all stackyarn cdk destroy --all
remove all stacksyarn test
run tests
cd web
go to web folderyarn dev
run the Vite react site locallyyarn css
start tailwind css watcher
- Store domain logic in the core folder under Marketing, Accounts etc.
- You can unit test your domain specific logic here.
- For Lambda handler functions store in the functions folder.
- Import domain logic into the handler functions where needed.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template