This is a serverless API for KMA Score. It's written in TypeScript and runs on AWS Lambda.
This project is structured as a monorepo and based on Domain Driven Design (DDD). Actually, I don't know much about DDD, this is my pet project to practice it.
βββ packages
β βββ core - Contains all of your business logic following clean architecture and domain driven design
β β βββ src
β β βββ application - Define behaviour of the application, interact with services from outside packages/core
β β β βββ ports - Define contracts interfaces that should be honoured by the infrastructure.
β β β βββ useCases - Define application use cases which should be independent of the infrastructure. Use cases request and response will interact with outside world.
β β β βββ util
β β βββ container - Contains the dependency injection container using `awilix`.
β β βββ domain - Contain main domain business logic including entities, value objects, interfaces, enum
β β βββ infra - Contains concrete lower level detail of outside world which should honours/implements contracts (interfaces) from application/ports.
β β βββ shared - Contains shared classes and interfaces across core package.
β βββ functions - Contains the Lambda functions.
β βββ src
β βββ middleware - Contains the middlewares.
βββ stacks - Contains the app's infrastructure as code (IaC).
βββ layers - Contains the Lambda layers.
$ pnpm i- Create a
.secretsfile in the root directory and fill information from.secrets.example. - Set up the AWS CLI with your credentials.
$ aws configure
# if you want to use SSO
$ aws sso configureIf you want to use a different profile, you can set the AWS_PROFILE environment variable.
$ export AWS_PROFILE=your-profile- Login to AWS (if you use SSO)
$ aws sso login- Load secrets to AWS
$ pnpm sst secrets load .secrets$ pnpm dev- If you want to use your custom domain, you need to have a certificate in ACM.
- Set the secrets in
.secretsfile to deploy enviroment.
$ pnpm deploy --stage [stage_name]This project is licensed under the MIT License - see the LICENSE file for details.