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년 전1003회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠