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年前991ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ