This application is deployed on DigitalOcean. Please check it out π here.
Frontend:
Backend:
Database:
Deployed On:
- Protected routes with Higher Order Components
- Login with forgot password feature.
- JWT protected APIs
- Passwords are encrypted.
- Image upload with Cloudinary
- Toast notifications for user actions.
βββ client/
β βββ public/
β β βββ favicon.ico
β β βββ index.html
β β βββ logo192.png
β β βββ logo512.png
β β βββ manifest.json
β β βββ robots.txt
β βββ src/
β β βββ assets/
β β β βββ email.svg
β β β βββ green_check.svg.json
β β β βββ index.js
β β β βββ logo.png
β β β βββ user.svg
β β βββ components/
β β β βββ NavigationBar/
β β β β βββ NavigationBar.jsx
β β β β βββ NavigationBar.css
β β β βββ ProfileModal/
β β β β βββ ProfileModal.jsx
β β β βββ index.js
β β βββ context/
β β β βββ AuthProvider.jsx
β β βββ Pages/
β β β βββ ForgotPasswordPage/
β β β β βββ ForgotPasswordPage.css
β β β β βββ ForgotPasswordPage.jsx
β β β βββ HomePage/
β β β β βββ HomePage.css
β β β β βββ HomePage.jsx
β β β βββ LoginPage/
β β β β βββ LoginPage.css
β β β β βββ LoginPage.jsx
β β β βββ PasswordResetPage/
β β β β βββ PasswordResetPage.css
β β β β βββ PasswordResetPage.jsx
β β β βββ RegisterPage/
β β β β βββ RegisterPage.css
β β β β βββ RegisterPage.jsx
β β β βββ index.js
β β βββ Utils/
β β β βββ index.js
β β β βββ notify.js
β β β βββ PrivateRoutes.jsx
β β βββ App.css
β β βββ App.jsx
β β βββ index.js
β βββ .env.example
β βββ package-lock.json
β βββ package.json
βββ config/
β βββ db.js
βββ controllers/
β βββ auth.js
β βββ private.js
βββ middleware/
β βββ auth.js
β βββ error.js
βββ models/
β βββ User.js
βββ routes/
β βββ auth.js
β βββ private.js
βββ utils/
β βββ errorResponse.js
β βββ sendEmail.js
βββ .env.example
βββ .gitignore
βββ LICENSE
βββ package-lock.json
βββ package.json
βββ README.md
βββ server.js
In order to run the project you need node>=16
and npm>=8
installed on your machine.
git clone https://github.com/rtewari056/mern-stack-authentication-boilerplate.git
cd mern-stack-authentication-boilerplate
# In the root directory put your creadentials
APP_BASE_URL=http://localhost:3000
NODE_ENV=development
PORT=5000
MONGO_URI="YOUR_MONGO_CONNECTION_URL"
JWT_SECRET="YOUR_JWT_SECRET"
JWT_EXPIRE=24 # In hours
SMTP_HOST=<YOUR_SMTP_SERVER_HOST_NAME>
SMTP_PORT=587
SMTP_USER=<YOUR_SMTP_SERVER_USER_NAME>
SMTP_PASSWORD=<YOUR_SMTP_SERVER_PASSWORD>
EMAIL_FROM=<EMAIL_ADDRESS_OF_SENDER>
# Now go to client folder and put your cloudinary creadentials
REACT_APP_CLOUDINARY_CLOUD_NAME=<YOUR_CLOUDINARY_CLOUD_NAME>
REACT_APP_CLOUDINARY_UPLOAD_PRESET=<YOUR_CLOUDINARY_UPLOAD_PRESET>
npm install # Server dependencies
cd client
npm install # Client dependencies
In the root
directory, open two terminal sessions and run both commands separately:
npm run client
npm run server
If you want to contact me, you can reach me through below handles.
MERN Stack Authentication Boilerplate is licensed under the MIT License.