{"id":27992108,"url":"https://github.com/dirkjbosman/node-postgresql-controllers","last_synced_at":"2026-04-29T12:33:15.791Z","repository":{"id":81074786,"uuid":"291718890","full_name":"dirkjbosman/node-postgresql-controllers","owner":"dirkjbosman","description":"A (Destructured) Express Node PostgreSQL App w. Controllers","archived":false,"fork":false,"pushed_at":"2020-09-12T13:17:04.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T17:57:24.124Z","etag":null,"topics":["api","express","javascript","node","nodejs","postgresql","sql"],"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/dirkjbosman.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":"2020-08-31T13:11:40.000Z","updated_at":"2020-09-12T13:17:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee13cbce-4638-4154-826c-2be75898f00c","html_url":"https://github.com/dirkjbosman/node-postgresql-controllers","commit_stats":null,"previous_names":["dirkjbosman/node-postgresql-controllers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dirkjbosman/node-postgresql-controllers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkjbosman%2Fnode-postgresql-controllers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkjbosman%2Fnode-postgresql-controllers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkjbosman%2Fnode-postgresql-controllers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkjbosman%2Fnode-postgresql-controllers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirkjbosman","download_url":"https://codeload.github.com/dirkjbosman/node-postgresql-controllers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkjbosman%2Fnode-postgresql-controllers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32426578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T12:24:25.982Z","status":"ssl_error","status_checked_at":"2026-04-29T12:24:24.439Z","response_time":110,"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":["api","express","javascript","node","nodejs","postgresql","sql"],"created_at":"2025-05-08T17:57:21.472Z","updated_at":"2026-04-29T12:33:15.764Z","avatar_url":"https://github.com/dirkjbosman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-postgresql-controllers\n\nA (Destructured) Express Node PostgreSQL App w. Controllers\n\n#### Summary:\n\n- node express server, middleware and apis\n- postgresql relational database\n\n### Boilerplates:\n\n- [Part 1: node-postgresql-unstructured](https://github.com/dirkbosman/node-postgresql-unstructured)\n- [Part 2: node-postgresql-destructured](https://github.com/dirkbosman/node-postgresql-destructured)\n- [Part 3: node-postgresql-controllers](https://github.com/dirkbosman/node-postgresql-controllers)\n---\n- [Part 4a: node-mongodb-controllers](https://github.com/dirkbosman/node-mongodb-controllers)\n- Part 4b: Combine [node-mongodb-clientforserver](https://github.com/dirkbosman/node-mongodb-clientforserver) + [node-mongodb-controllers](https://github.com/dirkbosman/node-mongodb-controllers)\n\n#### To Do's:\n\n1. If you haven't done it yet, create _POST_ _PUT_ and _DELETE_ routes for orders\n2. Move the business logic of the orders in the `controllers/orders.js` as it's been done for users.\n3. (OPTIONAL) Look into [sequelize](https://sequelize.org/master/), an ORM for SQL\n\n#### Q: Why create controllers in a project?\n\nA: Controllers allow us to make:\n\n- 1 route, chained with promises\n- With multiple methods below the above 1 route\n- You can either use promises or async/await in the controllers\n\n#### Curl Requests:\n\n```\ncurl -d '{\"name\": \"Jiggly\", \"surname\": \"Puff\", \"age\": 100}' -H \"Content-Type: application/json\" -X POST http://localhost:3000/users\ncurl -d '{\"name\": \"Jiggly\", \"surname\": \"Puff\", \"age\": 3}' -H \"Content-Type: application/json\" -X PUT http://localhost:3000/users/2\ncurl -d '{\"price\": 10, \"user\": 2}' -H \"Content-Type: application/json\" -X POST http://localhost:3000/orders\ncurl -d '{\"price\": 12, \"user\": 5}' -H \"Content-Type: application/json\" -X PUT http://localhost:3000/orders/5\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirkjbosman%2Fnode-postgresql-controllers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirkjbosman%2Fnode-postgresql-controllers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirkjbosman%2Fnode-postgresql-controllers/lists"}