{"id":24149542,"url":"https://github.com/ayyush08/user-authentication-system","last_synced_at":"2026-06-09T11:31:42.463Z","repository":{"id":246417232,"uuid":"820915774","full_name":"ayyush08/user-authentication-system","owner":"ayyush08","description":"This project features a complete user authentication system using the MERN stack. It allows users to securely register, log in with JWT-based authentication, refresh tokens for session continuity, and log out. Built with React for the frontend and Node.js with Express.js for the backend, this system ensures data security and smooth user interaction","archived":false,"fork":false,"pushed_at":"2024-08-18T11:17:26.000Z","size":174,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T08:38:53.242Z","etag":null,"topics":["axios","fullstack-development","jwt-authentication","mern-stack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayyush08.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-27T12:38:11.000Z","updated_at":"2024-08-18T11:17:29.000Z","dependencies_parsed_at":"2024-06-27T22:02:45.639Z","dependency_job_id":"9c35538e-5d27-44d9-83fd-c127210f5022","html_url":"https://github.com/ayyush08/user-authentication-system","commit_stats":null,"previous_names":["ayyush08/user-authentication-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayyush08%2Fuser-authentication-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayyush08%2Fuser-authentication-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayyush08%2Fuser-authentication-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayyush08%2Fuser-authentication-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayyush08","download_url":"https://codeload.github.com/ayyush08/user-authentication-system/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241398540,"owners_count":19956754,"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":["axios","fullstack-development","jwt-authentication","mern-stack"],"created_at":"2025-01-12T08:39:00.632Z","updated_at":"2025-03-01T17:24:48.903Z","avatar_url":"https://github.com/ayyush08.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MERN User Authentication System\nThis project implements a user authentication system using the MERN stack (MongoDB, Express.js, React, Node.js). It allows users to register, log in securely, refresh their access tokens, and log out.\n\n## Features\n### User Registration:\n\n- Validates user inputs (username, email, password).\n- Checks for existing usernames and emails to prevent duplicates.\n### User Login:\n\n- Authenticates users based on email and password.\n- Issues JWT (JSON Web Tokens) for access and refresh tokens upon successful login.\n### Token Refresh:\n\n- Refreshes access tokens using refresh tokens to maintain user sessions securely.\n### User Logout:\n\n- Clears refresh token from the database and removes session cookies.\n### Error Handling:\n\n- Provides detailed error messages for various scenarios (e.g., invalid credentials, duplicate users).\n\n## Tech Stack\n### Frontend:\n\n- React.js\n- React Router\n- Axios for API requests\n- TailwindCSS for styling\n### Backend:\n\n- Node.js\n- Express.js\n- MongoDB with Mongoose ODM\n- JWT for token-based authentication\n\n## Getting Started\n### Prerequisites\n1. Node.js and npm installed globally on your machine\n2. MongoDB database (local or cloud-based) with connection URL\n### Installation\n1. Clone the repository:\n```\ngit clone https://github.com/ayyush08/user-authentication-system.git\n```\n2. Go to working directory:\n```\ncd user-authentication-system\n```\n3. Install dependencies for the backend:\n```\ncd backend\n```\n```\nnpm install\n```\n4. Configure environment variables:\n - Create a ```.env``` file in backend directory.\n - Define environment variables - PORT, CORS_ORIGIN, ACCESS_TOKEN_SECRET, ACCESS_TOKEN_EXPIRY, REFRESH_TOKEN,REFRESH_TOKEN_EXPIRY, MONGO_URI\n5. Install dependencies for the frontend:\n```\ncd ../frontend\n```\n```\nnpm install\n```\n6. Start the Development servers on both Frontend and Backend and Make sure your database server is also online:\n- Frontend:\n  ```\n  npm run dev\n  ```\n- Backend:\n  ```\n  cd ../backend\n  ```\n  ```\n  npm run dev\n  ```\n7. Open your web browser and navigate to `http://localhost:5173` to see the application running.\n## Usage\n- Register: Click on SignUp button to create a new user account.\n- Login: Click on LogIn button to authenticate with your credentials.\n- Logout: Click on the LogOut button to clear session cookies and log out securely.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayyush08%2Fuser-authentication-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayyush08%2Fuser-authentication-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayyush08%2Fuser-authentication-system/lists"}