{"id":27075897,"url":"https://github.com/rkgitvinay/node-express-pg-boilerplate","last_synced_at":"2026-04-13T04:35:22.267Z","repository":{"id":286126812,"uuid":"960456532","full_name":"rkgitvinay/node-express-pg-boilerplate","owner":"rkgitvinay","description":"Production ready starter boilerplate for building RESTful APIs using Node.js, Express, and PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-04-04T13:33:11.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-09T15:55:22.015Z","etag":null,"topics":["api","authentication","backend","boilerplate","express","knex","nodejs","objection","objectionjs","postgres","rest-api","starter-template"],"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/rkgitvinay.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":"2025-04-04T13:17:42.000Z","updated_at":"2025-05-15T20:43:34.000Z","dependencies_parsed_at":"2025-04-09T20:08:03.068Z","dependency_job_id":null,"html_url":"https://github.com/rkgitvinay/node-express-pg-boilerplate","commit_stats":null,"previous_names":["rkgitvinay/node-express-pg-boilerplate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rkgitvinay/node-express-pg-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkgitvinay%2Fnode-express-pg-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkgitvinay%2Fnode-express-pg-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkgitvinay%2Fnode-express-pg-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkgitvinay%2Fnode-express-pg-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkgitvinay","download_url":"https://codeload.github.com/rkgitvinay/node-express-pg-boilerplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkgitvinay%2Fnode-express-pg-boilerplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266473051,"owners_count":23934476,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["api","authentication","backend","boilerplate","express","knex","nodejs","objection","objectionjs","postgres","rest-api","starter-template"],"created_at":"2025-04-06T00:18:21.456Z","updated_at":"2026-04-13T04:35:17.236Z","avatar_url":"https://github.com/rkgitvinay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 RESTful Node.js Express + PostgreSQL API Boilerplate\n\nA modern boilerplate/starter project to kickstart your backend APIs using **Node.js**, **Express.js**, **PostgreSQL**, **Objection.js**, and **Knex.js**.  \nBuilt for scalability, security, and productivity. Ideal for RESTful API development with JWT Auth, Swagger Docs, Docker, and a clean project structure.\n\n![Stars](https://img.shields.io/github/stars/rkgitvinay/node-express-pg-boilerplate?style=social)\n![Forks](https://img.shields.io/github/forks/rkgitvinay/node-express-pg-boilerplate?style=social)\n![License](https://img.shields.io/github/license/rkgitvinay/node-express-pg-boilerplate)\n![Issues](https://img.shields.io/github/issues/rkgitvinay/node-express-pg-boilerplate)\n\n\n## Manual Installation\n\nIf you would still prefer to do the installation manually, follow these steps:\n\nClone the repo:\n\n```bash\ngit clone https://github.com/rkgitvinay/node-express-pg-boilerplate.git \u003cfolder-name\u003e\ncd \u003cfolder-name\u003e\nnpx rimraf ./.git\n```\n\nInstall the dependencies:\n\n```bash\nnpm install\n```\n\nSet the environment variables:\n\n```bash\ncp .env.example .env\n\n# open .env and modify the environment variables (if needed)\n```\n\n## Features\n\n- 🛠 **Node + Express** setup\n- 🗃️ **PostgreSQL** with **Knex.js** \u0026 **Objection.js**\n- 🔐 **JWT-based Authentication** (with Passport.js)\n- ✅ **Request Validation** using Joi\n- 📊 **Swagger API Docs** at `/v1/docs`\n- 🧪 **Jest** for Unit \u0026 Integration Testing\n- 🛡️ Helmet, CORS, Input Sanitization for **Security**\n- 🐳 **Docker support** for seamless deployment\n- 📂 Modular and scalable **Project Structure**\n- 📦 Environment management with `.env`\n\n## Commands\n\nRunning locally:\n\n```bash\nnpm run dev\n```\n\nRunning in production:\n\n```bash\nnpm run start\n```\n\nTesting:\n\n```bash\n# run all tests\nnpm run test\n```\n\n## Migration \u0026 seed commands:\n\n```bash\n# Run all migrations\nnpm run migrate\n\n# Roll back last migration\nnpm run migrate:rollback\n\n# Create a new migration\nnpm run migrate:make migration_name\n\n# Run seed files\nnpm run seed\n\n# Create a new seed file\nnpm run seed:make seed_name\n```\n\n## Environment Variables\n\nThe environment variables can be found and modified in the `.env` file. They come with these default values:\n\n```bash\n# Port number\nPORT=3000\n\n# JWT\n# JWT secret key\nJWT_SECRET=thisisasamplesecret\n# Number of minutes after which an access token expires\nJWT_ACCESS_EXPIRATION_MINUTES=30\n# Number of days after which a refresh token expires\nJWT_REFRESH_EXPIRATION_DAYS=30\n\n# Database - PostgreSQL\nPG_DB_HOST=localhost\nPG_DB_PORT=5432\nPG_DB_USER=postgres\nPG_DB_PASSWORD=postgres\nPG_DB_NAME=node-boilerplate\n```\n\n## Project Structure\n\n```\nsrc\\\n |--config\\         # Environment variables and configuration related things\n |--controllers\\    # Route controllers (controller layer)\n |--docs\\           # Swagger files\n |--middlewares\\    # Custom express middlewares\n |--database\\       # Database models, migrations, seed\n |--routes\\         # Routes\n |--services\\       # Business logic (service layer)\n |--utils\\          # Utility classes and functions\n |--validations\\    # Request data validation schemas\n |--index.js        # App entry point\n |--app.js          # Express app\n```\n\n## API Documentation\n\nTo view the list of available APIs and their specifications, run the server and go to `http://localhost:3000/v1/docs` in your browser. This documentation page is automatically generated using the [swagger](https://swagger.io/) definitions written as comments in the route files.\n\n\n## Reference\n\n[https://github.com/hagopj13/node-express-boilerplate](https://github.com/hagopj13/node-express-boilerplate)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkgitvinay%2Fnode-express-pg-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkgitvinay%2Fnode-express-pg-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkgitvinay%2Fnode-express-pg-boilerplate/lists"}