Serverless backend application for cake order system using AWS services Lambda, API Gateway, DynamoDB, Kinesis, SES and SQS.
This project was built as a learning exercise for LinkedIn Learning course AWS for Developers: Data-Driven Serverless Applications with Kinesis by Marcia Villalba.
- NPM
- AWS account with programmatic access
- Serverless CLI
NOTE: When configuring the AWS programmatic access, make sure to use
--profile=[profile_name]
option to save configuration as a new profile so that it will not override any default profile credentials.
- Clone the repo
git clone https://github.com/snthamel/sls-cake-ordering-system.git
- Install NPM packages
npm install
For testing, you can create disposable email addresses for both 'application' and 'cake producer'. Make sure to change the [email protected]
and [email protected]
in serverless.yml with the emails you have created.
While using the SES sandbox, we have to verify both email addresses used by the application in order to prevent it from spamming.
Once the serverless cli is configured with aws credentials, execute
AWS_PROFILE=[profile_name] serverless deploy
or
AWS_PROFILE=[profile_name] sls deploy
to deploy the serverless application to AWS platform.
The deployment will create 3 APIs which can be used to create order, update order as fulfilled and complete order once delivered
POST /order
Sample request body
{
"name": "John Appleseed",
"address": "California, CA",
"productId": "PRD-10101",
"quantity": 1
}
POST /order/fulfilled
Sample request body
{
"orderId": "29a21200-d1c2-11eb-a8f0-99b0604ad05f",
"fulfillmentId": "FL99999"
}
POST /order/delivered
Sample request body
{
"orderId": "29a21200-d1c2-11eb-a8f0-99b0604ad05f",
"deliveryCompanyId": "DHL-38293829",
"orderReview": 5
}
If the application needs to be removed from the AWS cloud, execute
$ AWS_PROFILE=[profile_name] serverless remove
or
$ AWS_PROFILE=[profile_name] sls remove
to delete all the AWS resources.
NOTE: You will need to remove any verified email addresses through the SES dashboard manually
Distributed under the GNU General Public License License. See LICENSE
for more information.
Shehan Thamel - @shehanthamel - [email protected]