It helps in giving a boon start for building the application.
I have created a custom framework over #express for this application. This framework is somewhat similar to sails.
api folder contains middlewares, controllers, models, helpers.
Not-found - Returning 404
Router - Initialises the routes
session - Session middleware
5xx - Error handler
images - All the images
js - Contains the JS and JS libs
styles - Contains all the less files
bower is used to install the library
RequireJS is used for Module Loading
logs folder will contain the generated log files. I am using winston for logging <lib/logger>.
configs contains the configuration files.
configs/env contains the environment configurations.
dev - Normal Dev without watch task
default - dev with watch task
live - for production
api folder contains the routes.js which contains the routes and their controllers and middlewares. using this file, we initialize our custom router <lib/router>.
We are using ejs templating. All the views exists in views folder.
HTML5 Form Validation is applied.
configs/bootstrap.js initializes our router.
js/app contains all the client side javascript files.
Session is maintained in Session Storage of browser
client libraries are installed using bower and bundled using requirejs (AMD)
styles contains all the less files
resources contains the data.json (Our Data file)
models contains our model flight.js which interacts with data.json
Controller folder contains the controller. (IndexController and SearchController)
routes are defined in routes.js
helpers are defined which can be used at server side.
middlewares are defined in this folder.
Test cases environment is setup.
Unit Test cases are written in test folder.
We are using mocha, mocha-phantomjs, chai for writing test cases.
use this command "npm run servelive" before running the tests.
Running test cases for server `npm run testserver`
Running test cases for client `npm run testclient`
npm install
bower install
(npm install bower -g
if not installed)npm run servedev
- DEVELOPMENTnpm run servelive
- PRODUCTIONnode server.js
(Please create 'logs' folder before running the command if doesnot exist at base level)
If you are still not able to run it or wish to contribute. Then mail me Parveen Arora - parveen1112@gmail.com