A simple authentication app has built with Node.js and Express.js framework. React is used to create frontend. The app uses mongoose ODM (Object Document Model). For authenticate the users, JWT is used. Additionally, in oder to make secure the password, bcrypt.js is used for the project.
The app feature is to let user to register, log in, log out and update profile.
Demo: Link
- Log in, log out, register and update profile
- JWT is used for authentication
- BcryptJS is used to secure the password
- React is used to render the DOM
- Redux toolkit is used for state management, redux query is used for fetching data from backend
- MongoDB uses to store data
- Clone the repository
- Run
npm install
command in your terminal - Create .env file and add the following enviromental variables:
NODE_ENV=developement
PORT=5000
MONGO_URI=mongo uri
JWT_SECRET=abc123
- Run
npm run dev
command in your terminal at the root folder - Frontend server running at
http://localhost:3000/
- Clone the repository
- Run
npm install
command in your terminal - Create .env file and add the following enviromental variables:
NODE_ENV=production
PORT=5000
MONGO_URI=mongo uri
JWT_SECRET=abc123
- Run
npm run build
command in your terminal at the root folder to creat build infrontend/dist
folder - Run
npm run server
command in your terminal at the root folder - Frontend server running at
http://localhost:5000/