This a backend with pre-built authentication made using Nodejs and Typescript. Follow the instructions below to clone the repository and run the application.
Ensure you have the following installed on your system:
First, clone the repository using Git:
git clone https://github.com/Soumyadas15/auther
Move to project directory
cd auther
Move to 'backend' directory
cd backends
After visiting the backends directory, select your preferred framework and follow its documentation.
After running the backend, navigate to the project directory using
cd ..
cd ..
Then navigate to the frontend directory
cd frontend
In the root directory, create a file called .env and paste these and save
API_URL="http://localhost:8080/api"
NEXT_PUBLIC_API_URL="http://localhost:8080/api"
After that, run the command to install dependencies
npm install
And finally run the app using
npm run dev
Visit http://localhost:3000 on your browser to see it running.
When a user logs in via the /api/auth/login
endpoint, a JWT token is returned. This token is then stored in cookies on the frontend. For every subsequent request, the JWT token is retrieved from the cookies and sent along with the request.