Serverless web form

0

Hey Geeks

I want to build a serverless form, and this is what am thinking in, and I appreciate it if you share your comments

ReactJs form hosted in S3 > lambda python to take the inputs from the form > save the form data to dynamo

any comment? do you have a detailed tutorial on the same?

已提问 2 年前1017 查看次数
4 回答
3

HI, The overall architecture you propose is sound. You can use S3 to host a static website, like a ReactJs single-page-application. To set that up, I'd recommend looking into Amplify Hosting, which helps you set up git-integration with CI/CD functionalities to automatically deploy as you commit new changes to the application.

To receive data from the ReactJs application you can use the API Gateway -> Lambda -> DynamoDB pattern. If you don't want to do any server-side validation and just post the data straight into the DB, you can use the API Gateway -> DynamoDB pattern. Both of these are available in Serverless Land.

AWS
Niklas
已回答 2 年前
AWS
专家
已审核 2 年前
2
RoB
已回答 2 年前
1

AWS has a good walk-through for setting up Lambda with API Gateway:

https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-with-lambda-integration.html

If the use case is just a simple website with a form, I'd probably do all the validation on the front end and do direct API Gateway --> DynamoDB.

If you want submitting the form to set in motion a number of events such as sending an email, notifying customer service, updating a database, etc etc, you could use API Gateway --> EventBridge. Then create rules on EventBridge to trigger these events.

Check this link for API Gateway --> EventBridge integration.

https://serverlessland.com/patterns/apigateway-rest-eventbridge

Jackson
已回答 2 年前
0

I recently finished a project that addressed your requirements. I used NextJS with their Vercel hosting and SAM to manage the API and Lambda with CloudFormation. I’m using SES to send an email and then record the data in DynamoDB. My Lambda is written in Golang, but you can get the idea of things from this repo.

The only thing missing from the API currently is authentication. I was planning on using Cognito and the token from an un-authenticated user, however that's proving somewhat challenging. If anyone has tips on that I'd love to hear from you.

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则