Skip to content

NehaChitkara/NodeJS-Boilerplate

Repository files navigation

Node JS Boilerplate (With Express JS)

Use this boilerplate repository to kickstart your ExpressJS project

Directory structure

This repository follows the following folder structure:

  • Models - Contains all the ORM models (called Schemas in mongoose)
  • Public - Contains all static content like images, client-side javascript, and css
  • Controllers - Contains the functions
  • Routes - Contains the Express routes
  • Views - Contains the view templates (like ejs, jade or other templating engine)
  • Logs - Contains the generated log files
  • package.json- File containing metadata of dependencies

How to use the project

To use the repository, follow the steps as described.

  1. Clone the repository
  2. Install the repositories using the following command

npm install

  1. Start the project using

node app.js OR npm start

Use the express-generator for boilerplate code

Another way to create a basic express app is to use the npm module "express-generator"

Check out the steps and the generated app here: Express Generator Example

Happy coding!