SCFS is a sample serverless application built on AWS that allows users to submit feedback with optional file attachments. The system automatically categorizes feedback, saves it to a DynamoDB table, stores files in an S3 bucket, and notifies the relevant department through SNS.
The application uses AWS Lambda for processing feedback, Amazon API Gateway for the RESTful endpoint, Amazon S3 for storing attachments, Amazon DynamoDB for persisting feedback, and Amazon SNS for notifications.
- AWS CLI installed and configured
- Node.js and NPM installed
- AWS CDK installed
- An AWS account with appropriate permissions
To deploy the SCFS stack:
- Clone the repository to your local machine.
- Navigate to the project directory.
- Run
npm installto install the required dependencies. - Navigate to the
lambdadirectory and runnpm installto install Lambda function dependencies. - Back in the project root, run
cdk deployto deploy the stack to your AWS account.
To test the feedback submission:
- Use Postman or a similar tool to send a
POSTrequest to the API Gateway endpoint. - Set the body to
form-dataand include thefeedbackandattachmentskeys. - Observe the response and verify that the feedback is stored in DynamoDB and the attachment is stored in S3.
feedback: The text content of the feedback.attachments: A file to be attached to the feedback.
200 OK: Feedback processed successfully.5xx Internal Server Error: An error occurred processing the feedback.
Ensure the following environment variables are set:
ALARM_NOTIFY_EMAIL: Email for the notifications sent by SNS
To delete the SCFS stack and all its resources:
- Run
cdk destroyfrom the project root.
Contributions to the SCFS project are welcome. Please follow the existing code style and add unit tests for any new or changed functionality.
This project is under MIT license.