{"id":49571100,"url":"https://github.com/sagargupta16/authentication-system","last_synced_at":"2026-05-03T14:03:23.873Z","repository":{"id":107864123,"uuid":"513391202","full_name":"Sagargupta16/Authentication-System","owner":"Sagargupta16","description":"Full-stack MERN authentication with login, signup, session management, and secure password hashing","archived":false,"fork":false,"pushed_at":"2026-04-15T12:34:09.000Z","size":1997,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-15T14:20:25.626Z","etag":null,"topics":["authentication","login-signup","mern-stack"],"latest_commit_sha":null,"homepage":"https://authentication-system-wmta.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/Sagargupta16.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["Sagargupta16"]}},"created_at":"2022-07-13T05:25:33.000Z","updated_at":"2026-04-15T12:13:22.000Z","dependencies_parsed_at":"2024-02-22T23:23:05.422Z","dependency_job_id":"7ba69f5d-ef87-4545-be05-384da10ce2ad","html_url":"https://github.com/Sagargupta16/Authentication-System","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sagargupta16/Authentication-System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sagargupta16%2FAuthentication-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sagargupta16%2FAuthentication-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sagargupta16%2FAuthentication-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sagargupta16%2FAuthentication-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sagargupta16","download_url":"https://codeload.github.com/Sagargupta16/Authentication-System/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sagargupta16%2FAuthentication-System/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32571456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","login-signup","mern-stack"],"created_at":"2026-05-03T14:03:22.952Z","updated_at":"2026-05-03T14:03:23.865Z","avatar_url":"https://github.com/Sagargupta16.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Sagargupta16"],"categories":[],"sub_categories":[],"readme":"# Authentication System\n\nA full-stack authentication system built with the MERN stack, featuring secure JWT-based login/registration with password complexity validation.\n\n![Node.js](https://img.shields.io/badge/Node.js-339933?style=flat\u0026logo=node.js\u0026logoColor=white)\n![Express](https://img.shields.io/badge/Express-000000?style=flat\u0026logo=express\u0026logoColor=white)\n![React](https://img.shields.io/badge/React-61DAFB?style=flat\u0026logo=react\u0026logoColor=black)\n![MongoDB](https://img.shields.io/badge/MongoDB-47A248?style=flat\u0026logo=mongodb\u0026logoColor=white)\n![JWT](https://img.shields.io/badge/JWT-000000?style=flat\u0026logo=jsonwebtokens\u0026logoColor=white)\n\n## Overview\n\nA production-ready authentication system implementing industry-standard security practices. Features user registration with enforced password complexity, email/password login with JWT token generation, and bcrypt password hashing. Built as a reusable auth module for MERN stack applications.\n\n## Features\n\n- **User Registration** -- Sign up with email, first name, last name, and password\n- **Password Complexity Enforcement** -- Joi-based validation requiring minimum length, uppercase, lowercase, numbers, and symbols\n- **JWT Authentication** -- Secure token generation with 7-day expiry\n- **Password Hashing** -- Bcrypt-based password hashing for secure storage\n- **Protected Routes** -- Token-verified access to protected resources\n- **Input Validation** -- Server-side validation using Joi schemas\n- **CORS Enabled** -- Cross-origin resource sharing for frontend communication\n\n## Tech Stack\n\n| Layer | Technology |\n|-------|-----------|\n| Frontend | React, React Router, CSS Modules |\n| Backend | Node.js, Express.js |\n| Database | MongoDB, Mongoose ODM |\n| Auth | JWT (jsonwebtoken), Bcrypt |\n| Validation | Joi, joi-password-complexity |\n| Config | dotenv, CORS |\n\n## Project Structure\n\n```\nAuthentication-System/\n├── client/                  # React frontend\n│   ├── public/\n│   └── src/\n│       ├── components/\n│       │   ├── Login/       # Login form component\n│       │   ├── Main/        # Main/dashboard component\n│       │   └── Signup/      # Registration form component\n│       ├── App.js\n│       └── index.js\n├── models/\n│   └── user.js              # Mongoose user schema with JWT generation\n├── routes/\n│   ├── auth.js              # Login/authentication endpoints\n│   └── users.js             # User registration endpoints\n├── db.js                    # MongoDB connection configuration\n├── index.js                 # Express server entry point\n├── .env                     # Environment variables (not committed)\n└── package.json\n```\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js 16+\n- MongoDB (local or Atlas)\n- npm or yarn\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/Sagargupta16/Authentication-System.git\ncd Authentication-System\n\n# Install backend dependencies\nnpm install\n\n# Install frontend dependencies\ncd client \u0026\u0026 npm install \u0026\u0026 cd ..\n```\n\n### Environment Variables\n\nCreate a `.env` file in the root directory:\n\n```env\nDB=mongodb://localhost:27017/auth-system   # MongoDB connection string\nJWTPRIVATEKEY=your_jwt_secret_key          # JWT signing key\nPORT=5000                                   # Server port\nSALT=10                                     # Bcrypt salt rounds\n```\n\n### Running the Application\n\n```bash\n# Start both backend and frontend concurrently\nnpm run dev\n\n# Or start separately:\nnpm start              # Backend only (port 5000)\ncd client \u0026\u0026 npm start # Frontend only (port 3000)\n```\n\n## API Endpoints\n\n| Method | Endpoint | Description | Auth Required |\n|--------|----------|-------------|---------------|\n| POST | `/api/users` | Register a new user | No |\n| POST | `/api/auth` | Login and get JWT token | No |\n\n### Register User\n\n```json\nPOST /api/users\n{\n  \"firstName\": \"John\",\n  \"lastName\": \"Doe\",\n  \"email\": \"john@example.com\",\n  \"password\": \"SecurePass123!\"\n}\n```\n\n### Login\n\n```json\nPOST /api/auth\n{\n  \"email\": \"john@example.com\",\n  \"password\": \"SecurePass123!\"\n}\n```\n\n**Response:**\n```json\n{\n  \"data\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n  \"message\": \"Logged in successfully\"\n}\n```\n\n## Security\n\n- Passwords are hashed with bcrypt before storage\n- JWT tokens expire after 7 days\n- Password complexity enforced: min 8 chars, uppercase, lowercase, numbers, symbols\n- Input sanitization via Joi validation schemas\n- CORS configured for frontend origin\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagargupta16%2Fauthentication-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagargupta16%2Fauthentication-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagargupta16%2Fauthentication-system/lists"}