Coder Social home page Coder Social logo

drago507 / node-express-mongo-login-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simondiep/node-express-mongo-login-starter

0.0 2.0 0.0 214 KB

A starter log-in application for Node.js using Express web framework and MongoDB.

License: MIT License

JavaScript 63.33% CSS 0.17% HTML 36.50%

node-express-mongo-login-starter's Introduction

Node-Express-Mongo-Login-Starter

Build Status Dependency Status

A starter log-in application for Node.js using Express web framework and MongoDB.
Live Demo Here

Getting Started

Install MongoDB

Install Node.js

git clone https://github.com/simondiep/node-express-mongo-login-starter.git

cd node-express-mongo-login-starter

npm install

node app

Open your web browser to localhost:3000

Additional Tips

When developing, I highly recommend nodemon. It monitors a running app and restarts the app if any files have changed. This has saved me a lot of time from manually restarting Node to see a new change. npm install -g nodemon

npm scripts have been set up to run the app as well as tests, inside package.json

To start the app: npm start

To run tests: npm test

What happens behind the scenes with MongoDB

When a user visits the site, a new session document is created in MongoDB, with the passport field empty.

When the user creates a new account, a new user document is created in MongoDB.

When the user logs into the site, the existing session is updated by adding the user's ID into the session document. The passport field is used.

When the user logs out of the site, the user's ID is removed from the session document's passport field.

Why each NPM Package is included

Express Package Description
body-parser Simplifies incoming request data
express Node.js web framework
express-flash Notification messages
express-session Session Management
express-validator Simple form validation
morgan HTTP Request logging
General Package Description
bcrypt-nodejs Password hashing and salting
jade HTML template engine
mongoose MongoDB object modeling
passport Simple authentication library
passport-local Username/Password sign-in plugin for passport
Testing Package Description
chai Assertion library used by Mocha
mocha Test framework
supertest HTTP assertion library

node-express-mongo-login-starter's People

Contributors

simondiep avatar

Watchers

James Cloos avatar Drago avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.