Don’t throw darts in the dark

Han Xingjian
SCTD, GovTech
Published in
6 min readMar 14, 2023

Introduction

During the Summer (May to August) of 2022, I was given the opportunity to intern for GovTech’s Sensors & Internet of Things division (now Smart City Tech Division, SCTD), under the SmartGym team. It was an enriching experience as I got to work on many different aspects of the project, such as web applications, mobile applications, backend services and data analytics.

The wide range of opportunities to learn and explore different fields prompted me to extend the internship beyond the initial 4 months, until November 2022, as I felt that there was still so much more I could learn and contribute to the project.

Motivations

My motivation for joining this internship was to be able to learn and utilise new software frameworks and tools such as Flutter, Redis, Keycloak etc. I also wanted to learn industry best practices to improve my skills as a software engineer. Lastly, I wanted to experience what it is like to work as an engineer in a structured team, experiencing the day-to-day operations and deployment of solutions to be used by end-users, gathering feedback, and improving the product.

What I did

1. Leaderboard (Flutter/Dart)

One of my projects was to implement a new feature for the leaderboard which is shown in the different gyms. My first task was to turn the initial 3 by 7 Leaderboard into a 3 by 21 Carousel Leaderboard.

Leaderboard Before
Leaderboard After

Having no prior experience with Flutter, this was a challenge, and I had a lot to pick up before being able to implement this feature. The fact that I had submit a pull request for the feature within 2 days of joining did not help with my stress levels, but I guess this is what makes software engineering exciting!

After the implementation of this feature, I continued to work on the application throughout my internship as there are many improvements that can be made, such as:

1. Logic checks to display a message when the leaderboard is cleared every month instead of an empty screen

2. Optimising the repainting logic of the board, scoping it down to only the parts which are moving to increase the FPS

3. Refactoring the code base, extracting the widgets out from the initial single project file for better maintainability

4. Maintaining packages and keeping the project up to date

5. Allowing active leaderboards to be dynamic by querying them via our backend services, instead of hardcoding values and redeploying the project

Empty Leaderboard
Application Layout

2. Console (Flutter/Dart)

Throughout the internship, I also worked on the gym consoles which the users would interact with, implementing new features such as a radiating shadow to bring the user’s attention to a particular widget, fixing bugs and making cosmetic changes by aligning drop down boxes and maintaining packages to keep the project up to date.

Radiating Shadow

3. Web Application (React/Typescript, KeyCloak, Kong)

The web application was initially created for the Gym Champions (gym staff members) to ban, unban, and rename users from the leaderboard. However, I felt that more could be done with this application and thus, I implemented a feature allowing it to dynamically configure leaderboards to be displayed in the gyms. This enabled us to make changes to the leaderboard such as the board name, location, duration, and icons, without having to redeploy the leaderboard. This feature was also done to support a campaign (Fastest 5km) which I was working on with Kelvin, requiring us to configure the leaderboard to group the participants based on their age and genders.

React web application

Keycloak and Kong were integrated into the application to help with authentication and authorisation and lastly, an analytics page was created for the application allowing us to view the demographics and results of participants throughout the campaigns and leaderboards.

Analytics page

4. Backend (Python, Swagger, MongoDB, Redis)

To support some of the above feature implementations, new APIs had to be created. This was done using Python, with our datastores being MongoDB and Redis. Working with MongoDB and Redis was exciting as I had never worked with these 2 popular software platforms before. Thanks to the help of the team and in-depth documentation, I was able to adapt and build the routes as needed. Documentation of the new routes also had to be added, and this was done by updating Swagger’s YAML file which at the same time allows for developers to test the newly created endpoints.

5. NSFit Analytics (Python, Plotly)

Throughout the internship, I also helped with the NS FIT program where NSMen came to the gym to clear their NS FIT training using our product. Throughout their 10-week training cycle, we collected various data points, for example, BMI, muscle percentage, chest press weight etc. I was tasked with the analysis of the health metrics data which was done by writing a script to extract and visualise the various metrics (muscle percentage, fat percentage etc.) that was collected throughout the 10-weeks using Plotly.

NSFit Analytics

What I’ve learnt

1. Best Practices

Working on a project is more than just getting things to work. We must also think about the maintainability of the code which means that the naming conventions and comments need to be written well so that the next person (which may be yourself in the future) can easily take over your work.

2. Self-Learning

No matter how much you think you already know, there will always be more to learn as new things are coming out each day and it is impossible to know everything. However, I think the important thing is for one to take the initiative and responsibility to learn things by themselves, because what is relevant now might not be relevant in the next project you do, thus the drive to self-learn is important.

3. Debugging

Jumping into another person’s codebase, especially in a large project, is much more difficult than starting your own project. This is because you are required to code trace and understand the thought process and folder management of the other developer which might not be aligned with your own. Having gone through this process for a few projects, I feel that it has trained me to code trace better and has allowed me to debug more effectively when it comes to my own code as well.

4. Communication

When working in a team, communication is extremely important and effective meetings can allow the team to be aligned. I enjoyed the fact that I was treated no differently from the other GovTechies even though I was just an intern. The flat hierarchy allowed me to speak my mind, both to clarify confusion and give input. With effective communication, even when your idea is “wrong” and you are corrected, you do not feel demotivated, but instead, motivated to correct your mistakes and improve. I believe that this culture has helped me grow as a person and as an engineer during my time as an intern.

Conclusion

My internship with the SmartGym team has been a fruitful one, and I have learnt many new things and made new friends. I thoroughly enjoyed being able to apply what was taught in school, as well as expanding my knowledge beyond what I already knew. The team was extremely helpful with each other’s queries, and I am grateful for the opportunity to intern here!

SmartGym Team

--

--