Idempotency in Your API

Introduction Idempotency is a crucial property in the world of APIs, ensuring that operations can be applied multiple times without changing the result. In this post, we’ll explore six effective strategies to achieve idempotency in your API, drawing inspiration from real-world examples and distributed systems principles. Idempotency Explained The light switch analogy is often used to explain idempotence. Consider a light switch in a room. The operation of turning the light switch on or off is idempotent....

November 11, 2023 Â· 4 min Â· Denis Nutiu

Tracing Node.js APIs with OpenTelemetry

Hello everyone 👋, In this article, we’ll instrument a simple Node.js API with OpenTelemetry traces. OpenTelemetry is the new standard for distributed tracing and metrics. Trace data is used to monitor and troubleshoot complex distributed systems. At the end of this article, we’ll have a Node.js API that is instrumented with OpenTelemetry and we’ll be able to see the traces in Grafana Tempo: The API Let’s start by setting up our NodeJS project by installing the dependencies:...

August 7, 2023 Â· 7 min Â· Denis Nutiu

From Wordpress To Hugo

Introduction Hello everyone 👋, This is a quick post on how I migrated my blog from WordPress to Hugo. I will not go into details on how to install Hugo or how to use it, but I will share some of the things I learned along the way. I’ve also written a simple tool in Python to aid you in the migration process. You can find it here: https://dnutiu.github.io/jekyll-to-hugo/ Why not WordPress?...

June 5, 2023 Â· 3 min Â· Denis Nutiu

FastAPI Uvicorn logging in Production

Hello 🙋‍♂️, Running a ⏩FastAPI ⏩ application in production is very easy and fast, but along the way some Uvicorn logs are lost. In this article I will discuss how to write a custom UvicornWorker and to centralize your logging configuration into a single file. To keep things as simple as possible I’ve put all my code in a single Python file. main.py import uvicorn as uvicorn from fastapi import FastAPI, APIRouter router = APIRouter(prefix="") def create_app(): fast_app = FastAPI() fast_app....

May 18, 2021 Â· 3 min Â· Denis NuČ›iu

Kafka Connect GitHub source connector

Hello! In this article we will discuss how to quickly get started with Kafka and Kafka Connect to grab all the commits from a Github repository. This is a practical tutorial which saves you some time browsing the Kafka’s documentation. Environment Kafka is bit difficult to setup, you will need Kafka, Zookeper and Kafka Connect at least. To simplify the setup we’re going to use Docker and docker-compose. Once you have Docker and docker-compose installed on your system, you can run a single command and get a Kafka environment for developing....

July 29, 2020 Â· 5 min Â· Denis NuČ›iu

Firebase REST Authentication

Hello, In this article I will show you how to authenticate to Firebase and secure the databases with some simple security rules. I’m using this setup for my NucuCar project. Authentication The first step is to enable the Email/Password sign in method, by going to the Authentication and clicking the Sign-In Method tab: Next, we can add a manual user by clicking Users tab and Add user. Now, to login with our newly created user, we make a POST request with a json body to the following endpoint:...

March 14, 2020 Â· 2 min Â· Denis NuČ›iu

Simple Dark Theme Switch with Vue.JS

Hello, In this post I’m going to show you how quickly you can add a dark theme switch to your Vue.JS application. We’re going to start with a blank application. And then we’re going to create a dark-theme CSS file which we’re going to save in public/css/darktheme.css. This is how the application looks without any CSS. Now, we’re going to put the following code in darktheme.css: body { background-color: #2c3e50; } h1,h2,h3,h4,h5,h6,p { color: #42b983; } We can test our theme by appending the following line in the of public/index....

December 7, 2019 Â· 1 min Â· Denis NuČ›iu

Adding PostgreSQL support to your ASP.Net Core application via Docker

I’ve been playing recently with ASP.Net Core and I’m developing a small Web API project in order to teach myself the framework. In still article I’ll explain how to use a Postgres database with Docker, in order to make your development experience much more enjoyable. Before moving on, please make sure that you’ve installed: Docker Docker-Compose First, create the docker-compose.yml file in your root directory of the project, the file should contain:...

May 11, 2019 Â· 2 min Â· Denis NuČ›iu

My Spring Boot notes

Lately I’ve been busy with university, work and learning something new. I’ve started my programming journey when I was in high school with Python, I didn’t have any informatics classes so I had to study on my own. I confess that I didn’t really understood how Python works, until I’ve tried Java. Python had a dynamic type system and it was very confusing for a newbie like me. After finishing Introduction to Computing with Java course from HKUST on edX I started to get a better grasp on programming....

October 7, 2018 Â· 2 min Â· Denis NuČ›iu

Static websites with Angular, lazy mode.

I had to do a project for a friend and because Hugo is a nice tool yet a bit uncomfortable to use, I decided to use Angular. After finishing the website’s routes, css and images I have the project to my friend and he had a bit of a trouble deploying it on his Apache server. His host wouldn’t allow .htaccess. Q.Q The solution? Rename index.html to contact.html, team.html, project.html, objectives....

September 11, 2018 Â· 1 min Â· Denis NuČ›iu