This app demonstrates the auth process which is built using the MERN stack. Additionaly the app is containerised using Docker.
Authentication is the process of verifying who someone is. Authorization is the process of verifying what resources a user has access to. This can by achieved through JWT. JWT uses authorization headers.
JWT stands for JSON Web Tokens
- Handle authentication
- Allow access to API end points
- End points provide data resources
cd demo-app
npm i
cd node
npm i
Create a file in the root of ./node
with a name .env
and copy, paste the following,
DATABASE_URI=`YOUR_DB_URI`
ACCESS_TOKEN_SECRET=`A_STRING_OF_YOUR_CHOICE`
REFRESH_TOKEN_SECRET=`A_STRING_OF_YOUR_CHOICE`
For DATABASE_URI
, create a new cluster from your Atlas dashboard.
cd demo-app
npm run start
cd node
npm run dev
docker compose build
docker compose up