DB Transaction | GORM | Repository Pattern

Hello Developers 👋. In this article, I will demonstrate how we can set up Database Transaction for multi-layer controller-service-repository pattern Golang projects.

What is the need for DB Transaction?

Transactions in Database come into a picture when we need to perform multiple DB operations but still treat them as a single unit. A transaction in a database system must maintain Atomicity, Consistency, Isolation, and Durability − commonly known as ACID properties − in order to ensure accuracy, completeness, and data integrity.

Though implementing transactions seems simple, it can be troublesome to set up when the project is…


Standard | Flexible Environment | Solving Cold Start Problem

Hello Developers 👋. In this article, I will demonstrate how easily we can deploy the Next.js Application on Google App Engine within minutes.

2. Preparing a basic Next.js App

Let’s prepare a simple Next.js application to deploy on the google app Engine.

npx create-next-app


Firebase Analytics Setup | Track Page Visited With Screen View Event | Custom Events

Hello Developers 👋. Analytics has been a very essential tool for us. It helps us to get a deeper understanding of our customers. But it was not very straightforward to be used with the Nextjs Application when I tried it. So In this article, I will demonstrate how easily Analytics can be integrated with the Nextjs Application.

Firebase Setup (Part 1 — on Firebase Console)

Let’s start by setting the Firebase project by going to the firebase console.


Using Customized Data Types

Hello Developers 👋. In this article, I will demonstrate how we can make use of UUID and Binary(16) datatype in gorm v2 and golang.

What is UUID?

A UUID is just a 128-bit value and it is usually represented in human-readable format as an UTF8 string composed of 5 groups of hexadecimal charac ters separated by dashes.

Example: cef4c20c-30cf-11eb-9242–9822ef9cf075

Pros of using UUID instead of AUTO_INCREMENT PRIMARY KEY?

  1. They are unique across tables, databases, and servers.
  2. They are hard(er) to guess from URLs.

Cons of using UUID:

  1. Increased Storage i.e. 36 characters and thus performance issues.
  2. It is more difficult to debug.

For more details visit here


Open Graph(OG) meta tags | Server-Side-Rendering(SSR)

Hello Developers 👋. Today I will try to demonstrate how the social media preview works and how I implemented on my recent next.js project. Before going any further on implementation, let's create a simple next.js project.

npx create-next-app

I will name the project as next-social-media


Dockerfile | Docker Compose | MySQL | phpMyAdmin | Hot Reloading

source: https://github.com/monstar-lab/golang-docker-development-env

Before going for the implementation let's first talk about the need for docker briefly.

Common Problem that Every Developer Face


Cloud Function | Firebase Hosting | Static Deployment| getServerSideProps

1. Overview

Deploying static websites like React Applications on the Firebase Platform is very straightforward. But that was not the case with Next.js Projects. This is because Next.js Application requires a server to handle server rendering. So deploying just static HTML is not sufficient. Here in this article, I will demonstrate the deployment of a Next.js project to the firebase platform using cloud Function and Firebase Hosting.

2. Preparing a basic Next.js App

Let's prepare a simple Next.js application to deploy on the Firebase.

yarn create next-app

Here I use yarn to…


React-JSS | Next.js | SSR JSS Implementation

1. Overview

React-JSS is my personal favorite and go-to library for implementing CSS on my React Projects. It is very straightforward to implement it in any React Projects. But that was not the case on Next.js Project. Implementing React-JSS on the Next.js project was not that straightforward and it required some manual work for successful implementation. So In this article, I want to share my experience and the way I implemented it successfully.

2. Intro To React-JSS

JSS is an authoring tool for CSS which allows you to use JavaScript to describe styles in a declarative, conflict-free and reusable…


React | AWS Amplify | Amazon Cognito | Slot Based UI Customization

1. Overview

In this article, we will implement full Authentication Flow in React using AWS Amplify. There are multiple resources online including official docs but they all lack some bits or have some open issues. I went through some difficult times including reading the package source code to understand some logic while implementing it in my project. So I want to share my experience and some hacks I had to use to implement it successfully.

2. Package Selection

There are two Amplify UI Components packages available for React.

Legacy aws-amplify-react

Latest @aws-amplify/ui-react

We will be using the latest package for this article. …


Go Routine | WaitGroups | Mutex | Channel

1. Overview

In this article, we will look at some of the concurrency features of Golang. We will build a simple website status checker application to demonstrate those features. We will start with zero concurrency and eventually add concurrency using the features of Golang and benchmark them.

Intro

We will be building a simple website status checker application. In this application, we will have a collection (slice) of websites and we will be running a loop on this given slice of websites. In each iteration, we will be calling getWebsite function to perform a get request on that given website.

Zero Concurrency

In this first…

Dipesh K.C.

Full Stack Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store