Connect to Mongodb Atlas Using Mongoose

I’m a big fan of MongoDB. One of these days, I had to deploy a MERN stack app to a shared server. It’s hard to find NoSQL database support in these shared environments. MongoDB Atlas seems like a good option in such situations. But there’s a problem. The connect options don’t list mongoose. When you select Node, it shows the MongoDB NodeJS Driver URI. What about our beloved Mongoose? We’ll just simply choose version 2....

September 29, 2022 · 1 min

Just did my first professional TypeScript project

After 4-5 years with JavaScript (and loving it), I finally decided to give TypeScript a chance. Just coded a contract-based project with it. Both backend and frontend (react) were programmed in TypeScript. I should say that I have used typescript before on smaller one-to-three file size projects. It was mostly stuff like linear equation systems, matrix operations, basic sorting algorithms, etc. It makes you write better, quality code, and saves time....

December 26, 2021 · 1 min

How to pass socket.io to express routes in files?

Socket.io is a popular library used to enable live (real-time) communication across server and client(s). It uses events to receive to transmit data. We’ll be discussing how to use it with Express route files. We’ll be dealing with the new 3.x version of the socket.io, which is a bit different. You can have a look at this migration guide from 2.x to 3.0. Basically, we create a simple middleware: const { createServer } = require("http"); // you can use https as well const express = require("express"); const socketIo = require("socket....

February 13, 2021 · 2 min

MERN Stack vs Laravel - From a Developer's perspective

I’ve personally used both Laravel and MERN stack, and still have ongoing projects with both. There are many things to consider before choosing a stack to work with. For me, it boils down to the following 2 things. Do I need SEO for this project? If yes then Laravel is more favorable over MERN stack. Do I need WebSockets for some “live” functionality? then Node’s the obvious winner. Now don’t get me wrong, Laravel can do live stuff (called broadcasting) and MERN stack can be optimized for search engines, but is it recommended?...

February 15, 2020 · 6 min

Deploying Headless Puppeteer - Things to Take Care Of

Do you love Web Automation? Well, if you do, you must be familiar with Puppeteer. My encounter with Puppeteer So recently I got a project which required data from social media giants like Facebook, Instagram, LinkedIn, Twitter, TikTok, and many more. Now some of these were easy to scrape, but some like Facebook and Linkedin were relatively harder, Linkedin especially. For Facebook, I only needed to scroll to the bottom, load more posts and grab the data....

February 15, 2020 · 2 min

How to Setup Https on Express Server Using Letsencrypt

Not having SSL these days just won’t do. After deploying my personal website, I couldn’t help but notice that Chrome and Safari were showing ’not secure’ in the address bar. Setting up SSL is quite easy on cPanels and many hosting providers provide free SSL options. It’s really just a couple of clicks and some wait time before you are ready to go. But, since we are working with Node and Express, things will be done differently....

January 23, 2020 · 3 min