{"id":51243326,"url":"https://github.com/nabadeep25/typescript-node-sequelize-boilerplate","last_synced_at":"2026-06-29T02:01:00.152Z","repository":{"id":64615172,"uuid":"563805990","full_name":"nabadeep25/typescript-node-sequelize-boilerplate","owner":"nabadeep25","description":"This is a boilerplate for node typescript and sequelize","archived":false,"fork":false,"pushed_at":"2025-06-15T12:17:18.000Z","size":229,"stargazers_count":11,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T23:57:23.500Z","etag":null,"topics":["boilerplate","express","express-js","hacktoberfest","node","node-typescript-boilerplate","node-typescript-mysql","node-typescript-sequelize","nodejs","sequelize","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nabadeep25.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2022-11-09T11:29:12.000Z","updated_at":"2025-07-02T07:10:10.000Z","dependencies_parsed_at":"2025-06-07T17:34:22.125Z","dependency_job_id":null,"html_url":"https://github.com/nabadeep25/typescript-node-sequelize-boilerplate","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"669cdf40ce1c1c0e25ec8631f6418b769ad68e9d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nabadeep25/typescript-node-sequelize-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabadeep25%2Ftypescript-node-sequelize-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabadeep25%2Ftypescript-node-sequelize-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabadeep25%2Ftypescript-node-sequelize-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabadeep25%2Ftypescript-node-sequelize-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabadeep25","download_url":"https://codeload.github.com/nabadeep25/typescript-node-sequelize-boilerplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabadeep25%2Ftypescript-node-sequelize-boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34910177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"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":["boilerplate","express","express-js","hacktoberfest","node","node-typescript-boilerplate","node-typescript-mysql","node-typescript-sequelize","nodejs","sequelize","typescript"],"created_at":"2026-06-29T02:00:57.252Z","updated_at":"2026-06-29T02:01:00.143Z","avatar_url":"https://github.com/nabadeep25.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typescript-Node-Sequelize-Boilerplate\n\nA boilerplate/starter project for quickly building RESTful APIs using Node.js,Typescript, Express, and Sequelize.\n\n\n- Node \n- Typescript\n- Express\n- Sequelize (Oracle, Postgres, MySQL, MariaDB, SQLite and SQL Server etc.)\n\n## Link to NPM\n [@nabadeep25/create-ts-node-app](https://www.npmjs.com/package/@nabadeep25/create-ts-node-app)\n\n## Table of Contents\n\n- [Typescript-Node-Sequelize-Boilerplate](#typescript-node-sequelize-boilerplate)\n  - [Table of Contents](#table-of-contents)\n  - [Quick start](#quick-start)\n  - [Manual Installation](#manual-installation)\n  - [Getting started](#getting-started)\n  - [For development](#for-development)\n  - [Docker Setup](#docker-setup)\n    - [Using Docker Compose (Recommended)](#using-docker-compose-recommended)\n    - [Using Docker Only](#using-docker-only)\n  - [Sample .ENV](#sample-env)\n  - [Commands](#commands)\n  - [Project Structure](#project-structure)\n  - [API Documentation](#api-documentation)\n    - [API Endpoints](#api-endpoints)\n  - [Inspirations](#inspirations)\n\n\n\n## Quick start\n\ncreate boillerplate with single command\n\n```sh\n npx  @nabadeep25/create-ts-node-app myapp\n\n```\n\n\n\n## Manual Installation\n\nsteps:\n\nClone the repo:\n\n```sh\ngit clone --depth 1 https://github.com/nabadeep25/typescript-node-sequelize-boilerplate.git  foldername\n\ncd folder name\nnpx rimraf ./.git\n```\n\nInstall the dependencies:\n\n```sh\nnpm install\n```\n\nSet the environment variables:\n\n```sh\ncp .env.example .env\n\n```\n## Getting started\n\n```sh\nnpm install\n\nnpm run build-ts\n\nnpm start\n\n```\n\n## For development\n\n```sh\nnpm install\n\nnpm run dev\n\n```\n\n## Docker Setup\n\n### Using Docker Compose (Recommended)\n\nThe easiest way to run the application with Docker is using Docker Compose, which will set up both the Node.js application and PostgreSQL database.\n\n1. **Create a `.env` file** in the project root:\n\n```bash\n# Database Configuration\nDB_HOST=postgres\nDB_PORT=5432\nDB_TYPE=postgres\nDB_NAME=myapp\nDB_USER=postgres\nDB_PASSWORD=password\n\n# JWT Configuration\nSECRET=your-secret-key-change-this-in-production\nTOKEN_EXPIRY_HOUR=24\n\n# Email Configuration\nEMAIL_SERVICE=gmail\nEMAIL_USER=your-email@gmail.com\nEMAIL_PASS=your-email-password\nEMAIL_FROM=your-email@gmail.com\n\n# OTP Configuration\nOTP_EXPIRY_MIN=5\nOTP_SECRET=your-otp-secret-change-this-in-production\n```\n\n2. **Build and run the containers**:\n\n```bash\n# Build and start all services\ndocker compose up --build\n\n# Run in detached mode (background)\ndocker compose up -d --build\n\n# Stop the services\ndocker compose down\n\n```\n\n3. **Access the application**:\n   - **API**: http://localhost:5000/api/\n   - **Swagger Documentation**: http://localhost:5000/api/v1/docs/\n   - **Database**: PostgreSQL on localhost:5432\n\n### Using Docker Only\n\nIf you prefer to run only the application container and connect to an external database:\n\n1. **Build the Docker image**:\n\n```bash\ndocker build -t typescript-node-app .\n```\n\n2. **Run the container**:\n\n```bash\ndocker run -p 5000:5000 \\\n  -e DB_HOST=your-db-host \\\n  -e DB_PORT=5432 \\\n  -e DB_TYPE=postgres \\\n  -e DB_NAME=your-db-name \\\n  -e DB_USER=your-db-user \\\n  -e DB_PASSWORD=your-db-password \\\n  -e SECRET=your-secret-key \\\n  -e TOKEN_EXPIRY_HOUR=24 \\\n  -e EMAIL_SERVICE=gmail \\\n  -e EMAIL_USER=your-email@gmail.com \\\n  -e EMAIL_PASS=your-email-password \\\n  -e EMAIL_FROM=your-email@gmail.com \\\n  -e OTP_EXPIRY_MIN=5 \\\n  -e OTP_SECRET=your-otp-secret \\\n  typescript-node-app\n```\n\n\n### Docker Commands\n\n```bash\n# Build the image\ndocker build -t typescript-node-app .\n\n# Run container\ndocker run -p 5000:5000 typescript-node-app\n\n# Run with environment file\ndocker run -p 5000:5000 --env-file .env typescript-node-app\n\n# View running containers\ndocker ps\n\n# View logs\ndocker logs \u003ccontainer-id\u003e\n\n# Stop container\ndocker stop \u003ccontainer-id\u003e\n\n```\n\n\n## Sample .ENV\n```sh\nDB_HOST=localhost\nDB_NAME=name\nDB_PASSWORD=password\nDB_PORT=3306\nDB_TYPE=postgres\nDB_USER=username\nPORT=5000\n\n\n\nTOKEN_EXPIRY_HOUR=168\nSECRET=askjfghhwifuhgw\n\nEMAIL_SERVICE=gmail\nEMAIL_USER=you@email.com\nEMAIL_PASS=fzobeitqjcxklenm\nEMAIL_FROM=admin@email.com\n\nOTP_EXPIRY_MIN=10\nOTP_SECRET=shgdbnbgw\n\n```\n\n\n\n\n## Commands\n\n\n```bash\n# run in development\nnpm run dev\n\n# run in production\nnpm run start\n\n#  lint files\nnpm run lint\n\n#  format files\nnpm run format\n\n# Docker commands\ndocker compose up --build\ndocker compose down\n```\n\n\n\n\n## Project Structure\n\n```\ndist\\               # js files\nsrc\\\n |--config\\         # Environment variables and configuration related things\n |--controllers\\    # Route controllers \n |--helpers\\        # Helper function files\n |--middlewares\\    # Custom express middlewares\n |--model\\          # Sequelize models \n |--routes\\         # Routes\n |--services\\       # Service \n |--utils\\          # Utility classes and functions\n |--validations\\    # Request data validation schemas\n |--app.ts\\         # Express app\n |--server.ts\\      # App entry point\ndocker-compose.yml  # Docker Compose configuration\nDockerfile          # Docker image definition\n.env                # Environment variables\n```\n## Changing Database\n\n### step 1\n \n ```sh\n # Change the value of  DB_TYPE  in .env file to one of the follwing\n DB_TYPE=postgres \n DB_TYPE=mysql \n DB_TYPE=sqlite \n DB_TYPE=mariadb \n DB_TYPE=mssql \n DB_TYPE=db2 \n DB_TYPE=oracle \n ```\n### step 2\n```sh\n# Install one of the related packge:\n npm install --save pg pg-hstore # for Postgres\n npm install --save mysql2 # for Mysql\n npm install --save mariadb # for Mariadb\n npm install --save sqlite3 # for Sqlite\n npm install --save tedious # for Microsoft SQL Server (mssql)\n npm install --save oracledb # for Oracle \n```\nfor more details please refer [Sequelize](https://sequelize.org/docs/v6/getting-started/)\n## API Documentation\n\nTo view the list of available APIs and their specifications, run the server and go to `http://localhost:5000/api/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### API Endpoints\n\nList of available routes:\n\n**General routes**: \u003cbr\u003e\n`GET api/` - get server status \u003cbr\u003e\n`PATCH api/sync` - Sync model with database \u003cbr\u003e\n\n**Auth routes**:  \u003cbr\u003e\n`POST api/v1/auth/register` - register \u003cbr\u003e\n`POST api/v1/auth/login` - login \u003cbr\u003e\n`POST api/v1/auth/forgot-password` - send reset password email \u003cbr\u003e\n`POST api/v1/auth/reset-password` - reset password \u003cbr\u003e\n\n\n**User routes**: \u003cbr\u003e\n`GET api/v1/user` - get user info \u003cbr\u003e\n`PATCH api/v1/user` - update user \u003cbr\u003e\n\n\n\n\n\n## Inspirations\n- [hagopj13/node-express-boilerplate](https://github.com/hagopj13/node-express-boilerplate)\n- [microsoft/typescript-node-starter](https://github.com/microsoft/TypeScript-Node-Starter)\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabadeep25%2Ftypescript-node-sequelize-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabadeep25%2Ftypescript-node-sequelize-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabadeep25%2Ftypescript-node-sequelize-boilerplate/lists"}