Business

Speeding Up Node & ReactJS Build Times

Speeding up Node or React build times on an EC2 instance involves optimizing your build process, leveraging the instance’s resources efficiently, and potentially tweaking your environment. Below are practical steps to reduce build times:

Continue reading
Standard
Chrome, JavaScript, webdev

Optimize NodeJS Apps in Production on Ubuntu

Why PM2 is Essential for Applications in Production?

When deploying a Node.js application in a production environment, ensuring stability, efficiency, and reliability is crucial. This is where PM2, a powerful process manager for Node.js applications, becomes an invaluable tool. PM2 simplifies process management, enhances performance, and provides robust monitoring capabilities. In this post, we’ll explore why PM2 is essential for running Node.js applications in production.

To ensure a Node.js app keeps running smoothly in production on Linux/Ubuntu, there are many ways to achieve this, but here are some of the essential steps that will help you elevate your application’s performance to the ‘next level’:

  1. Regularly monitor system resource usage to prevent bottlenecks
  2. Implement error handling and logging to quickly diagnose and fix issues as they arise
  3. Utilize process managers like PM2 or Forever to automatically restart your application in case of failures
  4. Ensure that your dependencies are always updated and secure to avoid vulnerabilities
  5. A bonus step: consider employing load balancing and clustering techniques to enhance the app’s scalability and availability. Nginx is great here even if you have one instance.

1. Use a Process Manager (PM2)

PM2 is a popular process manager for Node.js applications that provides automatic restarts, logging, and monitoring.

Install PM2 globally:

npm install -g pm2

Start your application with PM2:

pm2 start app.js --name myNodeJSAppButInProd

Managing different configurations for development, testing, and production environments can be cumbersome. PM2 allows you to define environment-specific variables using an ecosystem file:

module.exports = {
  apps: [{
    name: "my-app",
    script: "app.js",
    env: {
      NODE_ENV: "development",
    },
    env_production: {
      NODE_ENV: "production",
    }
  }]
};

This ensures that your application loads the appropriate settings based on the environment, reducing configuration errors.

Ensure PM2 restarts on reboot:

pm2 startup
pm2 save

Continue reading
Standard
Chrome, JavaScript, webdev

Top Resources to Learn JavaScript and TypeScript Effectively

JavaScript is the backbone of modern web development. TypeScript (TS)—its statically typed super-set — has rapidly gained traction in professional environments.

Whether you’re an aspiring developer or a seasoned programmer, this guide will help you level up your skills. It will assist you in navigating the learning path for JS and TS.

We’ll share various resources and courses to suit different learning styles. We will finish with three exciting project ideas to put your knowledge into practice.

Getting Started with JavaScript

Before diving into TypeScript, it’s crucial to have a solid understanding of JavaScript fundamentals.

Here are some steps and resources to get you started:

Continue reading
Standard
JavaScript, webdev

Why/How Senior Engineers Embrace AI Tools in Development?

How can you do better (or succeed more) with AI coding tools?

Senior engineers who use AI tools (co-pilot, claude.ai, cursor, etc.) are like master chefs who know when to use the microwave and when to actually cook with fire.

Here are some of the bold aspects I’ve noticed in the past year:

Continue reading
Standard
life

Endurance and Insights: My 2024 in Books and Sports

Since 2013, I’ve made it a tradition (2022, 2020, 2019201820172016201520142013) to reflect on the books I’ve read and the sports events I’ve trained for and competed in.

2024 was no exception, offering a mix of endurance and discovery through the pages of captivating stories and on the trails of challenging courses. From thought-provoking novels that broadened my horizons to intense training sessions that pushed my limits, this year added another meaningful chapter to this ongoing journey.

Here’s a look back at the highlights that made 2024.

Continue reading
Standard
webdev

Docker 101: From Development to Production – A Quick Guide

Docker has fundamentally transformed the way developers build, test, and deploy applications by introducing a consistent, lightweight, and portable runtime environment. With its ability to package applications and their dependencies into isolated containers, Docker has eliminated the age-old challenge of “it works on my machine” while enabling seamless deployment across various environments. The part of “It’s working for me” used to be funny or sad depends on the day and the hour…

Whether you’re developing locally, testing in a CI/CD pipeline, or deploying to production, Docker provides the flexibility and scalability to streamline these processes. In this guide, we’ll explore the foundational concepts of Docker, dive into its practical uses, and demonstrate how you can harness its power to simplify workflows and achieve greater efficiency in your development and operations pipelines. Whether you’re a beginner or looking to refine your Docker skills, this walkthrough will equip you with the knowledge you need to use Docker effectively.

Continue reading
Standard
JavaScript, webdev

Cleaner Code: The Importance of Dependency Injection in Software Development

Dependency Injection (DI) is a software design pattern that addresses the problem of managing dependencies between objects in a program. In traditional programming, objects are often tightly coupled, meaning they directly create or reference other objects they depend on.
This can lead to rigid, hard-to-maintain code that is difficult to test or reuse.
Dependency Injection solves this problem by separating the creation and configuration of dependent objects from the objects that use them.
It is a design pattern where a class receives its dependencies from external sources rather than creating them internally. Think of it as “outsourcing,” the creation and management of objects that your class needs to work on.
Instead of directly instantiating or referencing its dependencies, an object receives them through its constructor, methods, or properties.
This decoupling makes the code more flexible, testable, and maintainable.
In large-scale projects, Dependency Injection becomes especially important as the codebase grows in complexity. With many interdependent components, DI helps manage the web of dependencies, making it easier to swap out implementations, replace third-party libraries, and test individual components in isolation.
This improves the overall modularity and scalability of the system.

Continue reading
Standard
webdev

How to Grow as a Full-Stack Engineer: Practical Tips for Young Developers

The brutal truth about leveling up as a full-stack engineer?
Raw coding speed and chasing the latest framework won’t cut it.
While junior developers often fixate on technical skills alone, the engineers who truly accelerate their careers understand a more profound truth: mastery demands rewiring how you think about software development.
Let me share the strategies that separate senior full-stack engineers from the pack – hard-earned lessons that took me years of mistakes to discover.

Continue reading
Standard
Business, webdev

Modern Web Stack Mastery: A Developer’s Guide to TypeScript, Tailwind, Node, and Testing

What do you wish a new full-stack developer to do before their first day to ensure a smooth onboarding experience?

We’d like you to review and strengthen your knowledge in the following key areas. This guide includes recommended resources and specific focus points for each technology.

Continue reading
Standard
Trail running in CA
life, Sport

Endurance and Reflection: Insights from Murakami’s What I Talk About When I Talk About Running Book

“Pain is inevitable. Suffering is optional.”

As a long-distance runner and endurance athlete, reading Haruki Murakami’s “What I Talk About When I Talk About Running” felt like connecting with an older brother’s spirit.
It was the 3rd time for me.
Each time, at a different age (23, 37, and now much older), I experienced a different type of reflection and understanding.

Continue reading
Standard