Setting Up a Next.js Project Structure: A Guide

Next.js provides a robust set of built-in features that are crucial for developing web applications using React. With Next.js, we get a predefined structure for our project files, making it easier to organize our codebase efficiently. First and foremost, all visible pages are stored under the /pages folder. Any API routes we create belong in the /pages/api folder. Additionally, any publicly visible files should be placed in the /public folder....

Setting up an Nginx Reverse Proxy for Serving Multiple Node.js Apps from Subfolders

If you’re running multiple Node.js scripts under the same domain on a VPS like DigitalOcean, you’ll need to use a reverse proxy since two Node.js apps can’t listen on the same port. Nginx is a popular choice for setting up a reverse proxy. To begin, you’ll need to edit the Nginx configuration file: sudo nano /etc/nginx/sites-available/default The default configuration file looks like this: server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index....

Setting Up Git and GitHub: A Step-by-Step Tutorial

Git is a powerful tool that allows developers to track and manage their code changes over time. It enables collaboration within a team and provides a detailed history of each change made to a project. In this tutorial, we will guide you through the process of setting up Git and GitHub from scratch. Installing Git and GitHub Desktop Before getting started, you’ll need to install Git on your computer. The easiest way to do this is by installing the GitHub Desktop application, which includes both Git and a user-friendly graphical interface....

Setting up Git SSH keys for secure authentication

When working with Git using the command line, the most common and secure way to handle authentication is through the use of SSH keys. This guide will walk you through the process of setting up SSH keys for Git. SSH keys on your computer SSH keys are stored in the ~/.ssh folder on your computer. You can store multiple keys in this folder, as SSH keys are used for purposes other than just Git....

Setting Up VS Code for React Development

In this blog post, we will discuss the simple steps to set up a nice VS Code development environment for React, including linting hints and automatic formatting on save. ESLint The first step is to install ESLint, a powerful tool that helps keep your code clean and maintainable. You can install ESLint using the ESLint extension available on the VS Code Extensions Store. Additionally, run the following Yarn commands in the terminal (if you don’t have Yarn installed, refer to my tutorial for a quick guide):...

Sharing Docker Images on Docker Hub

Docker Hub is the official hosting service for public and private Docker Images. It provides a convenient way to share your Docker images with others. In this blog post, we will walk through the process of sharing a Docker image on Docker Hub. Before we begin, you will need to register on Docker Hub. The basic plan is free and includes unlimited public repositories and one private repository. If you require more private repositories, there are paid plans available....

Shell Command for Monitoring File Content in Real-Time

In this blog post, we will explore the tail command, a highly useful tool in the UNIX command line. This command is available on most Unix-like systems, including macOS and Linux. According to the tail command’s man page, it allows us to display the last part of a file. Here is an example screenshot of the man page for reference. One common usage of the tail command is to display a specific number of lines from the end of a file using the -n option....

Should I include comments in my code?

Opinions on commenting code can vary widely, often leaving beginners unsure of how many comments to add and what to write in them. However, in my experience, it is important to include comments, but only as sparingly as possible to explain your decision-making process. Ideally, your code should be self-explanatory. High-level languages like JavaScript and Python are designed to be readable, with variables and methods being named in a way that resembles plain English....

Should I Specialize or Be a Generalist in the Tech Industry?

When it comes to choosing a career path in the tech industry, many professionals find themselves faced with a common dilemma: should they specialize in a specific area or be a generalist with a broad range of skills? Let’s explore the pros and cons of each approach. Specialization, as the name suggests, involves dedicating the majority of your time and energy to mastering a specific field or skill set. This means focusing around 80% of your efforts on becoming an expert in one particular area, while leaving little room for expanding your knowledge beyond that niche....

Should You Commit the node_modules Folder to Git?

That’s a question many developers ask themselves. There are pros and cons to consider when deciding whether or not to commit the node_modules folder to Git. In this article, I will discuss the topic in detail so that you can form your own opinion based on your specific needs and circumstances. Should You Commit the node_modules Folder to Git? Before delving into the pros and cons, it’s important to note that the same considerations apply to any version control system, not just Git....