Code Monkey home page Code Monkey logo

nodejs-mongodb-user-registration's Introduction

nodejs-mongodb-user-registration

Programmer Blog: http://programmerblog.net

  • Source code for article on how to create a user registration form using nodejs and mongodb

  • You can read detailed tutorial on our blog: https://programmerblog.net/nodejs-user-registration-tutorial/

  • Install MongoDB First you need to install MongoDB on your system, Please visit MonogoDB site and download it.

  • Create a MongoDB database After MongoDB installation. Create a data/db directory - In windows c:/data/db

  • On command prompt, open MongoDB -> bin folder and run

    mongod

  • Open another command prompt and open bin folder and type

    mongo

  • Mongo shell is running, type

    use dbusers

  • Current databse will be changed to to db users.

  • install NodeJS Please visit NodeJS site and download installer, Install on your system, It also install NPM or Node Package Manager

  • Generate NodeJs, Express application Using Explress comman line tool to generate an application skeleton.

    express --view=pug nodejs-user-registration-mongodb

  • install required dependencies

    cd nodejs-user-registration-mongodb && npm install

  • Create a Model using mongoose A User Schema is created in a Models folder using Mongoose

  • Create a Form in Pug template engine Next a bootstrap based form is created so users can enter their information into the form and send it to server.

  • Create a Ajax JavaScript code to send data to server and receive response and display to user Using jQuery, An AJAX request is sent to server with data, Data is recevied in /Register Express route.

  • Create a Register route to receive, validate and save data to MongoDB database A register route is created, Ths route recevies posted data, validates and save it in mongoDB database.

  • To run the app:

    SET DEBUG=nodejs-user-registration-mongodb:* & npm start

  • To view runnign app Open browser and type the URL: http://localhost:3000

For detailed tutorial, visit

http://programmerblog.net/nodejs-user-registration-tutorial/

nodejs-mongodb-user-registration's People

Contributors

programmer-blog avatar

Watchers

James Cloos avatar  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.