previously ux ui davidwells io refactor your react app
play

@ previously UX/UI @ davidwells.io Refactor your React App into - PowerPoint PPT Presentation

I'm @DavidWells Software Developer @ previously UX/UI @ davidwells.io Refactor your React App into Angular 1 and then back to jQuery lolz jk Serverless React + Serverless: a match made in heaven Life Goals Scaling servers is... hard


  1. I'm @DavidWells Software Developer @ previously UX/UI @ davidwells.io

  2. Refactor your React App into Angular 1 and then back to jQuery

  3. lolz jk

  4. Serverless

  5. React + Serverless: a match made in heaven

  6. Life Goals

  7. Scaling servers is... hard

  8. Love you Wes ❤ Check out all Wes's courses wesbos.com/courses

  9. • Load balancing • Security concerns • Monitoring • Logging • follower database instances • costs... • .......

  10. AWS Lambda

  11. Code that runs on-demand inside the cloud of your choice - Pay per execution pricing - Never pay for idle servers - Auto scales for you - Event driven workflows - Leverage third party services

  12. Code that runs on-demand inside the cloud of your choice and auth0 webtasks, oracle functions, kubernetes, & spotInst....

  13. use cases

  14. use cases • REST APIs, Graph APIs: lambda -> API Gateway endpoint • event-driven workflows, scheduled tasks, data transforms • real-time/streaming, batch processing: kinesis -> lambda • web, mobile & IoT • file manipulation • dynamic websites backends • voice apps (Alexa) • web hook listeners • form processing • ETL workloads • CRON jobs • authentication • image resizing • CI/CD pipelines • devops automation • video transcoding • log analytics • chatbots • security audits github.com/serverless/examples

  15. github.com/serverless/forms-service

  16. Frontend • Create React App • Hosted on Netlify • Using react router 4 • State via Redux • Talks to API Gateway via axios • Auth via Auth0 github.com/serverless/forms-service

  17. Backend • Node backend running in AWS Lambda Functions • DynamoDB noSQL for database • Authorization via API Gateway Custom Authorizer Function github.com/serverless/forms-service

  18. serverless backend

  19. watch Serverless Authentication and Authorization http://bit.ly/aws-auth

  20. Custom Authorizer Flow

  21. 1. Create a new auth0 client

  22. 2. Make it a SPA

  23. 3. Note the Domain & Client ID values

  24. 4. Install the auth0 Authorization extension

  25. 5. setup permissions/groups/roles

  26. 6. create a new auth0 Rule to add roles to JWT

  27. 6b. attach the users roles to the JWT on login via rule

  28. 7. plug in auth0 clientID & auth0 domain to frontend + backend frontend backend _config.js config.prod.json

  29. 8. Deploy Backend Take your API endpoints and plug them into the UI

  30. 8b. Add API endpoints to frontend App

  31. 9. Deploy Frontend

  32. - Builds on github repo events (CI/CD flow) - Automatic Branch previews ⚡ - static site redirects via `_redirects` file 👍 - Handles proxied URLs - this gives us escape hatches for dynamic pages/content - Super cheap - amazing support - 💖 them

  33. Custom Authorizer Implementation see code: bit.ly/auth-code

  34. serverless.yml config file Where to run What to run When to run

  35. handler.js file named export saveUser function is referenced in serverless.yml

  36. serverless deploy in cwd framework packages & deploys code returns live API endpoints

  37. Serverless Use Cases for serverless.com - Web forms - Custom APIs - Automatic thumbnail generation - New user welcome emails - Lead revisit notifications - Showing related content on blog - Site search (Algolia) - Content A/B testing - Doc feedback github.com/serverless/site

  38. GraphQL Backend API

  39. REST Backend API UI serverless.com/framework/status

  40. bit.ly/2Br7w1w

  41. https://servers.lol/

  42. github.com/serverless/examples

  43. Search .serverless globally on github

  44. 
 Thanks for listening! Questions? Slides: Tweet @DavidWells davidwells.io

Recommend


More recommend