{"id":21711730,"url":"https://github.com/sanjaydevtech/nodejs-simple-rest-api","last_synced_at":"2026-04-02T03:02:59.526Z","repository":{"id":115341554,"uuid":"385708323","full_name":"SanjayDevTech/nodejs-simple-rest-api","owner":"SanjayDevTech","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-14T14:48:52.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T14:26:38.189Z","etag":null,"topics":["docker","expressjs","javascript","nodejs"],"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/SanjayDevTech.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-07-13T19:04:12.000Z","updated_at":"2021-07-14T14:48:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"66ef0bd1-de38-49d3-aa5e-9c3081ed31e5","html_url":"https://github.com/SanjayDevTech/nodejs-simple-rest-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SanjayDevTech/nodejs-simple-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanjayDevTech%2Fnodejs-simple-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanjayDevTech%2Fnodejs-simple-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanjayDevTech%2Fnodejs-simple-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanjayDevTech%2Fnodejs-simple-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SanjayDevTech","download_url":"https://codeload.github.com/SanjayDevTech/nodejs-simple-rest-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanjayDevTech%2Fnodejs-simple-rest-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","expressjs","javascript","nodejs"],"created_at":"2024-11-25T23:29:14.588Z","updated_at":"2026-04-02T03:02:59.499Z","avatar_url":"https://github.com/SanjayDevTech.png","language":"JavaScript","readme":"# nodejs-simple-rest-api\n\n## Deployment:\n\n-   Docker build\n-   Deploy to heroku with ENV VARIABLES (DB, URI)\n-   DB = Mongodb database name\n-   URI = Mongodb URI string in the format `user@password:url`\n\n---\n\n## Models:\n\n### User Model:\n\n```kt\ndata class User(\n    val email: String,\n    val name: String,\n    val password: String?,\n)\n```\n\n### Post Model:\n\n```kt\ndata class Post(\n    val _id: String,\n    val title: String,\n    val content: String,\n    val email: String,\n    val created: Long,\n    val updated: Long,\n)\n```\n\n---\n\n## Request:\n\n```kt\ndata class PostRequest(\n    val content: String,\n    val title: String,\n    val email: String,\n    val password: String\n)\n```\n\n---\n\n## Response:\n\n```kt\ndata class Response\u003cout T\u003e(\n    val status: Boolean,\n    val errorMessage: String,\n    val value: T,\n)\n```\n\n---\n\n## API\n\n### GET /auth\n\n_List all users_\n\nResponse:\n\n```kt\n// List of users but without password field\nval value: List\u003cUser\u003e\n```\n\n### GET /auth/:emailId\n\n_Check if the user with email exists_\n\nResponse:\n\n```kt\n// true if user exists\nval value: Boolean\n```\n\n### POST /auth/login\n\n_Login with email and password_\n\nRequest:\n\n```kt\n// only email \u0026 password (not name)\nUser\n```\n\nResponse:\n\n```kt\n// User object with password to store in local db\nval value: User\n```\n\n### POST /auth/register\n\n_Register with email, name and password_\n\nRequest:\n\n```kt\nUser\n```\n\nResponse:\n\n```kt\n// email is returned back\nval value: String\n```\n\n### GET /post\n\n_List all posts available, if email given list all posts published by that user_\n\nQuery Params:\n\n```kt\n// user email optional\nval email: String\n```\n\nResponse:\n\n```kt\nval value: List\u003cPost\u003e\n```\n\n### GET /post/:postId\n\n_Returns the post by id_\n\nResponse:\n\n```kt\nval value: Post\n```\n\n### POST /post/:postId\n\n_Updates the existing post_\n\nRequest:\n\n```kt\nPostRequest\n```\n\nResponse:\n\n```kt\n// post id\nval value: String\n```\n\n### PUT /post\n\n_Publish new post_\n\nRequest:\n\n```kt\nPostRequest\n```\n\nResponse:\n\n```kt\n// post id\nval value: String\n```\n\n### DELETE /post/:postId\n\n_Delete the post_\n\nRequest:\n\n```kt\n// current user\nUser\n```\n\nResponse:\n\n```kt\nval value: Boolean\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanjaydevtech%2Fnodejs-simple-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanjaydevtech%2Fnodejs-simple-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanjaydevtech%2Fnodejs-simple-rest-api/lists"}