/nodejs-starter

Nodejs Starter - A boilerplate for Node.js web applications

Primary LanguageJavaScriptMIT LicenseMIT

nodejs-starter

MongoDB, Expressjs, Nodejs

GitHub license

Nodejs Starter is a boilerplate for Node.js web applications built with:

  • MongoDB - A document-oriented, No-SQL database used to store the application data.
  • ExpressJS - fast node.js network app framework.
  • nodeJS - A JavaScript runtime built on Chrome's V8 JavaScript engine
  • Authentication with jsonwebtoken

Features

  • Authentication using Email and Password
  • Add / Update / Delete Users

Getting Started

clone the repository

$ git clone https://github.com/georgesimos/nodejs-starter.git myproject
$ cd myproject

Install the dependencies and devDependencies

$ npm install

Set environment variables

cp .env.example .env

Start the server

$ npm start
$ npm run dev # with nodemon live update

Application Structure

app
├── config
│   └── auth.js
│   └── mongoose.js
├── models
│   └── Users
├── routes
│   └── api
│    │   └── auth.js
│    │   └── users.js
│    └── index.js      
└── index.js
  • index.js - The application entry point. This file defines our express server and connects it to MongoDB using mongoose. It also defines the api routes.
  • config/ - This folder contains configuration for mongoose and Auth middleware.
  • models/ - This folder contains the Schema definitions for our Mongoose Models.
  • routes/ - This folder contains the route definitions for our API.

Plugins

nodejs-starter is currently extended with the following plugins. Instructions on how to use them in your own application are linked below.

Server

Plugin README
bcryptjs plugins/bcryptjs/README.md
chalk plugins/chalk/README.md
dotenv plugins/dotenv/README.md
express plugins/express/README.md
express-status-monitor plugins/express-status-monitor/README.md
jsonwebtoken plugins/jsonwebtoken/README.md
mongoose plugins/mongoose/README.md
morgan plugins/morgan/README.md
nodemon plugins/nodemon/README.md

License

MIT