{"id":21167760,"url":"https://github.com/thecodersstudio/node-pg-sequelize-boilerplate","last_synced_at":"2025-08-20T19:22:33.894Z","repository":{"id":38364019,"uuid":"477670704","full_name":"TheCodersStudio/node-pg-sequelize-boilerplate","owner":"TheCodersStudio","description":"Node.js Express Sequelize Boilerplate with PostgreSQL Integration and Comprehensive Unit/Integration Test Setup","archived":false,"fork":false,"pushed_at":"2024-10-21T20:01:19.000Z","size":1893,"stargazers_count":66,"open_issues_count":10,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T16:08:53.939Z","etag":null,"topics":["boilerplate","express","express-sequelize-boilerplate","node-express-sequelize-boilerplate","node-sequelize-postgres","nodejs","nodejs-postgres-sequelize-boilerplate","nodejs-rest-boilerplate","postgres","sequelize"],"latest_commit_sha":null,"homepage":"https://thecodersstudio.github.io/node-pg-sequelize-boilerplate/","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/TheCodersStudio.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":"2022-04-04T11:28:41.000Z","updated_at":"2025-03-18T10:49:11.000Z","dependencies_parsed_at":"2023-02-13T20:31:31.948Z","dependency_job_id":"8a917c81-9943-409a-b14b-9524493d5de2","html_url":"https://github.com/TheCodersStudio/node-pg-sequelize-boilerplate","commit_stats":{"total_commits":78,"total_committers":4,"mean_commits":19.5,"dds":0.2435897435897436,"last_synced_commit":"83e985fb50174912e5e4a85d7f877fa49671b512"},"previous_names":["the-chetan07/node-pg-sequelize-boilerplate","chetanppatil/node-pg-sequelize-boilerplate","devinsightlab/node-pg-sequelize-boilerplate","thecodersstudio/node-pg-sequelize-boilerplate"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCodersStudio%2Fnode-pg-sequelize-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCodersStudio%2Fnode-pg-sequelize-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCodersStudio%2Fnode-pg-sequelize-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCodersStudio%2Fnode-pg-sequelize-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheCodersStudio","download_url":"https://codeload.github.com/TheCodersStudio/node-pg-sequelize-boilerplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065283,"owners_count":21041871,"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":["boilerplate","express","express-sequelize-boilerplate","node-express-sequelize-boilerplate","node-sequelize-postgres","nodejs","nodejs-postgres-sequelize-boilerplate","nodejs-rest-boilerplate","postgres","sequelize"],"created_at":"2024-11-20T15:01:59.705Z","updated_at":"2025-04-09T16:08:58.074Z","avatar_url":"https://github.com/TheCodersStudio.png","language":"JavaScript","readme":"# Node-Express-Sequelize-API Boilerplate \u003c!-- omit in toc --\u003e\n\nSimple boilerplate code base for creating APIs with `Node.js Express` framework using `Sequelize` with `PostgreSQL` database.\n\n## 📚 Contents \u003c!-- omit in toc --\u003e\n\n- [Includes](#includes)\n- [Prerequisite](#prerequisite)\n- [Getting Started](#getting-started)\n- [Local Setup](#local-setup)\n- [Tests \\\u0026 Coverage](#tests--coverage)\n- [Migrations](#migrations)\n- [Environment Variables](#environment-variables)\n- [`ESDoc`](#esdoc)\n- [Endpoints](#endpoints)\n- [References](#references)\n\n## Includes\n\n- **ES6** `import/export` implemented with `type: \"module\"` in `package.json`\n- **Error handling** middlewares implemented\n- `Tests` added with `mocha` configuration\n- Code-coverage using Node.js' built in functionality `c8`\n- `Eslint`\n- `winston` logger\n\n## 😊 Prerequisite\n\n- Install `nodemon` globally using below command if not installed already\n\n  ```sh\n  npm i -g nodemon\n  ```\n\n- **PostgreSQL**\n\n## 🚀 Getting Started\n\nYou can download or clone this repo using below command:\n\n```sh\ngit clone git@github.com:Chetan07j/node-pg-sequelize.git\n```\n\n## ⚙️ Local Setup\n\n- After cloning enter into folder.\n- Install dependencies\n\n  ```sh\n  npm install\n  ```\n\n- Create file called `.env`\n- Copy `.env.example` file content `.env` file.\n\n- Run locally\n\n  ```sh\n  npm run local\n  ```\n\n## 🧪 Tests \u0026 Coverage\n\n- Run tests *(unit/integration)*\n\n  ```sh\n  npm test\n  ```\n\n- Run tests with coverage\n\n  ```sh\n  npm run coverage\n  ```\n\n## 🗃️ Migrations\n\n- Running Migrations\n\n  ```sh\n  npm run migration\n  ```\n\n- Undoing Migrations\n\n  ```sh\n  npm run migration:undo\n  ```\n\n## ℹ️ Environment Variables\n\n| Variable | Description              | Default Value |\n| -------- | ------------------------ | ------------- |\n| DB_HOST  | Database connection host | `localhost`   |\n| DB_PORT  | Database port            | `5432`        |\n| DB_NAME  | Database name            | `postgres`    |\n| DB_USER  | Database username        | `postgres`    |\n| DB_PASS  | Database password        | `postgres`    |\n\n\u003e NOTE: These environment variables are already passed to `npm run local` and `npm test` scripts under `package.json` with their default values. You can update as per your need.\n\n## 🗒️ `ESDoc`\n\n- Documention is created out of comments added for functions using `esdoc`.\n- That documentaion is avaialbe as GH Pages site, can be found [here](https://chetan07j.github.io/node-pg-sequelize-boilerplate/).\n\n## ✴️ Endpoints\n\n\u003c!-- Create User with Skills --\u003e\n\u003cdetails\u003e\n    \u003csummary\u003eCreate User with Skills\u003c/summary\u003e\n\n  ```sh\n  curl --location --request POST 'localhost:3000/v1/users' \\\n  --header 'Content-Type: application/json' \\\n  --data-raw '{\n      \"firstName\": \"Chetan\",\n      \"lastName\": \"Patil\",\n      \"gender\": \"Male\",\n      \"skills\": [\n          {\n              \"name\": \"Node.js\",\n              \"proficiency\": \"Advanced\"\n          }\n      ]\n  }'\n  ```\n\n\u003c/details\u003e\n\n\u003c!-- Get all `Users` --\u003e\n\u003cdetails\u003e\n    \u003csummary\u003eGet all Users\u003c/summary\u003e\n\n    ```sh\n    # Request\n    \n    curl --location --request GET 'localhost:3000/v1/users'\n\n    #Response\n\n    {\n      \"success\": true,\n      \"body\": [\n        {\n          \"id\": 1,\n          \"firstName\": \"First1\",\n          \"lastName\": \"Last\",\n          \"gender\": \"Male\",\n          \"createdAt\": \"2022-03-20T10:11:41.860Z\",\n          \"updatedAt\": \"2022-03-20T10:11:41.860Z\",\n          \"skills\": [\n            {\n              \"id\": 1,\n              \"userId\": 1,\n              \"name\": \"Node.js\",\n              \"proficiency\": \"Advanced\",\n              \"createdAt\": \"2022-03-20T10:11:41.867Z\",\n              \"updatedAt\": \"2022-03-20T10:11:41.867Z\"\n            }\n          ]\n        }\n      ]\n    }\n\n    ```\n\n\u003c/details\u003e\n\n\u003c!-- Get specific `User` by `userId` --\u003e\n\u003cdetails\u003e\n    \u003csummary\u003eGet specific User by userId\u003c/summary\u003e\n\n    ```sh\n    # Request\n\n    curl --location --request GET 'localhost:3000/v1/users/1'\n\n    # Response\n\n    {\n      \"success\": true,\n      \"body\": {\n        \"id\": 1,\n        \"firstName\": \"Chetan\",\n        \"lastName\": \"Patil\",\n        \"gender\": \"Male\",\n        \"createdAt\": \"2022-03-20T20:39:17.912Z\",\n        \"updatedAt\": \"2022-03-20T20:39:17.912Z\",\n        \"skills\": [\n          {\n            \"id\": 1,\n            \"userId\": 1,\n            \"name\": \"Node.js\",\n            \"proficiency\": \"Advanced\",\n            \"createdAt\": \"2022-03-20T20:39:17.962Z\",\n            \"updatedAt\": \"2022-03-20T20:39:17.962Z\"\n          }\n        ]\n      }\n    }\n    ```\n\u003c/details\u003e\n\n## 📚 References\n\n- [Sequelize ORM](https://sequelize.org/v6/)\n\n## 🤗 Contributing\n\nContributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.\n\nMake sure your request is meaningful and you have tested the app locally before submitting a pull request.\n\n## ♥️ Support\n\n💙 If you like this project, give it a ⭐\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodersstudio%2Fnode-pg-sequelize-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodersstudio%2Fnode-pg-sequelize-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodersstudio%2Fnode-pg-sequelize-boilerplate/lists"}