The easiest way to get started is to clone the repository:
# Get the latest snapshot
git clone https://github.com/palash-kulkarni/medibook.git
# Change directory
cd medibook
# Install NPM dependencies
npm install
# Then simply start your app
node app.js
You can use Nodemon : It watches for any changes in your node.js app and
automatically restarts the server. Once installed, instead if node app.js
use
nodemon app.js
. It will save a lot of time in the long run, because you won't
need to manually restart the server each time you make a small change in code.
To install, run sude npm install -g nodemon
.
Name | Description |
---|---|
config/passport.js | Passport Local and OAuth strategies, plus login middleware. |
controllers/api.js | Controller for /api route and all api examples. |
controllers/home.js | Controller for home page (index). |
controllers/user.js | Controller for user account management. |
models/User.js | Mongoose schema and model for User. |
public/ | Static assets (fonts, css, js, img). |
public/js/application.js | Specify client-side JavaScript dependencies. |
public/js/main.js | Place your client-side JavaScript here. |
public/css/main.scss | Main stylesheet for your app. |
public/css/themes/default.scss | Some Bootstrap overrides to make it look prettier. |
views/account/ | Templates for login, password reset, signup, profile. |
views/api/ | Templates for API Examples. |
views/partials/flash.pug | Error, info and success flash notifications. |
views/partials/header.pug | Navbar partial template. |
views/partials/footer.pug | Footer partial template. |
views/layout.pug | Base template. |
views/home.pug | Home page template. |
.dev.env | Your API keys, tokens, passwords and database URI. |
app.js | The main application file. |
package.json | NPM dependencies. |
package-lock.lock | Contains exact versions of NPM dependencies in package.json. |
Package | Description |
---|---|
async | Utility library that provides asynchronous control flow. |
bcrypt-nodejs | Library for hashing and salting user passwords. |
connect-mongo | MongoDB session store for Express. |
dotenv | Loads environment variables from .env file. |
express | Node.js web framework. |
body-parser | Express 4 middleware. |
express-session | Express 4 middleware. |
morgan | Express 4 middleware. |
compression | Express 4 middleware. |
errorhandler | Express 4 middleware. |
serve-favicon | Express 4 middleware offering favicon serving and caching. |
express-flash | Provides flash messages for Express. |
express-status-monitor | Reports real-time server metrics for Express. |
express-validator | Easy form validation for Express. |
pug (jade) | Template engine for Express. |
lusca | CSRF middleware. |
mongoose | MongoDB ODM. |
node-sass-middleware | Sass middleware compiler. |
passport | Simple and elegant authentication library for node.js |
request | Simplified HTTP request library. |
lodash | Handy JavaScript utlities library. |
validator | Used in conjunction with express-validator in controllers/api.js. |
mocha | Test framework. |
chai | BDD/TDD assertion library. |
supertest | HTTP assertion library. |