This project is a serverless Todo API built on AWS using Clean Architecture principles and a monorepo structure. It leverages the Serverless Framework with TypeScript and esbuild for fast build times. Additionally, this project uses pnpm workspaces for efficient package management.
- AWS Lambda for serverless functions
- AWS API Gateway for API management
- AWS DynamoDB as the NoSQL database
- AWS Cognito for user authentication and authorization
- Serverless Framework and serverless compose to manage and deploy the infrastructure
- TypeScript for type safety and better code maintainability
- Clean Architecture for separation of concerns and modularity
- pnpm workspaces for efficient package management
- esbuild for fast builds and bundling
This folder contains various directories related to the project. For more information about each directory, please refer to their respective README files:
-
/api
: Contains the API (backend) implementation./api/infra
: Contains the Infrastructure as Code (IaC) configuration for the API (only stateless resources)./api/src
: Contains the source code for the API implementation./api/src
: Contains the source code for the API implementation./api/src/application
: Contains the application layer of the API./api/src/domain
: Contains the domain layer of the API./api/src/infrastructure
: Contains the infrastructure layer of the API./api/src/main
: Contains the main entry points for the application./api/src/presentation
: Contains the presentation layer of the API.
-
/common
: Contains shared utilities and code. -
/infra
: Contains the Infrastructure as Code (IaC) configuration for the project's stateful resources.
- Install dependencies:
pnpm run install
- create .env file (dev stage):
cp infra/.env.example infra/.env.dev
- Deploy the infrastructure:
pnpm run deploy
pnpm run start
This will launch the Serverless Offline plugin and enable you to test your API locally.
pnpm run remove
This Serverless TODO API project is an example of how to leverage the AWS ecosystem and clean architecture principles to build a robust, maintainable, and scalable application. By following the instructions in this README, you can successfully set up, deploy, and manage the API using the Serverless Framework, TypeScript, and other modern tools.
If you have any questions, suggestions, or issues, please feel free to open an issue or submit a pull request. Your feedback is always welcome and appreciated!
Happy coding!