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 年前檢視次數 1014 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南