Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dabit3/next.js-authentication-aws
This project deploys a Next.js project to AWS with comprehensive authentication enabled
https://github.com/dabit3/next.js-authentication-aws
Last synced: 3 months ago
JSON representation
This project deploys a Next.js project to AWS with comprehensive authentication enabled
- Host: GitHub
- URL: https://github.com/dabit3/next.js-authentication-aws
- Owner: dabit3
- Created: 2020-09-21T11:48:19.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-21T03:21:51.000Z (over 4 years ago)
- Last Synced: 2024-10-28T11:54:58.055Z (4 months ago)
- Language: JavaScript
- Size: 224 KB
- Stars: 106
- Watchers: 2
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next.js authentication with AWS
> This code goes along with my tutorial [The complete Guide to Authentication with Next.js and AWS](https://dev.to/dabit3/the-complete-guide-to-next-js-authentication-2aco)

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
```sh
git clone https://github.com/dabit3/next.js-authentication-aws.git
```2. Change into the directory and install the dependencies
```sh
cd next.js-authentication-awsnpm install
```3. Initialize the Amplify project
```sh
amplify init
```4. Deploy the authentication service
```sh
amplify push --y
```5. Run the app locally
```sh
npm run dev
```## Deploying with Serverless Framework
```sh
npx serverless
```