A boilerplate for Node.js web applications.
It is based on following libraries and frameworks-
- Express.js
- Ejs template engine
- mongoose
- jQuery
- Semantic UI
- JsonWebToken for authentication
- bin: It contains the main file 'www' which starts node server
- config: All the configurable parameters and credentials
- data: json data
- logs: logs dumps here
- middlewares: All the middlewares defined here
- models: Sequelize models (database schema)
- modules: Independent modules used throughout the app are defined here
- public: All the static resources (js, css, images)
- routes: All the routes
- services: These act as middlemen between routes and database. All the database operations are made here.
- views: Contains HTML and .ejs files used for rendering to frontend
git clone https://github.com/varunon9/node-starter-app-mongo.git
cd node-starter-app-mongo
npm install
cd public
bower install
- create database 'nodeStarterAppMongo' in MySql
create database nodeStarterAppMongo
- come back to project directory
cd ..
- start app
nodemon bin/www
ornode bin/www
- visit localhost:4000 in browser
- using camelCase for naming variables, functions in javascript
- using camelCase for naming MySql tables, CSS IDs
- using hyp-hens for naming CSS classes
- using under_scores for naming files and folders
- using UPPERCASE for constants and global variables
- using PascalCase for naming Javascript classes
- Line length max 80 characters for Javascript
- Line length max 120 characters for HTML
- Standard JS coding conventions- https://www.w3schools.com/js/js_conventions.asp