{"id":21404075,"url":"https://github.com/fadhlaouir/express-node-starter","last_synced_at":"2025-10-04T09:10:14.737Z","repository":{"id":121327022,"uuid":"517641189","full_name":"fadhlaouir/express-node-starter","owner":"fadhlaouir","description":"A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose","archived":false,"fork":false,"pushed_at":"2024-04-01T08:38:16.000Z","size":775,"stargazers_count":10,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-29T05:30:18.253Z","etag":null,"topics":["authentication","boilerplate","express","jwt","mongodb","multer","node-express","node-express-boilerplate","node-express-mongodb","nodejs","nodemailer","rest-api","starter"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fadhlaouir.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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-07-25T11:41:40.000Z","updated_at":"2025-08-20T10:41:52.000Z","dependencies_parsed_at":"2024-03-18T10:59:40.886Z","dependency_job_id":"09c229c4-c4b2-4e64-ae9e-b941c2793cf4","html_url":"https://github.com/fadhlaouir/express-node-starter","commit_stats":null,"previous_names":["fadhlaouir/node-express-starter","fadhlaouir/express-node-starter"],"tags_count":12,"template":true,"template_full_name":null,"purl":"pkg:github/fadhlaouir/express-node-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhlaouir%2Fexpress-node-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhlaouir%2Fexpress-node-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhlaouir%2Fexpress-node-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhlaouir%2Fexpress-node-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fadhlaouir","download_url":"https://codeload.github.com/fadhlaouir/express-node-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhlaouir%2Fexpress-node-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278290251,"owners_count":25962509,"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-10-04T02:00:05.491Z","response_time":63,"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":["authentication","boilerplate","express","jwt","mongodb","multer","node-express","node-express-boilerplate","node-express-mongodb","nodejs","nodemailer","rest-api","starter"],"created_at":"2024-11-22T16:12:34.766Z","updated_at":"2025-10-04T09:10:14.713Z","avatar_url":"https://github.com/fadhlaouir.png","language":"JavaScript","readme":"# REST API Developed with Node.js, Express, MongoDB, Multer and nodemailer Boilerplate\n\n[![Author](http://img.shields.io/badge/author-@rfadhlaoui-blue.svg)](https://tn.linkedin.com/in/fadhlaouiraed)\n[![GitHub license](https://img.shields.io/github/license/maitraysuthar/rest-api-nodejs-mongodb.svg)](https://github.com/fadhlaouir/express-node-starter/blob/main/LICENSE)\n[![Downloads](https://img.shields.io/npm/dt/express-node-starter.svg)](https://www.npmjs.com/package/express-node-starter)\n\n## Overview\n\nThis project provides a robust API skeleton written in JavaScript ES6, suitable for any project. It offers features such as authentication, authorization, JWT tokens, role management, CRUD operations, email notifications, and more. Additionally, it automates the generation of CRUD (Create, Read, Update, Delete) operations for entities within a MongoDB database, streamlining the development process for Node.js applications built on top of Express.js.\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n- [Features](#features)\n- [Software Requirements](#software-requirements)\n- [Engines](#engines)\n- [How to Install](#how-to-install)\n- [Setting up Environments](#setting-up-environments)\n- [Project Structure](#project-structure)\n- [How to Run](#how-to-run)\n- [CLI Commands](#cli-commands)\n- [Linting and Formatting](#linting-and-formatting)\n- [Bugs or Improvements](#bugs-or-improvements)\n- [License](#license)\n- [Credits](#credits)\n- [Support](#support)\n\n## Getting started\n\nThis is a basic API skeleton written in JavaScript ES6.\n\nThis project will run on **NodeJs** using **MongoDB** as database.\n\nAPI Documentation [Swagger]\n\n## Features\n\n- Authentication and Authorization\n- JWT Tokens, make requests with a token after login with `Authorization` header with value `Bearer yourToken` where `yourToken` will be returned in the Login response.\n- Role Manage\n- Update Profile/Password User Account\n- Upload Image with multer\n- Reset Password Mail using `nodemailer`\n- Pre-defined response structures with proper status codes.\n- Included CORS.\n- System notification with Firebase\n- Email Template and settings\n- Validations added.\n- Included API collection for Postman.\n- Light-weight project.\n- Linting with [Eslint](https://eslint.org/). (Airbnb style)\n- Included CLI for generating CRUD operations.\n- husky for pre-commit hooks and lint-staged for running linters on git staged files.\n\n## Software Requirements\n\n- Node.js **16+**\n- MongoDB **4+**\n\n### Engines\n\n- node **\u003e=14.16.0 \u003c=20.11.0**\n- npm **\u003e=6.14.11 \u003c=10.2.4**\n\n## How to install\n\n### Using Git (recommended)\n\n1.  Clone the project from github.\n\n```bash\ngit clone https://github.com/fadhlaouir/express-node-starter.git\n```\n\n### Using manual download ZIP\n\n1.  Download repository\n2.  Uncompress to your desired directory\n\n### Install npm dependencies after installing (Git or manual download)\n\n```bash\ncd express-node-starter\nnpm install\n```\n\n## Setting up environments\n\n1.  You will find a file named `.env.example` on root directory of project.\n2.  Create a new file by copying and pasting the file and then renaming it to just `.env`\n    ```bash\n    cp .env.example .env\n    ```\n3.  The file `.env` is already ignored, so you never commit your credentials.\n4.  Change the values of the file to your environment. Helpful comments added to `.env.example` file to understand the constants.\n\n## Project structure\n\n```sh\n.\n├── .husky\n│   ├── _\n│   │   ├── .gitignore\n│   │   └── husky.sh\n│   ├── pre-commit\n│   └── pre-push\n├── cli\n│   ├── _\n│   │   ├── deleteCrud.js\n│   │   ├── generateEmptyCrud.js\n│   │   ├── generateMinimalCrud.js\n│   │   └── helpers.js\n│   ├── index.js\n│   └── README.md\n├── src\n│   ├── controllers\n│   │   ├── auth.controller.js\n│   │   └── user.controller.js\n│   ├── middlewares\n│   │   ├── multer.js\n│   │   └── verify-token.js\n│   ├── models\n│   │   └── user.model.js\n│   ├── routes\n│   │   ├── auth.route.js\n│   │   └── user.route.js\n│   ├── template\n│   │   └── userAccountEmailTemplates.js\n│   ├── utils\n│   │   └── helpers.js\n│   └── swagger.json\n├── .commitlintrc.json\n├── .editorconfig\n├── .env\n├── .env.example\n├── .eslintignore.json\n├── .eslintrc.json\n├── .gitignore\n├── .prettierignore.json\n├── .prettierrc.json\n├── CHANGELOG.md\n├── LICENSE\n├── package.json\n├── README.md\n└── server.js\n\n```\n\n## How to run\n\n### Running API server locally\n\nIf you would like to run the API server on your local environment, you can do so by running the following command:\nWindows OS\n\n```bash\nnpm run develop\n```\n\nLinux OS or Mac OS\n\n```bash\nnpm run develop:mac\n```\n\n```bash\nConnected to the database:YOUR_DB_CONNECTION_STRING\nApp is running ...\n\nPress CTRL + C to stop the process.\n```\n\n**Note:**\n\n`YOUR_DEVELOPMENT_DB_CONNECTION_STRING` will be your MongoDB connection string for `development` environment.\n\n`YOUR_PRODUCTION_DB_CONNECTION_STRING` will be your MongoDB connection string for `production` environment.\n\n### Creating new models\n\nIf you need to add more models to the project just create a new file in `src/models/` and use them in the controllers.\n\n### Creating new routes\n\nIf you need to add more routes to the project just create a new file in `src/routes/` and import it in `src/app` to be loaded.\n\n### Creating new controllers\n\nIf you need to add more controllers to the project just create a new file in `src/controllers/` and use them in the routes.\n\n## Using the CLI to generate CRUD operations\n\n1. Navigate to the project directory.\n2. Run the following command:\n\n```bash\nnpm run crud:operation\n```\n\nSee the [CLI README](cli/README.md) section for more details on how to use the CLI to generate or delete CRUD operations.\n\nFollow the prompts to select the CRUD type (empty or minimal) and provide the entity name. The tool will generate the necessary files for the CRUD operations based on your selection.\n\n## Linting and Formatting\n\n### Running Eslint\n\n```bash\nnpm run lint:check\n```\n\n### Fixing Eslint errors\n\n```bash\nnpm run lint:fix\n```\n\n### Prettier for code formatting\n\n```bash\nnpm run format:fix\n```\n\nYou can set custom rules for eslint in `.eslintrc.json` file, Added at project root.\n\n## Bugs or improvements\n\nEvery project needs improvements, Feel free to report any bugs or improvements. Pull requests are always welcome.\n\n## License\n\nThis project is open-sourced software licensed under the MIT License. See the LICENSE file for more information.\n\n## Credits\n\n- Raed FADHLAOUI: [Author Email](mailto:raed.fadhlaoui@hotmail.com)\n- Project Repository: [GitHub Repository](https://github.com/fadhlaouir/express-node-starter)\n\n# Sponsor on Buy Me a Coffee\n\nIf you find this project valuable, consider supporting us through Buy Me a Coffee. Your sponsorship helps us maintain and improve the project, ensuring better features, updates, and support for the community.\n\n\u003ca href=\"https://www.buymeacoffee.com/fadhlaouir\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n\n","funding_links":["https://www.buymeacoffee.com/fadhlaouir"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadhlaouir%2Fexpress-node-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffadhlaouir%2Fexpress-node-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadhlaouir%2Fexpress-node-starter/lists"}