Articles and Papers

Streamlining Communication: Sending Webhook Messages from Heroku to Discord

@Medium, read it here
In this article, we delve into the seamless integration of Heroku, a popular cloud platform, with Discord, a widely used communication platform. The focus is on sending webhook messages from Heroku to Discord, enhancing real-time updates and notifications for various applications. The article guides readers through the process, offering a step-by-step approach to set up and configure webhooks, ensuring efficient and automated communication between Heroku-hosted applications and Discord channels. With this integration, users can stay informed, monitor events, and streamline communication effortlessly.
19-01-2024

GitHub Pages with custom DNS

@Medium, read it here
The article introduces GitHub Pages, a static site hosting service on GitHub, highlighting its key features such as static site hosting, Jekyll integration, custom domain support, version control integration, and free hosting. It provides step-by-step instructions on getting started with GitHub Pages, including setting up custom DNS and configuring DNS with Cloudflare. The guide also covers creating CNAME files, adding DNS CNAME records, and configuring GitHub Pages settings in repositories. Overall, it offers a comprehensive overview and practical guidance for utilizing GitHub Pages effectively.
18-01-2024

How to test Github Actions locally?

@Medium, read it here
This article provides a comprehensive guide on testing GitHub Actions workflows locally, utilizing tools like Git, Docker, and Act. By avoiding constant commits, developers can efficiently iterate and refine workflows, enhancing the CI/CD process. Key steps include installing Docker and Act, running workflows locally, and managing GitHub tokens securely. Overall, it empowers developers to streamline testing and optimize their software development lifecycle.
26-12-2023

Authentication in NestJS — PostgreSQL and JWT

@Medium, read it here
This article provides a comprehensive guide on implementing authentication in NestJS using JWT (JSON Web Tokens). It begins with setting up a NestJS project, configuring a PostgreSQL connection, and creating user entities for storing login credentials. The process includes installing necessary dependencies, such as @nestjs/passport, passport-jwt, and bcrypt, for handling authentication and encryption.

The article walks through the creation of endpoints for user login and registration, demonstrating the use of DTOs (Data Transfer Objects) for validating request bodies and bcrypt for hashing passwords. It also covers the implementation of JWT authentication guards to protect routes and ensure that only authenticated users can access certain endpoints.

Additionally, the article explains the JWT Passport Strategy for validating JWT tokens sent to the application, utilizing public and private keys for token verification. It concludes with testing the implemented authentication endpoints using tools like Postman and confirming the successful integration of authentication in the NestJS application.
03-04-2021

How to deploy static pages on Heroku

@Medium, read it here
This article documents the process of deploying a static webpage using Heroku, starting from creating a new project and connecting it to a GitHub repository. Initially, an index.html file is added to the project, and upon pushing the code to the repository, Heroku attempts to build the image but encounters an error due to the lack of a default language. To solve this, we introduce the use of Node.js and creates a package.json file to define the project's dependencies and scripts.
Upon pushing the updated code to the repository, Heroku successfully deploys the webpage. Additionally, the article suggests a bonus feature by using the reload library to automatically reload the webpage upon file changes during development. Finally, it emphasizes the simplicity and intuitive nature of Heroku's interface for integrating various services. The complete source code is provided on GitHub for reference.
30-03-2021

Control Xiaomi Yeelight Bulbs with Python

@Medium, read it here
This article provides a comprehensive guide to utilizing the Yeelight Python library to control Xiaomi Yeelight Bulbs, starting with enabling developer mode on the bulb through the Yeelight app. It then proceeds to create a Python project with a virtual environment and installs necessary dependencies like tabulate and yeelight.
The article covers basic Yeelight library functions such as discovering bulbs, turning them on and off, and adjusting brightness levels. It also introduces a menu-driven approach to interact with the bulbs, allowing users to list bulb properties, list all bulbs, and exit the program. Additionally, the article organizes Yeelight operations into separate modules for better code structure and ease of maintenance. It concludes by highlighting the simplicity of integrating Python code with Yeelight bulbs and invites further development and exploration. The complete source code is available on GitHub for reference.
23-03-2021

NestJS — How to use TypeOrm?

@Medium, read it here
This article serves as a comprehensive guide to integrating TypeORM, a mature ORM for Node.js, with the Nest framework, using PostgreSQL as the reference database. It outlines the steps to deploy the database using Docker, configure environment variables, and establish the database connection in the NestJS application.
Furthermore, it demonstrates entity creation, validation using class-validator, and implementing CRUD operations with services and controllers. The article concludes by highlighting the simplicity of TypeORM integration with NestJS and directs readers to the official documentation for further exploration.
12-12-2020

Build a REST API from scratch using NestJS

@Medium, read it here
This article provides a comprehensive guide to building REST APIs with NestJS, covering key concepts like controllers, services, and modules. It demonstrates integration with MongoDB using Mongoose and emphasizes the use of dependency injection for managing dependencies.
Additionally, it introduces features like DTOs for structured data transfer and custom logger services for efficient debugging. The article highlights the simplicity and intuitiveness of NestJS development, making it accessible for beginners and seasoned developers alike. Overall, it serves as a valuable resource for mastering NestJS and building efficient Node.js applications.
20-09-2020