{"id":22303928,"url":"https://github.com/rtewari056/mern-stack-authentication-boilerplate","last_synced_at":"2025-07-15T12:05:04.562Z","repository":{"id":89780829,"uuid":"567204760","full_name":"rtewari056/mern-stack-authentication-boilerplate","owner":"rtewari056","description":"Ultimate MERN Stack Authentication Boilerplate for production use","archived":false,"fork":false,"pushed_at":"2023-06-17T08:32:32.000Z","size":1180,"stargazers_count":9,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T20:25:09.492Z","etag":null,"topics":["authentication","boilerplate-template","express","full-stack","mern-stack","mongodb","mongoose","node","production-ready","react"],"latest_commit_sha":null,"homepage":"https://mernauth.rohittewari.live","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rtewari056.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-17T09:48:02.000Z","updated_at":"2025-04-04T11:38:27.000Z","dependencies_parsed_at":"2025-01-30T21:27:39.831Z","dependency_job_id":"40133a5d-a7dc-446d-9e35-dbb789c48e8d","html_url":"https://github.com/rtewari056/mern-stack-authentication-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rtewari056/mern-stack-authentication-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtewari056%2Fmern-stack-authentication-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtewari056%2Fmern-stack-authentication-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtewari056%2Fmern-stack-authentication-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtewari056%2Fmern-stack-authentication-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtewari056","download_url":"https://codeload.github.com/rtewari056/mern-stack-authentication-boilerplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtewari056%2Fmern-stack-authentication-boilerplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265434677,"owners_count":23764570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","boilerplate-template","express","full-stack","mern-stack","mongodb","mongoose","node","production-ready","react"],"created_at":"2024-12-03T18:48:59.557Z","updated_at":"2025-07-15T12:05:04.514Z","avatar_url":"https://github.com/rtewari056.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003c!-- Title: --\u003e\n  \u003ca href=\"https://mernauth.rohittewari.live\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/75976169/207795985-7582432a-3f1f-4600-9078-57d312267229.png\" height=\"150\" alt=\"Logo with shadow\"\u003e\n  \u003c/a\u003e\n\n\u003c!-- Short description: --\u003e\n\u003ch2\u003eUltimate MERN Stack Authentication Boilerplate for production use\u003c/h2\u003e\n\n\u003c!-- Labels: --\u003e\n  \u003cdiv\u003e\n    \u003cimg src=\"https://badges.frapsoft.com/os/v1/open-source.svg?v=102\" height=\"20\"\u003e\n  \u003ca href=\"https://mernauth.rohittewari.live\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/website-up-down-green-red/https/mernauth.rohittewari.live.svg\" height=\"20\" alt=\"Website up\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/github/repo-size/rtewari056/mern-stack-authentication-boilerplate.svg?label=Repo%20size\" height=\"20\" alt=\"Repo size\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/languages/top/rtewari056/mern-stack-authentication-boilerplate\" height=\"20\" alt=\"GitHub top language\"\u003e\n  \u003ca href=\"./LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/rtewari056/mern-stack-authentication-boilerplate\" height=\"20\" alt=\"MIT License\"\u003e\n  \u003c/a\u003e\n  \u003c/div\u003e\n\n\u003c/div\u003e\n\n## 🚀 Demo\n\nThis application is deployed on DigitalOcean. Please check it out :smile: [here](https://mernauth.rohittewari.live).\n\n![mern-stack-authentication-boilerplate](https://user-images.githubusercontent.com/75976169/207791814-80e8ff7b-39d1-4db4-b450-b861f98e406f.png)\n\n## 🖥️ Tech Stack\n\n**Frontend:**\n\n![HTML5](https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge\u0026logo=html5\u0026logoColor=white)\u0026nbsp;\n![CSS3](https://img.shields.io/badge/CSS3-1572B6?style=for-the-badge\u0026logo=css3\u0026logoColor=white)\u0026nbsp;\n![JavaScript](https://img.shields.io/badge/JavaScript-323330?style=for-the-badge\u0026logo=javascript\u0026logoColor=F7DF1E)\u0026nbsp;\n![Bootstrap](https://img.shields.io/badge/bootstrap-%23563D7C.svg?style=for-the-badge\u0026logo=bootstrap\u0026logoColor=white)\u0026nbsp;\n![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge\u0026logo=react\u0026logoColor=%2361DAFB)\u0026nbsp;\n![React Router](https://img.shields.io/badge/React_Router-CA4245?style=for-the-badge\u0026logo=react-router\u0026logoColor=white)\u0026nbsp;\n\n**Backend:**\n\n![Node JS](https://img.shields.io/badge/Node.js-339933?style=for-the-badge\u0026logo=nodedotjs\u0026logoColor=white)\u0026nbsp;\n![HTML5](https://img.shields.io/badge/Express.js-000000?style=for-the-badge\u0026logo=express\u0026logoColor=white)\u0026nbsp;\n![JWT](https://img.shields.io/badge/json%20web%20tokens-323330?style=for-the-badge\u0026logo=json-web-tokens\u0026logoColor=pink)\u0026nbsp;\n\n**Database:**\n\n![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge\u0026logo=mongodb\u0026logoColor=white)\u0026nbsp;\n\n**Deployed On:**\n\n[![DigitalOcean](https://img.shields.io/badge/Digital_Ocean-0080FF?style=for-the-badge\u0026logo=DigitalOcean\u0026logoColor=white)](https://mernauth.rohittewari.live)\n\n## ⚡️ Features\n\n- [x] Protected routes with Higher Order Components\n- [x] Login with forgot password feature.\n- [x] JWT protected APIs\n- [x] Passwords are encrypted.\n- [x] Image upload with Cloudinary\n- [x] Toast notifications for user actions.\n\n## 📁 Project structure\n```terminal\n├── client/\n│   ├── public/\n│   │   ├── favicon.ico\n│   │   ├── index.html\n│   │   ├── logo192.png\n│   │   ├── logo512.png\n│   │   ├── manifest.json\n│   │   └── robots.txt\n│   ├── src/\n│   │   ├── assets/\n│   │   │   ├── email.svg\n│   │   │   ├── green_check.svg.json\n│   │   │   ├── index.js\n│   │   │   ├── logo.png\n│   │   │   └── user.svg\n│   │   ├── components/\n│   │   │   ├── NavigationBar/\n│   │   │   │   ├── NavigationBar.jsx\n│   │   │   │   └── NavigationBar.css\n│   │   │   ├── ProfileModal/\n│   │   │   │   └── ProfileModal.jsx\n│   │   │   └── index.js\n│   │   ├── context/\n│   │   │   └── AuthProvider.jsx\n│   │   ├── Pages/\n│   │   │   ├── ForgotPasswordPage/\n│   │   │   │   ├── ForgotPasswordPage.css\n│   │   │   │   └── ForgotPasswordPage.jsx\n│   │   │   ├── HomePage/\n│   │   │   │   ├── HomePage.css\n│   │   │   │   └── HomePage.jsx\n│   │   │   ├── LoginPage/\n│   │   │   │   ├── LoginPage.css\n│   │   │   │   └── LoginPage.jsx\n│   │   │   ├── PasswordResetPage/\n│   │   │   │   ├── PasswordResetPage.css\n│   │   │   │   └── PasswordResetPage.jsx\n│   │   │   ├── RegisterPage/\n│   │   │   │   ├── RegisterPage.css\n│   │   │   │   └── RegisterPage.jsx\n│   │   │   └── index.js\n│   │   ├── Utils/\n│   │   │   ├── index.js\n│   │   │   ├── notify.js\n│   │   │   └── PrivateRoutes.jsx\n│   │   ├── App.css\n│   │   ├── App.jsx\n│   │   └── index.js\n│   ├── .env.example\n│   ├── package-lock.json\n│   └── package.json\n├── config/\n│   └── db.js\n├── controllers/\n│   ├── auth.js\n│   └── private.js\n├── middleware/\n│   ├── auth.js\n│   └── error.js\n├── models/\n│   └── User.js\n├── routes/\n│   ├── auth.js\n│   └── private.js\n├── utils/\n│   ├── errorResponse.js\n│   └── sendEmail.js\n├── .env.example\n├── .gitignore\n├── LICENSE\n├── package-lock.json\n├── package.json\n├── README.md\n└── server.js\n```\n\n## 📖 Prerequisites\n\nIn order to run the project you need `node\u003e=16` and `npm\u003e=8` installed on your machine.\n\n## 🚩 Getting Started\n\n### 1. Clone the `mern-stack-authentication-boilerplate` repository:\n\n```bash\ngit clone https://github.com/rtewari056/mern-stack-authentication-boilerplate.git\n```\n\n### 2. Navigate into repo:\n```bash\ncd mern-stack-authentication-boilerplate\n```\n\n### 3. Rename `.env.example` into `.env` and put all creadentials:\n\n```bash\n# In the root directory put your creadentials\nAPP_BASE_URL=http://localhost:3000\nNODE_ENV=development\nPORT=5000\nMONGO_URI=\"YOUR_MONGO_CONNECTION_URL\"\nJWT_SECRET=\"YOUR_JWT_SECRET\"\nJWT_EXPIRE=24 # In hours\nSMTP_HOST=\u003cYOUR_SMTP_SERVER_HOST_NAME\u003e\nSMTP_PORT=587\nSMTP_USER=\u003cYOUR_SMTP_SERVER_USER_NAME\u003e\nSMTP_PASSWORD=\u003cYOUR_SMTP_SERVER_PASSWORD\u003e\nEMAIL_FROM=\u003cEMAIL_ADDRESS_OF_SENDER\u003e\n\n# Now go to client folder and put your cloudinary creadentials \nREACT_APP_CLOUDINARY_CLOUD_NAME=\u003cYOUR_CLOUDINARY_CLOUD_NAME\u003e\nREACT_APP_CLOUDINARY_UPLOAD_PRESET=\u003cYOUR_CLOUDINARY_UPLOAD_PRESET\u003e\n```\n\n### 4. Install package dependencies:\n\n```bash\nnpm install # Server dependencies\ncd client\nnpm install # Client dependencies\n```\n\n### 4. Run project:\nIn the `root` directory, open two terminal sessions and run both commands separately:\n\n```bash\nnpm run client\nnpm run server\n```\n\n### 5. Open your browser and go to `http://localhost:3000`\n\n## 👤 Developer\n\n[Rohit Tewari](https://github.com/rtewari056)\n\n## 📬 Contact\n\nIf you want to contact me, you can reach me through below handles.\n\n\u003ca href=\"https://linkedin.com/in/rtewari056\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white\" alt=\"LinkedIn\"/\u003e\u003c/a\u003e\n\u003ca href=\"mailto:rtewari056@gmail.com\"\u003e\u003cimg  alt=\"Gmail\" src=\"https://img.shields.io/badge/Gmail-D14836?style=for-the-badge\u0026logo=gmail\u0026logoColor=white\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://twitter.com/rtewari056\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge\u0026logo=twitter\u0026logoColor=white\" alt=\"Twitter\"/\u003e\u003c/a\u003e\n\n## 📃 License\n\nMERN Stack Authentication Boilerplate is licensed under the \u003ca href=\"./LICENSE\"\u003eMIT License\u003c/a\u003e.\n\n### Show your support by 🌟 the project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtewari056%2Fmern-stack-authentication-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtewari056%2Fmern-stack-authentication-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtewari056%2Fmern-stack-authentication-boilerplate/lists"}