A Golang Backend Challenge for an Android Developer

In 2016, our graduation project on indoor navigation for shopping malls, developed at Ankara Yıldırım Beyazıt University, was selected as the best project of the university. I thought, “Android is pretty cool, I’ll continue with this,” and from that day until January 2024, I pursued my career as an Android developer. As you know, frontend work is useless without backend — web services and APIs (Application Programming Interface). I won’t go into the details of these; they are well-known topics and I don’t want to make this post too long. 😊
Communication with the backend is always an important step for frontend developers, especially when collaborating with backend developers who haven’t worked with mobile teams before. Despite this, we can’t do without them; even in our tiny personal projects, we look for backend developers. Creating a database, writing, and publishing an API becomes a daunting task.
With the rise of AI in our lives and the disproportionate increase in learning resources, I decided not to be content with just knowing Android. With a job change in January, I took a break from developing native mobile apps with Kotlin and started a new job with a completely different stack of technologies.
Now, I’m a team leader, and we work on web technologies. As my responsibilities increased and our team is small, I want to showcase my problem-solving skills, learn everything, and even tackle functions in the database. We needed to write an API at work. Of course, I jumped at the opportunity, saying, “I’ll handle it.” I had the feelings I mentioned above; I thought, “I need to look into backend development now, it can’t be that hard.” The opportunity had come.

The image is taken from the Golang language Wikipedia page.
I had heard a lot about Golang, and without hesitation, I started developing with the help of AI. Within minutes, the API was ready. I never thought it could be completed so easily and quickly. Writing services, which had seemed like a huge issue in my mind for years, had now become as easy as Android. Of course, I still have great respect for large projects, but for a small project, developing a backend with Golang is much easier and faster.
During the 2024 Ramadan Bayram holiday, I wanted to further develop myself with Golang. I decided to revisit the running app project for our running team, Runarchy, which we had shelved due to not finding a volunteer backend developer. This project had been a sore spot for me since then.
In this software project, we planned to do the following:
· Mobile app
· An admin panel for data entry
· Approximately 25–26 REST API services, mostly CRUD, to be used in both the frontend and the admin panel
First, I started developing services for both the admin panel and the mobile apps. For the login functionality, I got help from Firebase. Within a few hours, my login service was ready and, thanks to the partnership between Golang, Heroku, and Git, it was already published on Heroku. In this process, I detailed how we managed user authentication with a data flow chart that you can see below:

The data flow chart was created by the author on Creately.
How to Implement User Authentication Process at Backend?
The user attempts to log in to our mobile app by entering their email and password.
The app sends a request to Firebase to check the user’s existence and the accuracy of the credentials.
If the user exists and the credentials are correct, Firebase sends an ID token, a temporary identity text of 926 characters, to the app.
Our login service receives this ID token from the app and queries Firebase to see if there is a user associated with this token.
Firebase sends a unique and immutable identity text for the user.
Our service sends this user ID to the client, ensuring that all operations remain specific to the user.
I didn’t see the need to store additional information like users’ email addresses, but for a more comprehensive project, it might be necessary to store additional data such as login time, email address, and device information. The structure of the login service can be shaped according to such needs.
package auth
import (
"context"
"encoding/json"
"fmt"
"net/http"
"runarchy/firebase"
)
type LoginRequest struct {
IDToken string `json:"idToken"`
}
func LoginHandler(w http.ResponseWriter, r *http.Request) {
var lr LoginRequest
err := json.NewDecoder(r.Body).Decode(&lr)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
app := firebase.InitFirebase()
authClient, err := app.Auth(context.Background())
if err != nil {
http.Error(w, "Firebase auth client alınırken hata oluştu", http.StatusInternalServerError)
return
}
token, err := authClient.VerifyIDToken(context.Background(), lr.IDToken)
if err != nil {
http.Error(w, "Token doğrulama başarısız", http.StatusUnauthorized)
return
}
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, "Token başarıyla doğrulandı, Kullanıcı ID: %s", token.UID)
}Golang was indeed as good as they said, even better. We had tried this project 4–5 years ago with a friend who was writing in Ruby on Rails (a web application development framework written in Ruby). The 25–26 services had overwhelmed him, and he abandoned the project midway and didn’t even respond to my messages. The code he wrote in Ruby remained in a dusty corner on GitHub.
I had tinkered with this project written in Ruby, but I couldn’t fully grasp the code structure. However, with the same project written in Go, knowing the purpose and function of each file clearly was a very different and enjoyable experience. Working in a language without boilerplate was a new experience for me. Of course, I won’t go into a detailed comparison with Ruby because I’m not that competent, but feel free to come at me in the comments. 😊
My services were so ready within a day -some with their tests- that when a mobile app user recorded a run, if they added their shoes, the shoe mileage was automatically added to the data in the shoes table. This way, we recorded a crucial piece of data in the running world -the shoe lifespan.
As someone who had spent years in Android, I couldn’t believe it. The code was very simple, clean, readable, and understandable. Despite only dealing with Go for a few days, I could explain every part of my code in detail. I had never been so proficient in any project I had written in Android.

Screenshot taken by author
Dear native developers, as I mentioned in my previous posts, don’t become slaves to technologies, languages, and libraries. See them as tools for producing software because you never know where or what state the technology or language you admire will be in five years…
Even though I liked Golang, Javascript, and Vue.js, I did miss encapsulation, BaseActivity, and Fragment. We’ll get to those in other posts.

Image created by ChatGPT — source and copyright belong to the author.
Stay with love and code…
Frequently Asked Questions
▸Why did an Android developer learn Golang backend development?
The developer recognized that frontend work is useless without backend services and APIs. After years of Android development, they wanted to understand the backend side, especially since collaborating with backend developers unfamiliar with mobile teams can be challenging.
▸What technologies did the Android developer use for the backend?
The developer used Golang to build the backend, implementing REST APIs and Firebase authentication. This was for a real-world running club application.
▸How long had this developer worked as an Android developer before trying Golang?
The developer pursued Android development from around 2016 until January 2024, meaning they had roughly eight years of Android experience before tackling a Golang backend.
▸Why is backend knowledge useful for Android or frontend developers?
Frontend development depends entirely on backend web services and APIs to function. Understanding the backend also helps frontend developers collaborate more effectively with backend teams, especially those with no prior mobile experience.
▸What was the real-world use case for this Golang backend project?
The Golang backend was built for a running club app, giving the developer a practical, real-world scenario to apply their new backend skills rather than just a tutorial exercise.


