This is a simple frontend built to demonstrate the use of token-based authentication. It is built using React and NextJS. The app is deployed at dalcyn.com. The corresponding backend can be found in this repo: auth-backend
It has the following auth features:
- log in
- signup
- signup/login with GitHub
- change password
- log out
- view posts
- add posts
The user can now log in from multiple devices and log out from one device only without affecting other devices. When password is changed, user gets logged out from all the devices.
To demonstrate the auth system I have created a post viewing and publishing system. All posts can be viewed publically but to add a post the user needs to be authenticated (either with email signup/login or with GitHub).
- Clone the repo
git clone <the repo url in the address bar>
- Install all the dependencies
npm i
- Set up the environment variables needed
- can be found in
next.config.js
file
- can be found in
- Run this command:
npm run dev
- The app will be accessible at
http://localhost:3000