{"id":15068215,"url":"https://github.com/fingertips18/mern-auth","last_synced_at":"2026-01-03T03:47:57.323Z","repository":{"id":255145592,"uuid":"848638050","full_name":"Fingertips18/mern-auth","owner":"Fingertips18","description":"🔐A MERN stack authentication system that includes user registration, login, and JWT-based session management with secure handling of passwords and token cookies. Ideal for building secure, scalable web applications.","archived":false,"fork":false,"pushed_at":"2025-03-06T14:47:04.000Z","size":1925,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-06T15:35:36.800Z","etag":null,"topics":["authentication","express-js","forgot-password","javascript","jwt-authentication","mern-stack","reactjs","reset-password","signin","signup","verify-email"],"latest_commit_sha":null,"homepage":"https://mern-auth-tau7.onrender.com","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/Fingertips18.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":"2024-08-28T06:06:33.000Z","updated_at":"2025-03-06T14:47:06.000Z","dependencies_parsed_at":"2024-08-28T09:08:30.799Z","dependency_job_id":"2ed603a0-e34b-4f68-a633-6da9e0ca0fb9","html_url":"https://github.com/Fingertips18/mern-auth","commit_stats":null,"previous_names":["fingertips18/mern-auth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fingertips18%2Fmern-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fingertips18%2Fmern-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fingertips18%2Fmern-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fingertips18%2Fmern-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fingertips18","download_url":"https://codeload.github.com/Fingertips18/mern-auth/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243833458,"owners_count":20355278,"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","express-js","forgot-password","javascript","jwt-authentication","mern-stack","reactjs","reset-password","signin","signup","verify-email"],"created_at":"2024-09-25T01:32:28.102Z","updated_at":"2026-01-03T03:47:57.317Z","avatar_url":"https://github.com/Fingertips18.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"public/banner.png\" alt=\"Banner\" width=\"100%\"\u003e\n\n# 🔒 MERN-Auth\n\nThis repository features a **MERN** stack authentication system, encompassing user registration, login, and **JWT-based** session management. It securely handles passwords and token cookies, making it an excellent foundation for building secure and scalable web applications.\n\n### 🔗 Website Link: [Live](https://mern-auth-tau7.onrender.com)\n\n## 📚 Table of Contents\n\n- 🔧 [Technologies Used](#tech-used)\n- ✨ [Features](#features)\n- 📖 [Setup Instructions](#setup)\n- 🐍 [Backend (Express JS)](#backend)\n- ⚛️ [Frontend (React JS)](#frontend)\n- 📡 [API Endpoints](#api)\n- 🔒 [Authentication](#auth)\n- 🤝 [Contributing](#contributing)\n- 📜 [License](#license)\n\n## 🔧 \u003ca name=\"tech-used\"\u003eTechnologies Used\u003c/a\u003e\n\n- **Frontend**: React JS ⚛️\n- **Backend**: Express JS 🐍\n- **Database**: MongoDB 🗄️\n- **Authentication**: JWT (JSON Web Tokens) 🔐\n- **Email Service**: Mailtrap 📫\n\n## ✨ \u003ca name=\"features\"\u003eFeatures\u003c/a\u003e\n\n- **🔒 User Authentication**: Comprehensive authentication system including sign-up, login, sign-out, and **JWT-based** session management.\n- **✉️ Email Verification**: Integrated **Mailtrap** for managing email verification and password reset workflows.\n- **🔑 Password Management**: Secure handling of forgot password, reset password, and reset verification workflows.\n- **📝 CRUD Operations**: Create, Read, Update, and Delete operations for user and application data.\n- **📱 Responsive UI**: Developed using **React** components, ensuring a seamless experience across devices.\n- **📡 API**: Robust API constructed using **Express.js** and **MongoDB** for seamless data interaction.\n\n## 📖 \u003ca name=\"setup\"\u003eSetup Instructions\u003c/a\u003e\n\n### 🛠️ \u003ca name=\"backend\"\u003eBackend (Express JS)\u003c/a\u003e\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/Fingertips18/mern-auth.git\n   ```\n\n2. **Install dependencies**:\n\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables. Create a `.env` file in the root directory:**:\n\n   ```dotenv\n   PORT=\u003cPORT\u003e # macOS users: avoid 5000, it may be used by AirPlay\n   MONGO_URI=\u003cMONGO_URI\u003e\n   JWT_SECRET=\u003cJWT_SECRET\u003e\n   NODE_ENV=\u003cNODE_ENV\u003e\n   EMAILJS_SERVICE_ID=\u003cEMAILJS_SERVICE_ID\u003e\n   EMAILJS_TEMPLATE_ID=\u003cEMAILJS_TEMPLATE_ID\u003e\n   EMAILJS_PUBLIC_KEY=\u003cEMAILJS_PUBLIC_KEY\u003e\n   EMAILJS_PRIVATE_KEY=\u003cEMAILJS_PRIVATE_KEY\u003e\n   CLIENT_URL=\u003cCLIENT_URL\u003e\n   ```\n\n4. **Run the backend server**:\n   ```bash\n   npm run dev\n   ```\n\n### ⚛️ \u003ca name=\"frontend\"\u003eFrontend (React JS)\u003c/a\u003e\n\n1. **Navigate to the frontend directory**:\n\n   ```bash\n   cd frontend\n   ```\n\n2. **Install dependencies**:\n\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables. Create a `.env.local` file in the frontend directory**:\n\n   ```dotenv\n   VITE_BASE_URL=\u003cVITE_BASE_URL\u003e\n   ```\n\n4. **Run the frontend server**:\n   ```bash\n   npm run dev\n   ```\n\n## 📡 \u003ca name=\"api\"\u003eAPI Endpoints\u003c/a\u003e\n\n- **Root**:\n\n  - `GET /`: The root of the server\n\n- **Authentication**:\n\n  - `POST` **/api/auth/sign-up** : Register a new user.\n\n  - `POST` **/api/auth/sign-in** : Log in a user and return a JWT.\n\n  - `POST` **/api/auth/sign-out** : Log out a user and clear the session.\n\n  - `POST` **/api/auth/verify-email** : Verify a user's email address.\n\n  - `POST` **/api/auth/forgot-password** : Send a password reset email.\n\n  - `POST` **/api/auth/reset-password** : Reset a user's password.\n\n  - `GET` **/api/auth/verify-token** : Verify the validity of a JWT.\n\n## 🔒 \u003ca name=\"auth\"\u003eAuthentication\u003c/a\u003e\n\nThis project uses JWT for secure authentication. Tokens are stored in cookies with `HttpOnly` and `SameSite` attributes for enhanced security.\nBoth the `frontend` and `backend` handle the verification and expiration of the token.\n\n## 🤝 \u003ca name=\"contributing\"\u003eContributing\u003c/a\u003e\n\nFeel free to fork this repository and contribute by submitting a pull request. All contributions are welcome!\n\n#### 🧑‍💻 Contributors\n\n\u003ca href=\"https://github.com/Fingertips18/mern-auth/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=Fingertips18/mern-auth\" /\u003e\n\u003c/a\u003e\n\n_Ghian Tan_ @ _Fingertips_ ([Github](https://github.com/Fingertips18))\n\n## \u003ca name=\"license\"\u003e📜 License\u003c/a\u003e\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffingertips18%2Fmern-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffingertips18%2Fmern-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffingertips18%2Fmern-auth/lists"}