Builder Book logo

Book: SaaS Boilerplate

  1. Introduction. Project structure.
  2. GitHub. VS Code Editor. Node. Yarn. TypeScript. TSLint. Next.js. Environmental variables.
  3. Material-UI. Theme. Dark theme. Shared layout. Shared styles. Shared components. Mobile browser.
  4. HTTP. APP server. Next-Express server. Fetch method. API methods. async/await. API server. Express server. Environmental variables. Logs.
  5. User model. Mongoose and MongoDB. MongoDB index. Jest testing. Your Settings page. File upload to AWS S3.
  6. Login page. Google OAuth API. Session and cookie. Authentication HOC withAuth.
  7. Google OAuth. Mailchimp.
  8. AWS SES. EmailTemplate. Welcome email.
  9. Passwordless OAuth.
  10. Team. Invitation. Invitation email.
  11. Stripe. Customer. Subscription. Invoice.
  12. Discussion. Post.
  13. Web sockets.
  14. Create Post via email. AWS Lambda. AWS API Gateway.
  15. Deploy to AWS Elastic BeanStalk.

Chapter 5: Login page. Google OAuth API. Session and cookie. Authentication HOC withAuth.

Available for pre-order for $99. The price becomes $199 once published.


In Chapter 5, you will start with the codebase in the 5-begin folder of our saas repo and end up with the codebase in the 5-end folder.

We will cover the following topics in this chapter:

  • Login page
    - LoginButton
    - redirectUrlAfterLogin
  • Session and cookie
    - Express session at API server
    - Session document in MongoDB database
    - Retrieving user from database using cookie
  • Google OAuth API
    - request from APP to API
    - Express routes
    - Static methods on User Model
    - Testing Google OAuth API
  • Authentication HOC withAuth
    - Redirect logic
    - firstGridItem
    - Wrapping pages
    - Testing redirects

Available for pre-order for $99. The price becomes $199 once published.


format_list_bulleted
help_outline
lens