{"id":21146232,"url":"https://github.com/feliperdamaceno/node-authorization-api","last_synced_at":"2025-06-27T20:33:39.080Z","repository":{"id":205894643,"uuid":"715341832","full_name":"feliperdamaceno/node-authorization-api","owner":"feliperdamaceno","description":"A Node Authorization API that allows users to perform authentication and authorization actions through a set of RESTful routes. ","archived":false,"fork":false,"pushed_at":"2024-10-24T23:29:14.000Z","size":115,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T13:43:56.739Z","etag":null,"topics":["api","authentication","authentification","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/feliperdamaceno.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":"2023-11-07T00:21:17.000Z","updated_at":"2024-10-24T23:29:17.000Z","dependencies_parsed_at":"2023-11-07T04:42:45.212Z","dependency_job_id":"fe5df2cc-03c5-4dfb-890f-e1e0e4fc0907","html_url":"https://github.com/feliperdamaceno/node-authorization-api","commit_stats":null,"previous_names":["feliperdamaceno/node-auth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/feliperdamaceno/node-authorization-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliperdamaceno%2Fnode-authorization-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliperdamaceno%2Fnode-authorization-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliperdamaceno%2Fnode-authorization-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliperdamaceno%2Fnode-authorization-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feliperdamaceno","download_url":"https://codeload.github.com/feliperdamaceno/node-authorization-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliperdamaceno%2Fnode-authorization-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262327335,"owners_count":23294254,"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":["api","authentication","authentification","nodejs","typescript"],"created_at":"2024-11-20T08:51:55.826Z","updated_at":"2025-06-27T20:33:39.038Z","avatar_url":"https://github.com/feliperdamaceno.png","language":"TypeScript","readme":"# Node Authorization API\n\n- [Overview](#overview)\n- [Environmental Variables](#environmental-variables)\n- [Routes](#routes)\n  - [Public Routes](#public-routes)\n  - [Private Routes](#private-routes)\n- [Authentication and Authorization](#authentication-and-authorization)\n- [JWT Token Expiry](#jwt-token-expiry)\n- [Docker-Compose and MongoDB Setup](#docker-compose-and-mongodb-setup)\n- [Getting Started](#getting-started)\n- [License](#license)\n- [Contributors](#contributors)\n- [Contact me](#contact-me)\n\n## Overview\n\nThis Node Authorization API allows users to perform authentication and authorization actions through a set of RESTful routes. The key technologies used in this project include:\n\n- **bcrypt**: Used for hashing passwords securely.\n- **cookie-parser**: Parses cookies attached to the client's request.\n- **cors**: Enables Cross-Origin Resource Sharing.\n- **dotenv**: Loads environment variables from a .env file.\n- **express**: A fast, unopinionated, minimalist web framework for Node.js.\n- **joi**: A schema description language and data validator.\n- **jsonwebtoken**: Generates and verifies JSON Web Tokens (JWT).\n- **mongoose**: An ODM library for MongoDB and Node.js.\n\n## Environmental Variables\n\nEnsure the following environmental variables are set:\n\n**PORT**: Port number for the server.\n\n**MONGODB_URL**: URL for the MongoDB database.\n\n**JWT_SECRET**: Secret key for JWT token generation and verification.\n\n## Routes\n\n### Public Routes:\n\n- **POST /signup**: Create a new user.\n- **POST /login**: Log in with existing credentials.\n\n### Private Routes:\n\n- **GET /**: Retrieve all users (requires authentication).\n- **GET /:email**: Retrieve a specific user by email (requires authentication).\n- **POST /:email**: Update a user by email (requires authentication).\n- **DELETE /:email**: Delete a user by email (requires authentication).\n\n## Authentication and Authorization\n\n- Users can only access the login and signup routes publicly.\n- Other routes are private and require authentication, implemented through middleware and a validation function.\n\n## JWT Token Expiry\n\n- JWT tokens have a 3-day expiration, requiring users to log in again after that time.\n\n## Docker-Compose and MongoDB Setup\n\n- The project includes a docker-compose file for creating a MongoDB database.\n- MongoDB is accessible via the Mongo Express service for database management.\n- The admin passphrase in the docker-compose file is for development only and should be a stronger password in production.\n\n## Getting Started\n\n1. Clone the repository.\n2. Set up the environmental variables in a **.env** file.\n3. Run docker-compose up -d to start the MongoDB and Mongo Express services.\n4. Install dependencies with npm install.\n5. Start the server with npm start.\n6. Explore the API using the provided routes.\n\n## License\n\nThis is an open-source library and is available under the [**MIT License**](LICENSE). You are free to use, modify, and distribute the code in accordance with the terms of the license.\n\n## Contributors\n\n[feliperdamaceno](https://github.com/feliperdamaceno)\n\n## Contact me\n\nLinkedin: [feliperdamaceno](https://www.linkedin.com/in/feliperdamaceno)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeliperdamaceno%2Fnode-authorization-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeliperdamaceno%2Fnode-authorization-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeliperdamaceno%2Fnode-authorization-api/lists"}