{"id":42165308,"url":"https://github.com/pedramcode/usersvc","last_synced_at":"2026-01-26T21:00:45.907Z","repository":{"id":306844591,"uuid":"1027389495","full_name":"pedramcode/usersvc","owner":"pedramcode","description":"user service","archived":false,"fork":false,"pushed_at":"2025-07-27T23:59:45.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T01:14:22.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/pedramcode.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,"zenodo":null}},"created_at":"2025-07-27T23:27:07.000Z","updated_at":"2025-07-27T23:59:49.000Z","dependencies_parsed_at":"2025-07-28T01:27:43.370Z","dependency_job_id":null,"html_url":"https://github.com/pedramcode/usersvc","commit_stats":null,"previous_names":["pedramcode/usersvc"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pedramcode/usersvc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fusersvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fusersvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fusersvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fusersvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedramcode","download_url":"https://codeload.github.com/pedramcode/usersvc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedramcode%2Fusersvc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28788062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"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":[],"created_at":"2026-01-26T21:00:23.001Z","updated_at":"2026-01-26T21:00:45.892Z","avatar_url":"https://github.com/pedramcode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# User Service\n\nA RESTful API microservice for user management, authentication, and permissions. Built with Node.js, Express, and MongoDB.\n\n## Features\n\n- User registration with OTP email verification\n- Secure login and JWT-based authentication (access \u0026 refresh tokens)\n- Permission management for admin/superuser\n- Rate limiting and error handling\n- Modular code structure for easy extension\n\n## Technologies\n\n- Node.js\n- Express\n- MongoDB (Mongoose)\n- JWT (jsonwebtoken)\n- Winston (logging)\n- Zod (validation)\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js \u003e= 18\n- MongoDB instance\n- npm\n\n### Installation\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/yourusername/usersvc.git\n    cd usersvc\n    ```\n\n2. Install dependencies:\n    ```sh\n    npm install\n    ```\n\n3. Configure environment variables (see below).\n\n### Environment Variables\n\nSet the following variables in a `.env` file or your environment:\n\n- `HTTP_PORT` - Port for HTTP server (default: 3000)\n- `HTTP_HOST` - Host for HTTP server (default: localhost)\n- `LOG_PATH` - Path for log files (default: /var/log)\n- `MONGO_URL` - MongoDB connection string\n- `RUNTIME` - \"dev\" or \"prod\"\n- `SECRET` - Secret key for JWT signing\n- `REDIS_URL` - Redis server URL for caching\n\nExample `.env`:\n```\nHTTP_PORT=3000\nHTTP_HOST=localhost\nLOG_PATH=/var/log\nMONGO_URL=mongodb://localhost:27017/usersvc\nRUNTIME=dev\nSECRET=your_jwt_secret\n```\n\n### Running the Service\n\n```sh\nnpm run start:dev\n```\n\nor\n\n```sh\nnpm run start:prod\n```\n\nThe server will run at `http://HTTP_HOST:HTTP_PORT`.\n\n### Health Check\n\n- `GET /ping`  \n  Returns \"PONG\"\n\n## Error Handling\n\nStandard HTTP status codes and error messages are returned for all endpoints.  \nCustom errors:  \n- 400 Bad Request  \n- 401 Unauthorized  \n- 404 Not Found  \n- 409 Conflict  \n- 500 Internal Server Error\n\n## Project Structure\n\n```\nsrc/\n  application/services/      # Business logic\n  infrastructure/            # Config, logger, database\n  interfaces/http/           # Controllers, DTOs, routes, middlewares\n  shared/                    # Common utilities and error classes\n```\n\n## Development\n\n- Logging is verbose in `dev` mode.\n- Rate limiting is enabled (50 requests/minute).\n- OTP codes expire after 2 minutes.\n\n## License\n\nMIT\n\n## Maintainer\n\nFor issues or questions, open an issue or contact [dev.dehghanpour@gmail.com](mailto:dev.dehghanpour@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedramcode%2Fusersvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedramcode%2Fusersvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedramcode%2Fusersvc/lists"}