Javascript map, reduce and filter functions are some of the useful array functions in javascript. These are the higher order functions which takes a callback function as their parameter. Javascript map() function The javascript map() function is an array function which iterates through the array and executes the provided callback on each element. The map function returns an array which…
How to convert a bootstrap template to Angular
In this post, we will learn how to convert any bootstrap template to angular. “Clean Blog” on startbootstrap.com seems to be a good choice as long as we are keen to understand the process of converting a bootstrap template to angular. We can download the template from this link. 1- Setting up Angular app First of all, check if you…
Working with classes in typescript
Working with classes in typescript is essential to write readable and reusable code. In this short article, we will understand classes in typescript in simplest way possible. For the sake of simplicity, we will write all code in one ts file. You only need to have typescript installed globally to compile this ts file. Writing a class in typescript: Let’s…
Running a NodeJS app with Typescript and ExpressJS in Docker Container
In this blog post, I will walk you through the simplest way of setting up a nodejs application with expressjs and typescript to run inside a docker container. Git repository for this post is available here. We will complete the setup by following below steps: Creating a simple NodeJS application with express. Adding typescript support to express app Containerize express…
Simple Login and Registration with ExpressJS, Sequelize, bcrypt and JWT
In this guide, we will see how a NodeJS and MySQL web application can incorporate user registration and login feature. We will use bcrypt to hash the password and JWT for token generation. In this post, we will not create any HTML page or template. Instead, We should consider it as a process to add login and registration functionality in…
Seeding data in MySQL table using Sequelize and faker.js in NodeJS
In this guide, We will learn about seeding data in MySQL table using Sequelize ORM and faker.js. Seeding a table simply means adding fake data in the database for testing and demonstration purposes. In our last post, we did setup Sequelize with NodeJS application and created the table Users. We should start from there and add more columns to the…
How to use Sequelize with Node and Express
If you are willing to use MySQL with your Node App, this guide will show you how to use Sequelize with Node and Express. In my opinion, Sequilize ORM is the best way to use MySQL with Node. Sequelize offers features like Migrations, Seeders and Relationship management. These features are handy when you are in need of a quick working…
How to install Laravel with NGINX on Ubuntu
Laravel is the most popular PHP MVC framework. If you have chosen a VPS or cloud hosting to deploy your laravel website, this post will help you install Laravel with NGINX on Ubuntu. PHP 7.4 Ubuntu 20.04 Laravel 8.x PHP and PHP-FPM PHP-FPM is an advance level FastCGI process manager. More information on PHP-FPM is here. To install laravel with…
How to use Redis as Cache for MongoDB queries in NodeJS
Using Redis as a cache for MongoDB queries in NodeJS can make your application super fast. The reason for faster access is due to the fact that Redis stores data in memory while MongoDB stores data in disk. Where Caching is useful ? Caching is useful in all scenarios where we need to access the same data frequently. In an…
How to build REST API with Django REST Framework
Django is a complete web application framework written in Python. We can use it to build any kind of web application. Building REST API with Django REST Framework is required for almost all Django based web applications. REST based APIs are now a standard way to communicate between two isolated systems. The trend has shifted towards frontend Javascript frameworks and…