Posts

Big O Notation: The Art of Writing Efficient Algorithms

Image
When you’re building software—whether it’s a small utility or a full-scale application— performance  plays a critical role. Efficient algorithms are the backbone of scalable systems, and understanding how they behave as the input size grows is essential. This is where  Big O Notation  comes in. Big O is a mathematical notation that describes the  worst-case growth rate  of an algorithm in terms of time or space. It doesn’t measure exact speed but rather gives an upper bound on how an algorithm scales. Understanding it helps you compare solutions and make better design decisions. Below is a breakdown of the most common time complexities, explained with simple examples and real-world use cases. O(1) – Constant Time An operation that takes the same amount of time regardless of the input size. Example:  Accessing an array element by index: const item = arr[5]; Use Cases: Hash table lookups Boolean checks Retrieving values from dictionaries O(n) – Linear Time Th...

Poetry docker

# Stage 1: Build Environment FROM python : 3.12-slim AS python-base LABEL version= "1.0" LABEL description= "Poetry module application with Poetry" # python ENV PYTHONUNBUFFERED = 1 \     # prevents python creating .pyc files     PYTHONDONTWRITEBYTECODE = 1 \     \     # pip     PIP_NO_CACHE_DIR = off \     PIP_DISABLE_PIP_VERSION_CHECK = on \     PIP_DEFAULT_TIMEOUT = 100 \     \     # poetry     # https://python-poetry.org/docs/configuration/#using-environment-variables     POETRY_VERSION = 2.1.2 \     # make poetry install to this location     POETRY_HOME = "/opt/poetry" \     # make poetry create the virtual environment in the project's root     # it gets named `.venv`     POETRY_VIRTUALENVS_IN_PROJECT = true \     # do not ask any interactive question     POETRY_NO_INTERACTION = 1 \ ...

Building a RESTful Blog API with Express 5, Sequelize, and SQLite

Image
Express  is the leading web framework for Node.js, known for its minimalist design and powerful capabilities. It provides a flexible foundation for building everything from lightweight microservices to complex, multi-route applications. With its middleware-driven architecture and intuitive API, Express is especially effective for developing high-performance, maintainable APIs. In this guide, you’ll learn how to build a complete blog API using Express 5, Sequelize ORM, and SQLite. We’ll cover routing, data validation, database integration, and error handling—showcasing how the Express ecosystem handles each aspect of API development. Prerequisites Before getting started, ensure you have: Node.js installed on your system (preferably the latest LTS version, Node.js 22.x or higher) A basic understanding of JavaScript, Node.js, and web development concepts Step 1 — Setting up the Express project To begin, you’ll scaffold your project structure to keep your Node.js application organized,...