All Projects → dabit3 → next.js-authentication-aws

dabit3 / next.js-authentication-aws

Licence: other
This project deploys a Next.js project to AWS with comprehensive authentication enabled

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Next.js authentication with AWS

This code goes along with my tutorial The complete Guide to Authentication with Next.js and AWS

This project contains an end to end solution for Next.js authentication on AWS with AWS Amplify.

  1. Client authentication
  2. Accessing the user session on the client
  3. Protected client routes
  4. Client-side redirects
  5. Accessing the user session in a server-side route (getServerSideProps)
  6. Protected server routes (getServerSideProps)
  7. Server-side redirects (getServerSideProps)
  8. Accessing the user session in an API route
  9. Deploying the app using the Next.js Serverless Component

To deploy the authentication service and run the app, follow these steps:

  1. Clone the repo
git clone https://github.com/dabit3/next.js-authentication-aws.git
  1. Change into the directory and install the dependencies
cd next.js-authentication-aws

npm install
  1. Initialize the Amplify project
amplify init
  1. Deploy the authentication service
amplify push --y
  1. Run the app locally
npm run dev

Deploying with Serverless Framework

npx serverless
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].