{"id":26179350,"url":"https://github.com/bezkoder/node-express-sequelize-postgresql","last_synced_at":"2025-09-12T19:33:47.584Z","repository":{"id":41355990,"uuid":"236904172","full_name":"bezkoder/node-express-sequelize-postgresql","owner":"bezkoder","description":"Node.js Postgresql Crud example - Restful CRUD API with Express, Sequelize and PostgreSQL example ","archived":false,"fork":false,"pushed_at":"2024-06-08T10:42:53.000Z","size":5,"stargazers_count":158,"open_issues_count":2,"forks_count":82,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-08T04:16:06.795Z","etag":null,"topics":["crud-api","node","node-express","node-js-express","node-postgres","nodejs","postgres","postgresql","rest-api","restful-api","sequelize"],"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/bezkoder.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}},"created_at":"2020-01-29T04:41:28.000Z","updated_at":"2025-03-11T17:31:34.000Z","dependencies_parsed_at":"2024-02-04T09:34:04.520Z","dependency_job_id":"984c644f-f761-4ba6-924a-143e1ffc2237","html_url":"https://github.com/bezkoder/node-express-sequelize-postgresql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bezkoder/node-express-sequelize-postgresql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Fnode-express-sequelize-postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Fnode-express-sequelize-postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Fnode-express-sequelize-postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Fnode-express-sequelize-postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bezkoder","download_url":"https://codeload.github.com/bezkoder/node-express-sequelize-postgresql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Fnode-express-sequelize-postgresql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274864022,"owners_count":25364230,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"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":["crud-api","node","node-express","node-js-express","node-postgres","nodejs","postgres","postgresql","rest-api","restful-api","sequelize"],"created_at":"2025-03-11T21:49:39.922Z","updated_at":"2025-09-12T19:33:47.500Z","avatar_url":"https://github.com/bezkoder.png","language":"JavaScript","readme":"# Node.js Express, Sequelize \u0026 PostgreSQL: CRUD Rest APIs\n\nFor instruction, please visit:\n\u003e [Node.js CRUD Rest APIs with Express, Sequelize \u0026 PostgreSQL example](https://bezkoder.com/node-express-sequelize-postgresql/)\n\nWe will build Rest Apis that can create, retrieve, update, delete and find Tutorials by title.\n\nThe following table shows overview of the Rest APIs that will be exported:\n\n- GET     `api/tutorials`\t            get all Tutorials\n- GET     `api/tutorials/:id`         get Tutorial by id\n- POST    `api/tutorials`             add new Tutorial\n- PUT     `api/tutorials/:id`         update Tutorial by id\n- DELETE  `api/tutorials/:id`         remove Tutorial by id\n- DELETE  `api/tutorials`             remove all Tutorials\n- GET     `api/tutorials/published`   find all published Tutorials\n- GET     `api/tutorials?title=[kw]`  find all Tutorials which title contains 'kw'\n\nFront-end that works well with this Back-end\n\u003e [Axios Client](https://www.bezkoder.com/axios-request/)\n\n\u003e [Angular 8](https://www.bezkoder.com/angular-crud-app/) / [Angular 10](https://www.bezkoder.com/angular-10-crud-app/) / [Angular 11](https://www.bezkoder.com/angular-11-crud-app/) / [Angular 12](https://www.bezkoder.com/angular-12-crud-app/) / [Angular 13](https://www.bezkoder.com/angular-13-crud-example/) / [Angular 14](https://www.bezkoder.com/angular-14-crud-example/) / [Angular 15](https://www.bezkoder.com/angular-15-crud-example/) / [Angular 16](https://www.bezkoder.com/angular-16-crud-example/) / [Angular 17](https://www.bezkoder.com/angular-17-crud-example/)\n\n\u003e [Vue 2 Client](https://www.bezkoder.com/vue-js-crud-app/) / [Vue 3 Client](https://www.bezkoder.com/vue-3-crud/) / [Vuetify Client](https://www.bezkoder.com/vuetify-data-table-example/)\n\n\u003e [React Client](https://www.bezkoder.com/react-crud-web-api/) / [React Redux Client](https://www.bezkoder.com/react-redux-crud-example/)\n\n## Demo Video\nThis is our Node.js PostgreSQL CRUD example using Express \u0026 Sequelize application demo, test Rest Apis with Postman.\n\n[![Node.js PostgreSQL CRUD example Github](http://img.youtube.com/vi/x1pZHN_sjGk/0.jpg)](http://www.youtube.com/watch?v=x1pZHN_sjGk \"Node.js PostgreSQL CRUD example Github\")\n\n### Test the APIs\nRun our Node.js application with command: `node server.js`.\n\nUsing Postman, we're gonna test all the Apis above.\n\n- Create a new Tutorial using `POST /tutorials` Api\n\n![node-js-postgresql-crud-example-create](https://dev-to-uploads.s3.amazonaws.com/i/hqvz8ra9p21z927iwzph.png)\n\nAfter creating some new Tutorials, you can check PostgreSQL table:\n```testdb=# select * from tutorials;\n id |    title    |    description    | published |         createdAt          |         updatedAt\n----+-------------+-------------------+-----------+----------------------------+----------------------------\n  1 | Node Tut #1 | Tut#1 Description | f         | 2020-01-29 10:42:57.121+07 | 2020-01-29 10:42:57.121+07\n  2 | Node Tut #2 | Tut#2 Description | f         | 2020-01-29 10:43:05.131+07 | 2020-01-29 10:43:05.131+07\n  3 | Node Tut #3 | Tut#3 Description | f         | 2020-01-29 10:43:48.028+07 | 2020-01-29 10:43:48.028+07\n  4 | Js Tut #4   | Tut#4 Desc        | f         | 2020-01-29 10:45:40.016+07 | 2020-01-29 10:45:40.016+07\n  5 | Js Tut #5   | Tut#5 Desc        | f         | 2020-01-29 10:45:44.289+07 | 2020-01-29 10:45:44.289+07\n```\n\n- Retrieve all Tutorials using `GET /tutorials` Api\n\n![node-js-postgresql-crud-example-retrieve-all](https://dev-to-uploads.s3.amazonaws.com/i/m9razjm1njgww58er3as.png)\n\n- Retrieve a single Tutorial by id using `GET /tutorials/:id` Api\n\n![node-js-postgresql-crud-example-retrieve-one](https://dev-to-uploads.s3.amazonaws.com/i/0kuojvc596i5u423od2b.png)\n\n- Update a Tutorial using `PUT /tutorials/:id` Api\n\n![node-js-postgresql-crud-example-update](https://dev-to-uploads.s3.amazonaws.com/i/3buqfz0by0lu2z4kf3uq.png)\n\nCheck `tutorials` table after some rows were updated:\n```testdb=# select * from tutorials;\n id |     title      |    description    | published |         createdAt          |         updatedAt\n----+----------------+-------------------+-----------+----------------------------+----------------------------\n  1 | Node Tut #1    | Tut#1 Description | f         | 2020-01-29 10:42:57.121+07 | 2020-01-29 10:42:57.121+07\n  3 | Node Tut #3    | Tut#3 Description | f         | 2020-01-29 10:43:48.028+07 | 2020-01-29 10:43:48.028+07\n  2 | Node Js Tut #2 | Tut#2 Description | t         | 2020-01-29 10:43:05.131+07 | 2020-01-29 10:51:55.235+07\n  4 | Js Tut #4      | Tut#4 Desc        | t         | 2020-01-29 10:45:40.016+07 | 2020-01-29 10:54:17.468+07\n  5 | Js Tut #5      | Tut#5 Desc        | t         | 2020-01-29 10:45:44.289+07 | 2020-01-29 10:54:20.544+07\n```\n\n- Find all Tutorials which title contains 'js': `GET /tutorials?title=js`\n\n![node-js-postgresql-crud-example-search](https://dev-to-uploads.s3.amazonaws.com/i/u2hbmz5r35o7uo09y3z5.png)\n\n- Find all published Tutorials using `GET /tutorials/published` Api\n\n![node-js-postgresql-crud-example-search-status](https://dev-to-uploads.s3.amazonaws.com/i/dbo753wfqibt0b93d82d.png)\n\n- Delete a Tutorial using `DELETE /tutorials/:id` Api\n\n![node-js-postgresql-crud-example-delete-one](https://dev-to-uploads.s3.amazonaws.com/i/pyos3wq4tchb8ixuyj1c.png)\n\nTutorial with id=4 was removed from `tutorials` table:\n```testdb=# select * from tutorials;\n id |     title      |    description    | published |         createdAt          |         updatedAt\n----+----------------+-------------------+-----------+----------------------------+----------------------------\n  1 | Node Tut #1    | Tut#1 Description | f         | 2020-01-29 10:42:57.121+07 | 2020-01-29 10:42:57.121+07\n  3 | Node Tut #3    | Tut#3 Description | f         | 2020-01-29 10:43:48.028+07 | 2020-01-29 10:43:48.028+07\n  2 | Node Js Tut #2 | Tut#2 Description | t         | 2020-01-29 10:43:05.131+07 | 2020-01-29 10:51:55.235+07\n  5 | Js Tut #5      | Tut#5 Desc        | t         | 2020-01-29 10:45:44.289+07 | 2020-01-29 10:54:20.544+07\n```\n\n- Delete all Tutorials using `DELETE /tutorials` Api\n\n![node-js-postgresql-crud-example-delete-all](https://dev-to-uploads.s3.amazonaws.com/i/ga42747jorssl20ywyug.png)\n\nNow there are no rows in `tutorials` table:\n```testdb=# select * from tutorials;\n id | title | description | published | createdAt | updatedAt\n----+-------+-------------+-----------+-----------+-----------\n```\n\nMore Practice:\n\u003e [Node.js Express Pagination with PostgreSQL example](https://bezkoder.com/node-js-pagination-postgresql/)\n\n\u003e [Node.js Express File Upload Rest API example](https://bezkoder.com/node-js-express-file-upload/)\n\n\u003e [Node.js Express File Upload with Google Cloud Storage example](https://bezkoder.com/google-cloud-storage-nodejs-upload-file/)\n\nSecurity:\n\u003e [Node.js JWT Authentication \u0026 Authorization with PostgreSQL example](https://bezkoder.com/node-js-jwt-authentication-postgresql/)\n\nAssociations:\n\u003e [Sequelize Associations: One-to-Many Relationship example](https://bezkoder.com/sequelize-associate-one-to-many/)\n\n\u003e [Sequelize Associations: Many-to-Many Relationship example](https://bezkoder.com/sequelize-associate-many-to-many/)\n\nFullstack:\n\u003e [Vue + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/vue-node-express-postgresql/)\n\n\u003e [React + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/react-node-express-postgresql/)\n\n\u003e [Angular 8 + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/angular-node-express-postgresql/)\n\n\u003e [Angular 10 + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/angular-10-node-express-postgresql/)\n\n\u003e [Angular 11 + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/angular-11-node-js-express-postgresql/)\n\n\u003e [Angular 12 + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/angular-12-node-js-express-postgresql/)\n\n\u003e [Angular 13 + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/angular-13-node-js-express-postgresql/)\n\n\u003e [Angular 14 + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/angular-14-node-js-express-postgresql/)\n\n\u003e [Angular 15 + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/angular-15-node-js-express-postgresql/)\n\n\u003e [Angular 16 + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/angular-16-node-js-express-postgresql/)\n\n\u003e [Angular 17 + Node.js + Express + PostgreSQL example](https://www.bezkoder.com/angular-17-node-js-express-postgresql/)\n\nIntegration (run back-end \u0026 front-end on same server/port)\n\u003e [Integrate React with Node.js Restful Services](https://bezkoder.com/integrate-react-express-same-server-port/)\n\n\u003e [Integrate Angular with Node.js Restful Services](https://bezkoder.com/integrate-angular-10-node-js/)\n\n\u003e [Integrate Vue with Node.js Restful Services](https://bezkoder.com/serve-vue-app-express/)\n\n## Project setup\n```\nnpm install\n```\n\n### Run\n```\nnode server.js\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezkoder%2Fnode-express-sequelize-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbezkoder%2Fnode-express-sequelize-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezkoder%2Fnode-express-sequelize-postgresql/lists"}