{"id":16361723,"url":"https://github.com/kabirbaidhya/nodejs-sample-app","last_synced_at":"2026-04-11T13:06:06.360Z","repository":{"id":94567262,"uuid":"73306834","full_name":"kabirbaidhya/nodejs-sample-app","owner":"kabirbaidhya","description":"A ridiculously simple sample project done in NodeJS.","archived":false,"fork":false,"pushed_at":"2017-05-11T06:51:04.000Z","size":228,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T01:47:16.777Z","etag":null,"topics":["angular","express","nodejs","postgresql","rest-api","sample","todoapp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/kabirbaidhya.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":"2016-11-09T17:43:17.000Z","updated_at":"2018-07-29T16:11:00.000Z","dependencies_parsed_at":"2023-04-25T23:02:57.421Z","dependency_job_id":null,"html_url":"https://github.com/kabirbaidhya/nodejs-sample-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kabirbaidhya%2Fnodejs-sample-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kabirbaidhya%2Fnodejs-sample-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kabirbaidhya%2Fnodejs-sample-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kabirbaidhya%2Fnodejs-sample-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kabirbaidhya","download_url":"https://codeload.github.com/kabirbaidhya/nodejs-sample-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239753702,"owners_count":19691160,"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":["angular","express","nodejs","postgresql","rest-api","sample","todoapp"],"created_at":"2024-10-11T02:14:38.055Z","updated_at":"2025-12-30T23:04:39.954Z","avatar_url":"https://github.com/kabirbaidhya.png","language":"JavaScript","readme":"# Sample Node JS App\n\nA ridiculously simple sample project done in NodeJS.\n\n## What do you want?\n\n| branch  | type of the application  |\n|---|---|\n| [hello-world](https://github.com/kabirbaidhya/nodejs-sample-app/tree/hello-world)  | A Hello world application  |\n| [starter](https://github.com/kabirbaidhya/nodejs-sample-app/tree/starter)  | A minimalistic starter template for your next NodeJS project  |\n| [rest-api](https://github.com/kabirbaidhya/nodejs-sample-app/tree/rest-api)  | A sample express application exposing REST API from a postgres database.  |\n| [todoapp](https://github.com/kabirbaidhya/nodejs-sample-app/tree/todoapp)  | A full todoapp sample with angular on the frontend and the express API on the backend.  |\n\nJust run `git checkout \u003cbranch\u003e` and start the app.\n\n## Setup\n\nInstall dependencies\n```bash\n# Using npm\nnpm install\n\n# Or using yarn\nyarn\n```\n\n## Configuration\n\nCreate a `postgres` database \u0026 import the sample todoapp database schema.\n```\n$ createdb YOUR_DATABASE\n```\n\nCreate a `.env` file with your configuration.\n\n```\n$ cp .env.example .env\n```\n\nThen start the app\n```\n$ npm start\n```\n\nTo run the database migration, run the following command\n```\n# Using npm\n$ npm run migrate\n\n# Using yarn\n$ yarn migrate\n```\n\nTo run the database seed, run the following command\n```\n# Using npm\n$ npm run seed\n\n# Using yarn\n$ yarn seed\n```\n\nIf you have `node-foreman` installed globally you can do\n```\n$ nf start\n```\n\n## Test your APIs\n\nRun `npm run list:routes` to list the available API routes. \n\n```\n$ npm run list:routes \n\nAPI Routes\n----------------------------------\nGET      /api/todos\nPOST     /api/todos\nGET      /api/todos/:id\nDELETE   /api/todos/:id\nPUT      /api/todos/:id\n----------------------------------\n```\n\nNow you can use http clients eg: [httpie](https://github.com/jkbrzt/httpie) to test your APIs:\n\nCreate a todo item:\n```\n$ http --json POST http://127.0.0.1:3000/api/todos title='Build a Todo App' completed=false\n\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 115\nContent-Type: application/json; charset=utf-8\nDate: Fri, 11 Nov 2016 19:24:44 GMT\nETag: W/\"73-SJsR27NngqcsXB5jUHZaXw\"\nX-Powered-By: Express\n\n{\n    \"completed\": false, \n    \"description\": null, \n    \"id\": \"8\", \n    \"recorded_at\": \"2016-11-11T19:24:44.710Z\", \n    \"title\": \"Build a Todo App\"\n}\n```\n\nNow list your todos:\n\n```\n$ http GET http://127.0.0.1:3000/api/todos\n\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 117\nContent-Type: application/json; charset=utf-8\nDate: Fri, 11 Nov 2016 19:25:35 GMT\nETag: W/\"75-ANfFIfwITLbg+u1p7PPiVA\"\nX-Powered-By: Express\n\n[\n    {\n        \"completed\": false, \n        \"description\": null, \n        \"id\": \"8\", \n        \"recorded_at\": \"2016-11-11T19:24:44.710Z\", \n        \"title\": \"Build a Todo App\"\n    }\n]\n```\n\nDid you see that? Awesome. Now try the `PUT` and `DELETE` APIs as well.\n\n## Stay tuned\nWe'll be building a frontend app to make use of this todo API shortly.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkabirbaidhya%2Fnodejs-sample-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkabirbaidhya%2Fnodejs-sample-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkabirbaidhya%2Fnodejs-sample-app/lists"}