Image for post
Image for post
Image by Pete Linforth from Pixabay

Welcome! In this article, we will be developing a secure and lightweight REST API using Node.js, Express server, and MongoDB from scratch that can be used as a backend for authentication systems. This is completely a beginner-friendly article.

As a bonus, I have explained how to create a simple referral system, using which you can share the referral code, and your friends can signup using that code. The concepts we will see throughout this article are completely generic, and it can be implemented using any programming language.

Agenda ✍️:

  1. User Login.
  2. Forgot password and reset password.
  3. Session…

Extract user’s location, timezone and much more.

Image for post
Image for post
Photo by Wendy van Zyl from Pexels

In this demo, we will be building a microservice to extract details from the user IP address using Node.js and Express. There may be situations when we need to get some information about the users of our application to provide them a better user experience, like delivering location-based content and so on.

Without wasting much time, let’s get our hands dirty!

Implementing the service ✨

First, let us initialize our project by running the npm init -y command.

Now, we need to install the dependencies.

npm install express geoip-lite --save

Express module will be used for handling http requests from the client.

Geoip-lite will…

Don’t move to production if you are not ready!

Image for post
Image for post
Photo by Startup Stock Photos from Pexels

Hello all 🖐 In this article, I’d like to share with you some of the important and basic configurations which must be applied before deploying your web application to production. Following only these rules alone is not sufficient, because there are many more things that you must take into account before making your application live. I have created a curated list of things that may help up to some extent. I’ll also share with you more configuration tips and techniques in my upcoming posts as we cannot everything in this single article.

Some code snippets used in this article will…

A plug-and-play starter template that can help you to kick start your web application API development.

Image for post
Image for post
Image by WikiImages from Pixabay

In this article, we will be building a basic starter template (or boilerplate)which can be used for building robust and secure REST APIs using Node, Express, and Mongoose. It can be used for any kind of projects regardless of logic and requirements.

You may ask that there are many starter templates and why I am reinventing the wheel. …

By building a Referral System using Node.js, MongoDB and Express

Image for post
Image for post
Photo by Jefferson Santos on Unsplash

Welcome! In this article we will be learning how to manage user sessions using JSON Web Tokens (JWT). At the end we will also build a simple referral system to demonstrate the workflow with JWT.

If you already have a user authentication system, you can refer to this article to integrate JSON web tokens securely in your existing project.

Without wasting more time on the introduction let us get started.

This post is the continuation(Part II) of my previous article, in which I have shown the implementation of user signup with email verification, forgot password and reset password features. …

Pranesh A S

Backend Engineer and Blockchain Developer. Keep learning | Spread Knowledge

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store