User authentication with Node.js (reading series part 1): boilerplate

Search for a command to run...

No comments yet. Be the first to comment.
In this series, we will build an entire authentication system using Node.js. Topics: Signup | Sign in | Signout | Sign out from all devices | forgot my password.
In the last post, we cloned the project repository and briefly talked about the project's essential dependencies. This post is part 2 of (User authentication with Node.js series), find part 1 here. In this part, we will cover the following points...
In the last post, we cloned the project repository and briefly talked about the project's essential dependencies. This post is part 2 of (User authentication with Node.js series), find part 1 here. In this part, we will cover the following points...

Search engines are the most commonly used tools by developers when working on solving programming problems. Routine tasks such as running “How to” and “plugin XYZ for...” search queries play a significant part in our daily lives as programmers. Thank...

As web developers, we are often given the task to load assets to websites and applications. Most of the times, unless you are working with a dream team of designers, the assets available are often either too large, or incorrectly formatted. Likely t...

Udemy is by far the most popular learning platform, offering a massive amount of video content from awesome creators. Due to this massive offer, the platform might become overwhelming, especially if you are a beginner with no idea where to begin. ...

User authentication is the core feature of every website and mobile application. Writing authentication the correct and secure way prevents malicious users from accessing sensitive application data.
There are many technologies we can use to enforce secure access to application resources, the most common one is OAuth.
You can read more about OAuth here.
But, for this series, we will build the authentication system from scratch, and make it as simple as possible so it can be further customized and “plugged” with any existing application.
To ensure a smooth and pleasant experience, please make sure before cloning the starter repository to have the following tools installed:
In this section, we will clone the starter project hosted on Github, get familiar with the folder structure, and explore the project dependencies.
git clone https://github.com/2imad/node-js-authentication.git
cd node-js-authentication
npm install
cd client
npm install && cd ..
git checkout boilerplate
|-- node-js-authentication |-- config |-- db |-- mailer |-- middlewares |-- routes |-- .env |-- .gitignore |-- index.js |-- LICENSE |-- package-lock.json |-- package.json |-- README.md |-- client | |-- .gitignore | |-- package-lock.json | |-- package.json | |-- README.md | |-- public | | |-- favicon.ico | | |-- index.html | | |-- logo192.png | | |-- logo512.png | | |-- manifest.json | | |-- robots.txt | |-- src | |-- App.css | |-- App.js | |-- App.test.js | |-- index.css | |-- index.js | |-- logo.svg | |-- reportWebVitals.js | |-- setupTests.js
npm run serverIf you see output like below, it means you are ready to roll :)
[nodemon] 2.0.6 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions: js,mjs,json [nodemon] starting `node index.js` Listening on 8000
Here is the current dependency list as found on package.json. With each list item, you find a link to the package homepage on npm and a brief introduction.
Important note: .dotenv file should always be included in .gitignore before committing the code.
Finally, some additional resources to help you understand the functionality of each dependency we are using in the project, in case you know any other resources, please do let me know!
Article: Hashing in action
NPM: bcrypt
Playground: bcrypt generator.
Article: MDN
Definition: W3C
Article: What is Cors
Homepage: Nodemailer
Full tutorial: Nodemailer
In this first part of the series, we talked about authentication with Node.js, cloned the starter repository, and installed the dependencies. Hopefully, you are as excited as I am to get to the next chapter where we will create a MongoDB database and connect it to our project with mongoose, and finally create the signup route.
The next chapter should appear soon, so stay tuned! or signup for my blog and receive it immediately in your mailbox :)
Cheers!
IYO
Bemoore