This is a Serverless API that allows users to interact with a vending machine system. Users can read, create, delete, and purchase products from the vending machine using RESTful API endpoints. The project is built using Node.js, TypeScript, and the Serverless Framework, and is deployed on AWS.
This project aims at demonstrating how to use Serverless Framework and AWS API Gateway to create a REST API through which you can invoke a Lambda function using an HTTP request to endpoints that will perform create, read, update, and delete (CRUD) operations on a DynamoDB table.
- Node.js
- TypeScript
- Serverless Framework
- AWS API Gateway
- AWS Lambda
- DynamoDB
You will need the following packages installed locally,
- AWS CLI
- NodeJS (14.18.0 or higher)
- NPM
First, run the following commands in the same order
npm install -g serverless
npm install
npm run dynamodb:install
To start lambda functions and DynamoDB locally in the offline mode use the following command:
npm run sls:offline
To deploy the lambda functions to AWS run the following command:
npm run deploy
To remove all resources created on AWS run the following command:
npm run remove
If you would like to contribute to the project, please open a pull request with your changes.