<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pulak Kanti Bhowmick on Medium]]></title>
        <description><![CDATA[Stories by Pulak Kanti Bhowmick on Medium]]></description>
        <link>https://medium.com/@pkbhowmick007?source=rss-ddd3a56a4ac9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ltN2VezFRL-5hXeEFNaAQQ.png</url>
            <title>Stories by Pulak Kanti Bhowmick on Medium</title>
            <link>https://medium.com/@pkbhowmick007?source=rss-ddd3a56a4ac9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 21:27:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pkbhowmick007/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How ArgoCD implements sharding for it’s Application Controller]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@pkbhowmick007/how-argocd-implements-sharding-for-its-application-controller-99fc30aa4717?source=rss-ddd3a56a4ac9------2"><img src="https://cdn-images-1.medium.com/max/1024/1*_mUEYSyOXTevI-2y2hSoDw.png" width="1024"></a></p><p class="medium-feed-snippet">ArgoCD is a popular GitOps tools nowadays for Kubernetes. It has mainly 3 components Application Controller, Repo server, API server. At&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@pkbhowmick007/how-argocd-implements-sharding-for-its-application-controller-99fc30aa4717?source=rss-ddd3a56a4ac9------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@pkbhowmick007/how-argocd-implements-sharding-for-its-application-controller-99fc30aa4717?source=rss-ddd3a56a4ac9------2</link>
            <guid isPermaLink="false">https://medium.com/p/99fc30aa4717</guid>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[cncf]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[argo-cd]]></category>
            <dc:creator><![CDATA[Pulak Kanti Bhowmick]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 16:06:56 GMT</pubDate>
            <atom:updated>2026-02-01T16:06:56.136Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[User Registration and Login Template using Golang, MongoDB and JWT]]></title>
            <link>https://medium.com/@pkbhowmick007/user-registration-and-login-template-using-golang-mongodb-and-jwt-d85f09f1295e?source=rss-ddd3a56a4ac9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d85f09f1295e</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[login]]></category>
            <category><![CDATA[registration]]></category>
            <category><![CDATA[golang-tutorial]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Pulak Kanti Bhowmick]]></dc:creator>
            <pubDate>Tue, 28 Jul 2020 19:36:16 GMT</pubDate>
            <atom:updated>2020-07-30T07:20:20.182Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XjLwKES-iJ31O8wfaGL9gA.jpeg" /><figcaption>(credit: <a href="https://unsplash.com/photos/lmFJOx7hPc4"><strong>unsplash.com</strong></a>)</figcaption></figure><p>Registration and Login are the vital parts of a web application. Here I have built a registration and login template code in Golang. For storing data, I have used the MongoDB NoSQL database. For routing in Golang, I have used the gorilla mux router and any further API call after login will be secured with JWT.</p><pre>type User struct{<br>    FirstName string `json:&quot;firstname&quot; bson:&quot;firstname&quot;` <br>    LastName string `json:&quot;lastname&quot; bson:&quot;lastname&quot;` <br>    Email string `json:&quot;email&quot; bson:&quot;email&quot;` <br>    Password string `json:&quot;password&quot; bson:&quot;password&quot;`<br>}</pre><p>Here is a pretty simple User struct which contains First Name, Last Name, Email and Password. All are in string data type, ‘json’ is used for data parsing for server to client and vice versa and ‘bson’ is used for storing data in MongoDB.</p><pre>func userSignup(response http.ResponseWriter, request *http.Request{                       <br>    response.Header().Set(&quot;Content-Type&quot;,&quot;application/json&quot;)             <br>    var user User json.NewDecoder(request.Body).Decode(&amp;user)  <br>    user.Password = getHash([]byte(user.Password)) <br>    collection := client.Database(&quot;GODB&quot;).Collection(&quot;user&quot;) <br>    ctx,_ := context.WithTimeout(context.Background(),      <br>             10*time.Second) <br>    result,err := collection.InsertOne(ctx,user)<br>    if err!=nil{     <br>        response.WriteHeader(http.StatusInternalServerError)    <br>        response.Write([]byte(`{&quot;message&quot;:&quot;`+err.Error()+`&quot;}`))    <br>        return<br>    }    <br>    json.NewEncoder(response).Encode(result)<br>}</pre><p>Above userSignup function is doing the user registration part. Here response body’s json data coming from client browser is decoded in a User struct. Password is hashed before storing in Database with below code snippet. For password hasing I have used bcrypt.</p><pre>func getHash(pwd []byte) string {        <br>    hash, err := bcrypt.GenerateFromPassword(pwd, bcrypt.MinCost)          <br>    if err != nil {<br>       log.Println(err)<br>    }<br>    return string(hash)<br>}</pre><p>Then data is stored in MongoDB database with InsertOne function. Data is stored in ‘GODB’ database in ‘user’ collection. Database and collection name can be served from configuration file. Then the result(Inserted data Object Id) is encoded into json and serverd in response as a sign of successful registration.</p><pre>func userLogin(response http.ResponseWriter, request *http.Request){   <br>    response.Header().Set(&quot;Content-Type&quot;,&quot;application/json&quot;)  <br>    var user User <br>    var dbUser User  <br>    json.NewDecoder(request.Body).Decode(&amp;user)  <br>    collection:= client.Database(&quot;GODB&quot;).Collection(&quot;user&quot;)  <br>    ctx,_ :=context.WithTimeout(context.Background(),10*time.Second)        err:=collection.FindOne(ctx,bson.M{&quot;email&quot;:user.Email}).Decode(&amp;dbUser)<br>    if err!=nil{      <br>       response.WriteHeader(http.StatusInternalServerError)     <br>       response.Write([]byte(`{&quot;message&quot;:&quot;`+err.Error()+`&quot;}`))    <br>       return<br>    }<br>    userPass:= []byte(user.Password)<br>    dbPass:= []byte(dbUser.Password)<br>    passErr:= bcrypt.CompareHashAndPassword(dbPass, userPass)<br>    if passErr != nil{<br>       log.Println(passErr)    <br>       response.Write([]byte(`{&quot;response&quot;:&quot;Wrong Password!&quot;}`))    <br>       return<br>    }<br>    jwtToken, err := GenerateJWT()<br>    if err != nil{   <br>    response.WriteHeader(http.StatusInternalServerError)  <br>    response.Write([]byte(`{&quot;message&quot;:&quot;`+err.Error()+`&quot;}`))<br>    return<br>    }<br>    response.Write([]byte(`{&quot;token&quot;:&quot;`+jwtToken+`&quot;}`))<br>}</pre><p>In above userLogin function, firstly I have decoded user data(Email and Password) that is coming from client into an User struct. Then I have gone through the database to decide that current user exists in the Database or not by Email. If email is matched with any data then I compared the user given password and password stored in database. If password is matched then a jwt token is sent in response as a sign of successful login.</p><p>Here is the full code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b0ec66384ed095d2858e0badf172d66/href">https://medium.com/media/8b0ec66384ed095d2858e0badf172d66/href</a></iframe><p>References:</p><ol><li><a href="https://github.com/gorilla/mux">https://github.com/gorilla/mux</a> (Gorilla Mux Router)</li><li><a href="https://godoc.org/go.mongodb.org/mongo-driver">https://godoc.org/go.mongodb.org/mongo-driver</a> (MongoDB driver for Golang)</li><li><a href="https://godoc.org/golang.org/x/crypto/bcrypt">https://godoc.org/golang.org/x/crypto/bcrypt</a> (bctypt for password hashing)</li><li><a href="https://github.com/dgrijalva/jwt-go">https://github.com/dgrijalva/jwt-go</a> (JWT for Golang)</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d85f09f1295e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>