150 points by techlover 5 months ago flag hide 20 comments
user1 5 months ago next
Congrats on building a serverless React app! I'm curious, what inspired you to go the serverless route?
author 5 months ago next
Thanks! I wanted to reduce costs and make the app more scalable. Serverless was a great fit for my needs.
author 5 months ago next
Cold start times haven't been an issue for me, but I understand the concern. I've implemented some techniques to mitigate this, like using providers with lower cold start times or pre-warming functions.
user2 5 months ago prev next
Interesting. I've thought about going serverless for my app, but I'm concerned about cold start times. How have your experiences been?
user3 5 months ago prev next
I'm curious, what serverless provider did you choose and why?
author 5 months ago next
I went with AWS Lambda because it offers a lot of integrations and features. I'm also comfortable with the AWS ecosystem.
user4 5 months ago prev next
What about CI/CD? How did you handle deployments and versioning for your serverless components?
author 5 months ago next
I used GitHub Actions and Serverless Framework. It allows me to easily manage infrastructure and deploy changes. For versioning, I tag my releases and use Semantic Release to automatically update the version number.
user5 5 months ago prev next
Security is always a concern. How did you approach security for your serverless app?
author 5 months ago next
Absolutely. I followed best practices for securing AWS Lambda functions and used the AWS Security Hub for continuous security monitoring. Additionally, I used AWS WAF to secure my APIs and limited IAM permissions where possible.
user6 5 months ago prev next
You mentioned using User Management for authentication. Can you explain more about that?
author 5 months ago next
Of course! I used AWS Cognito for user management, authentication, and authorization. It makes it easy to handle user registration, login, and session management.
user7 5 months ago prev next
How do you handle client-side routing with serverless?
author 5 months ago next
For client-side routing, I used the HashRouter from the React Router library. It works well with serverless because it doesn't rely on server-side routing. I also used AWS API Gateway to handle API calls and authorization.
user8 5 months ago prev next
What were some of the challenges you faced while building the app?
author 5 months ago next
Some of the challenges I faced were managing serverless costs, handling deployment issues with GitHub Actions, and optimizing performance. I had to fine-tune some settings and implement techniques to ensure a smooth and cost-effective user experience.
user9 5 months ago prev next
How did you manage state in your serverless React app?
author 5 months ago next
I used the React Context API and Redux for state management. The Context API handled local component state, and Redux managed global state for easier debugging and better performance.
user10 5 months ago prev next
Definitely give this a read: <link_to_related_article>. It discusses some trade-offs and considerations when choosing serverless.
author 5 months ago next
Thanks for sharing! I'll definitely check it out.