{"id":19703010,"url":"https://github.com/jayvirrathi/node-mongodb-rest-api","last_synced_at":"2026-04-11T09:04:38.979Z","repository":{"id":123947687,"uuid":"336768026","full_name":"Jayvirrathi/node-mongodb-rest-api","owner":"Jayvirrathi","description":"REST API with Node.js, MongoDB,JWT,PM2","archived":false,"fork":false,"pushed_at":"2021-10-31T10:06:48.000Z","size":266,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T16:53:02.452Z","etag":null,"topics":["jwt","jwt-authentication","mongodb","nodejs","openapi","pm2","rest-api","swagger","swagger-documentation"],"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/Jayvirrathi.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":"2021-02-07T11:18:56.000Z","updated_at":"2021-11-01T02:29:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad375713-c91d-4694-b88b-dd5b8106d325","html_url":"https://github.com/Jayvirrathi/node-mongodb-rest-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jayvirrathi/node-mongodb-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayvirrathi%2Fnode-mongodb-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayvirrathi%2Fnode-mongodb-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayvirrathi%2Fnode-mongodb-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayvirrathi%2Fnode-mongodb-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jayvirrathi","download_url":"https://codeload.github.com/Jayvirrathi/node-mongodb-rest-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayvirrathi%2Fnode-mongodb-rest-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31674624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"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":["jwt","jwt-authentication","mongodb","nodejs","openapi","pm2","rest-api","swagger","swagger-documentation"],"created_at":"2024-11-11T21:16:45.062Z","updated_at":"2026-04-11T09:04:38.974Z","avatar_url":"https://github.com/Jayvirrathi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST API with Node.js, MongoDB, JWT\n\n\u003e Blog Node.js project\n\n## Build Setup\n\n```bash\n# install dependencies\nnpm install\n\n# serve at http://localhost:4000/\n\nnpm start\n```\n\n## Prerequisites\n\n- Nodejs\n- MongoDB\n\n## Production\n\n```\nnpm i -g pm2\n```\n\n# Build\n\n```\nnpm run build\n\n```\n\n## dev\n\n```\n# serve at http://localhost:4000/\n\nnpm run pm2:dev\n```\n\n## prod\n\n```\n# serve at http://localhost:4000/\n\nnpm run pm2:prod\n\n```\n\n**Request:**\n\n### User\n\n```\n\nPOST user/register\n{\n\"name\": \"Elon\",\n\"email\": \"elon@tesla.com\",\n\"password\": \"elon@1234\",\n\"role\": \"author\"\n}\n\n```\n\n```\n\nPOST user/login\n{\n\"email\": \"elon@tesla.com\",\n\"password\": \"elon@1234\"\n}\n\n```\n\n## Authorization\n\n### Post\n\n```\n\nPOST posts/\n\n{\n\"postTitle\": \"Deno\",\n\"postBody\": \"New Nodejs Framework\",\n\"genre\": \"tech\"\n}\n\n```\n\n```\n\nPUT posts/:id\n{\n\"postTitle\": \"Deno\",\n\"postBody\": \"New Nodejs Framework by Nodejs Creator\",\n\"genre\": \"tech\"\n}\n\n```\n\n```\n\nGET posts/\n\nGET posts/?page=1\u0026limit=1\n\nGET posts/:id\n\nDELETE posts/:id\n\n```\n\n### Comments\n\n```\n\nPOST comments/\n{\n\"postId\": \"603b77052fbc1c1038573518\",\n\"commentText\": \"Nice\"\n}\n\n```\n\n```\n\nPUT comments/:id\n{\n\"postTitle\": \"Deno\",\n\"postBody\": \"New Nodejs Framework by Nodejs Creator\",\n\"genre\": \"tech\"\n}\n\n```\n\n```\n\nGET comments/\n\nGET comments/:id\n\nDELETE comments/:id\n\n```\n\n### Create Admin User\n\n```\n\nPOST admin/register\n{\n\"name\": \"admin\",\n\"email\": \"admin@tesla.com\",\n\"password\": \"admin@1234\",\n\"role\": \"admin\"\n}\n\n```\n\n```\n\nPOST admin/login\n{\n\"email\": \"admin@tesla.com\",\n\"password\": \"admin@1234\"\n}\n\n```\n\n### Admin Authorization\n\n```\n\nGET admin/users\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayvirrathi%2Fnode-mongodb-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayvirrathi%2Fnode-mongodb-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayvirrathi%2Fnode-mongodb-rest-api/lists"}