{"id":17973315,"url":"https://github.com/snehamgithub/authendication_authorization","last_synced_at":"2026-04-12T11:35:41.613Z","repository":{"id":259613028,"uuid":"879043704","full_name":"SnehaMgithub/Authendication_Authorization","owner":"SnehaMgithub","description":"Authendication_Authorization","archived":false,"fork":false,"pushed_at":"2024-10-27T07:02:27.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T11:14:16.802Z","etag":null,"topics":["bcrypt","cors","dotenv","expressjs","jwt","nodejs","nodemon"],"latest_commit_sha":null,"homepage":"https://authendication-authorization-gqda.onrender.com","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/SnehaMgithub.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-10-26T20:07:36.000Z","updated_at":"2024-10-27T07:02:31.000Z","dependencies_parsed_at":"2024-10-26T22:31:27.774Z","dependency_job_id":"9a100100-ebce-4549-a362-cf1575e54270","html_url":"https://github.com/SnehaMgithub/Authendication_Authorization","commit_stats":null,"previous_names":["snehamgithub/authendication_authorization"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnehaMgithub%2FAuthendication_Authorization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnehaMgithub%2FAuthendication_Authorization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnehaMgithub%2FAuthendication_Authorization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnehaMgithub%2FAuthendication_Authorization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SnehaMgithub","download_url":"https://codeload.github.com/SnehaMgithub/Authendication_Authorization/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247093287,"owners_count":20882387,"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":["bcrypt","cors","dotenv","expressjs","jwt","nodejs","nodemon"],"created_at":"2024-10-29T16:30:23.426Z","updated_at":"2026-04-12T11:35:41.576Z","avatar_url":"https://github.com/SnehaMgithub.png","language":"JavaScript","readme":"# User Authentication and Authorization with Bearer Token\n\nThis project is a Node.js-based application that implements user authentication and authorization using Bearer tokens. The application follows the Model-View-Controller (MVC) pattern and utilizes Express.js, Mongoose (MongoDB), and JWT for token-based authentication.\n\n## Project Overview\n\nThis application provides a secure user registration and login system using JWT (JSON Web Tokens) for token-based authentication. The user data is stored in a MongoDB database, and the application follows the MVC architecture for better separation of concerns. The application also includes a protected route for fetching user information, accessible only with a valid JWT.\n\n## Tech Stack\n- **Node.js**: JavaScript runtime used for server-side development.\n- **Express.js**: Web framework for Node.js to build RESTful APIs.\n- **Mongoose**: MongoDB ODM for modeling application data.\n- **JWT (jsonwebtoken)**: Used to generate and verify Bearer tokens for secure authentication.\n- **Postman**: For API testing and documentation.\n\n\n## Features\n\n- **User Registration**: Users can register with `username`, `email`, `password`, and `role`.\n- **Password Hashing**: User passwords are hashed using `bcrypt` before saving them to the database.\n- **User Login**: Users can log in with their email and password. A JWT is returned upon successful login.\n- **JWT Authentication**: JWTs are used to authenticate requests. A middleware function verifies the token and attaches user information to the request object.\n- **Protected Routes**: A protected route for fetching user information, accessible only by providing a valid JWT.\n- **API Documentation**: Postman collection for testing and sample API requests.\n\n\n## API Documentation\nFor detailed API documentation, including request/response examples, you can refer to the full Postman documentation:\n\nhttps://documenter.getpostman.com/view/39168825/2sAY4sjjZz","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnehamgithub%2Fauthendication_authorization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnehamgithub%2Fauthendication_authorization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnehamgithub%2Fauthendication_authorization/lists"}