A Simple Login Application in Node.js and MongoDB


Node.js, a software platform, built on google chrome runtime. It uses v8, the same run time environment, that google chrome uses. It is one of the best plateform to easily build scalable network applications(especially server-side).

We have created Node.js Login Template with a nice User Interface. If you want to use Node.js as plateform and MongoDB as Database then this demo project can be used as a starting point for your application.

This is a simple application, which has sign up and login facility after successfully registration. We’ll be adding some more features in this application very soon such as birthday reminder functionality.

Screenshot from 2014-03-06 01:35:50

Here are the steps to start with code:-

  • Set Up MongoDB
  • Start mongo: > mongo
  • Set Up Node.js
  • Clone code from https://github.com/knoldus/Node.js_UserLogin_Template.
  • Run npm install
  • Run node app
  • Go to http://localhost:8080/
  • About Ayush Mishra

    Ayush is the Sr. Software Consultant @ Knoldus Software LLP. In his 5 years of experience he has become developer with proven experience in architecting and developing web applications. Ayush has a Masters in Computer Application from U.P. Technical University, Ayush is a strong-willed and self-motivated professional who takes deep care in adhering to quality norms within projects. He is capable of managing challenging projects with remarkable deadline sensitivity without compromising code quality. .
    This entry was posted in Agile, Architecture, Cloud, JavaScript, MongoDB, Node.js, Web and tagged , , . Bookmark the permalink.

    8 Responses to A Simple Login Application in Node.js and MongoDB

    1. srikanth ganta says:

      Reblogged this on Srikanth's Blog.

    2. Sushil says:

      Its very tough to run npm install with the above package.json .. as it needs lots of prerequisites .. can you please execute npm install and provide node_modules directory path.. so that i can use this login module..

    3. chettrisha says:

      Hello ,

      After running npm install i am getting the following error.

      npm ERR! node-proxy@1.0.0 install: `node-gyp configure build`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the node-proxy@1.0.0 install script ‘node-gyp configure build’.
      npm ERR! This is most likely a problem with the node-proxy package,
      npm ERR! not with npm itself.
      npm ERR! Tell the author that this fails on your system:
      npm ERR! node-gyp configure build
      npm ERR! You can get their info via:
      npm ERR! npm owner ls node-proxy
      npm ERR! There is likely additional logging output above.

      npm ERR! Please include the following file with any support request:
      npm ERR! /var/www/nodeProject/Node.js_UserLogin_Template/npm-debug.log

    4. naveen says:

      0 info it worked if it ends with ok
      1 verbose cli [ ‘C:\\Program Files\\nodejs\\node.exe’,
      1 verbose cli ‘C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js’,
      1 verbose cli ‘start’ ]
      2 info using npm@2.15.8
      3 info using node@v4.4.7
      4 verbose stack Error: missing script: start
      4 verbose stack at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:142:19)
      4 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:58:5
      4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:356:5
      4 verbose stack at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:320:45)
      4 verbose stack at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:354:3)
      4 verbose stack at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:124:5)
      4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:243:12
      4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16
      4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
      5 verbose cwd C:\Program Files\MongoDB\Server\3.2\bin
      6 error Windows_NT 10.0.10586
      7 error argv “C:\\Program Files\\nodejs\\node.exe” “C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js” “start”
      8 error node v4.4.7
      9 error npm v2.15.8
      10 error missing script: start
      11 error If you need help, you may report this error at:
      11 error
      12 verbose exit [ 1, true ]

      I am getting an error like this how to fix it???????????????????????

    5. How to create a log in and registration page using mongodb with node.js and android application development? I’ve the UI ready but I don’t understand how to code to populate the database using the User Interface.

      • Kamlesh says:

        Hi, This is very simple and follows the steps
        for windows : download 1. mongoDB 3.2 setup
        2. create directory in c://
        3. data and
        4. inside data directory create db directory
        5. go to bin in mongoDB
        6. and start mongod file means double click to start
        7. successfull to mongoDB installation

        8. you can download GUI tool for mongoDB commincation
        and connect

    6. xeunlil says:

      can you add demo page

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s