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?

demandé il y a 2 ans1006 vues
4 réponses
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
répondu il y a 2 ans
AWS
EXPERT
vérifié il y a 2 ans
2
RoB
répondu il y a 2 ans
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
répondu il y a 2 ans
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.

répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions