TS Lambda KIT - for making backend with TypeScript, NodeJS v18 & AWS SAM CLI 🎁 Use it to build your application quickly with a cool Architecture — Trying to provide generic functionality
ts-lambda-kit
By running single command, you will get a production-ready
TypeScript lambda application and fully configured on your machine. Our goal is to provide you with a very cool, opinionated architecture. It will provide you with things like generic functionalities for the lambda function and cool request handling support with Amazon API Gateway, AWS CloudFormation, and Amazon DynamoDB.
It makes things very easy when the question comes with build, and deploy. It has a strong focus on making sure everything is developer-friendly.
To create a project, simply run:
npx ts-lambda-kit <project-name>
This project contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.
src
- Code for the application's Lambda function written in TypeScript.events
- Invocation events that you can use to invoke the function.__tests__
- Unit tests for the application code.serverless.yml
- A template that defines the application's AWS resources.The application uses several AWS resources, including Lambda functions and an API Gateway API. These resources are defined in the serverless.yaml
file in this project. You can update the template to add AWS resources through the same deployment process that updates your application code.
install awscliv2
, aws-sam-cli
, nodejs 18
(and make
only for macOS and Linux) on your machine and ensure that your aws iam account is configured. the configuration profile should be located at ~/.aws/config
, access credentials should be located at ~/.aws/credentials
.
To build and deploy your application for the first time, run the following commands in your shell using makefile
(only for macOS and Linux):
make install
make build
Before deployment, open the Makefile
and add your AWS-configured profile name at the profile
variable.
Wait, you may try this command on your terminal to check what is the name of your aws-configured profile:
aws configure list-profiles
make deploy
The 2nd command will build the source of your application. The 3rd command will package and deploy your application to AWS, with a series of prompts:
CAPABILITY_IAM
value for capabilities
must be provided. If permission isn't provided through this prompt, to deploy this example you must explicitly pass --capabilities CAPABILITY_IAM
to the sam deploy
command.sam deploy
without parameters to deploy changes to your application.You can find your API Gateway Endpoint URL in the output values displayed after deployment.
See the AWS SAM developer guide for an introduction to SAM specification, the SAM CLI, and serverless application concepts.
Contributions are more than welcome! We are excited to explore how we can create something truly remarkable together!
ISC 2023