Mobile app architecture with FlutterFire

In my time working as a software developer, I previously had a chance to be part of small development teams building production ready apps. Hopefully, this article can guide other teams in building their apps.

Traditionally, if you wanted to build an app for mobile users, you would have to form a sizable development team to write the different parts of the app. It can be hard to find people to do this, so the question is – Can this be done with a much leaner team of 3 or less? The good news is that it can! There are technologies in the market that allow engineers to build mobile apps quickly and cost-efficiently.

Depending on the type of app you are building, development requirements may differ. Some apps need to store and retrieve large amounts of data, so those require a database; If the app needs to communicate to other users, you need a server; Finally all apps definitely need a user-interface(UI). Other things your app may need, like payments and video streaming are out of the scope of this article. To fulfil most app requirements, I recommend a FlutterFire Architecture.

Architecture overview

FlutterFire comprises of 2 parts: Flutter and Firebase. Flutter is the frontend code which can be deployed to both iOS and Android devices. Firebase will be the backend of the app, residing wholly in the cloud. If you are familiar with either Flutter or Firebase, you may skip the introductions and proceed to the FlutterFire Implementation.

Image 1: Overview diagram

Flutter – Flutter is a framework written in Dart language which is used to package apps to both Android and iOS devices. Before Flutter, developers had to build Android and iOS apps separately. Flutter allows users to maintain a single code base for both. React-Native is another cross-platform solution not discussed here. You can find instructions on how to install Flutter on your device here: https://docs.flutter.dev/get-started/install

Firebase – Firebase is Google’s mobile development platform Firebase has a range of cloud services that provide easy-to-implement solutions to common needs such as accounts and database management. AWS and Azure provide similar services, however in the case of Flutter the integration is better supported and documented at the time of writing.

The benefit of using cloud services like Firebase is that you do not have to buy your own servers and pay only what you use. You also have to added benefit of writing simple code to perform calls to Firebase to for most of your app features. The rest of this article is dedicated to explain the services and how they integrate to mobile apps.

FlutterFire Implmentation

Authentication – Use this for signups, sign ins and account management. Firebase Authentication helps you securely store and authenticate logins for free! You also have additional options like sending verification emails/sms. https://firebase.flutter.dev/docs/auth/usage/

Cloud Firestore – This is a no-SQL database. Instead, it stores data as documents and provides fast and cost-effective querying. Flutter can directly perform CRUD operations on Cloud Firestore. Docs can be found here: https://firebase.flutter.dev/docs/firestore/usage/.

I recommend Engineers check these 3 things when using Cloud Firestore:
1. Configure the security settings on the database to ensure data protection. This can be found in the console under the ‘rules’ tab.
2. There are limits to querying due to the structure of data. This is especially the case with compound queries. Check out the docs here: https://firebase.google.com/docs/firestore/query-data/queries.
3. I would advise programmers to create a class for every document type in Flutter. This class will store type information like String, double, List<>, etc. This is to ensure the data types sent and retrieved from the database are consistent. Firebase and Flutter types are not totally compatible

Cloud Functions – This is the where the main backend code will reside. Any code that performs database operations, network calls or traditional server work, will be deployed here. Again, the benefit of having a serverless architecture is cost-efficiency. There is no need to buy and maintain a server, you can pay-per-use on Firebase.

There are 3 types of functions you should be aware of:
1. On Request – As the name suggests, these functions are called Ad Hoc.
2. Scheduled – These functions are run at specified intervals.
3. Triggered – These functions are useful if you want code to run when certain events happen. Some common examples are running database checks or operations when the database is changed. Other triggers include when a user authenticates, when a file is uploaded to Cloud Storage etc.

With these functions, you do not need to provision any servers. Firebase will spin up server instances to run these functions when required! Check out the docs here: https://firebase.flutter.dev/docs/functions/overview/

Edit: In my excitement in writing all the benefits of Cloud Functions, I neglected to mention one very important drawback – Cloud Functions are written in Javascript or Typescript, NOT Dart. So you may have to learn how to code in those languages and setup the libraries.

Cloud Storage – Cloud Storage is similar to AWS S3 and Azure Cloud Storage. It is a storage for files like images, videos, audio, etc. There is nothing that make it stand out from other cloud storage solutions, you could even use others like AWS S3 if you want, but since the Firebase account is already setup, you save time and effort implementing this part of your app. Docs for Flutter’s integration with Cloud Storage can be found here: https://firebase.flutter.dev/docs/storage/overview/

Cloud Messaging – If you want your app to notify users when the app is in the background or is not running at all, you need to setup Cloud Messaging. This could be the most tricky to setup out of all the other services because different platforms control notifications differently. However, once you manage to setup Messaging correctly, Firebase and Flutter help you send and receive notifications to both iOS and Android users with no fuss! Docs for Cloud Messaging: https://firebase.flutter.dev/docs/messaging/overview

Final note about using Firebase: TRACK YOUR BILLING. This article describes how a charity racked up a 30k bill overnight from poorly written code: https://hackernoon.com/how-we-spent-30k-usd-in-firebase-in-less-than-72-hours-307490bd24d. You can track you billing easily in the Firebase console’s settings.

Conclusion

There is long term support and planned upgrades for both Flutter and Firebase. The features listed here are not extensive and one should examine the docs to see if the FlutterFire architecture is appropriate for your app. Nevertheless, it is worth stating that building an app with this architecture can be done by a solo developer (I have done it). The free tier of Firebase is very generous and if you have little traffic on your app, no need to sweat because you pay close to nothing.

Happy coding!

Beginner tips for Exploratory data analysis with Pandas

This article is written as part of Gaogao’s Advent Calendar series. This is the first year I’m participating and I wanted to write about an area of tech that I’m interested in and currently working on. Here I present eight tips for common issues that beginners would find useful.

Data can come from everywhere – web scrapping, online surveys, collection from customer records, data analytics platforms, and messy data is inevitable. Being a beginner starting your first few projects, messy data is a scary prospect. Hopefully the tips here can help you resolve generic issues while you overcome the initial panic of seeing over a million rows of haphazard, missing, strange data. I assume you are using either a notebook of some kind like Jupyter Notebook, Google colab, Kaggle etc. I also assume you are coding in Python and using the Pandas library.

Optional Parameters

A lot of inbuilt methods come with useful options that users, both experienced and beginner, sometimes forget about. Sometimes the documentation doesn’t explain it in the best way so you may have to Google some example or try it yourself to understand what each parameter does. Here are just some examples

#1 Tip: For reading and exporting ,
i) remember to use the ‘encoding’ parameter if non-Latin characters are present, e.g. Japanese /Chinese;
ii) if you do not want indexes, use ‘index=false’
Ex – df.read_csv(or read_excel)(<filepath>, encoding=”utf-8″, index=False)
Ex – df.to_csv(or to_excel)(“CleanData.csv”, encoding=”utf-8″, index=False)

#2 Tip: Check the axis. Some methods require you to specify ‘axis=1′ to apply to columns(axis=’columns’ is the same but longer to type). Else you will apply them to rows!
Ex – df.sort_values(by=1 ,axis=1)

#3 Tip: Remember to use ‘inplace=true’ to shorten your code
Ex – df.drop(<col_name>, axis=1, inplace=True)

Column Operations

If you can find a ready-made method like .groupby() or .split(), use those. They are faster and cleaner. Otherwise the next best I would suggest using is .apply + lambda function. This is highly flexible and quite readable. I use this A LOT.

#4 Tip: If you want to test a lambda function, remember to return the original variable. This is to ensure the data is not accidentally changed.

Return original in all cases when checking output

#5 Tip: To make your code readable, I suggest defining and running the function in the same code box if possible.

Lambda functions applied to df columns in the same code block

Python Types

After using Typescript and other coding languages that can type checking, Python can feel like a step backwards. The numbers your assumed were ‘int’s (integers) turned out to be ‘str’s (strings) or there was a ‘NaN’ in one of the rows which made the method throw an error… Its frustrating. Unfortunately, there is no easy way around this problem but to check and convert all data points in your columns to the one you desire.

#6 Tip: Use .dtypes() to confirm all types are consistent.

‘object’ type could either be all strings or a combination of types

#7 Tip: Get rid of ‘NaN’s in your columns. Use .isna().sum() to check for ‘NaN’s. Then use either .fillna() or dropna().

#8 Tip: Change all column data to a single type.
Example: df.loc[:, ‘col_name’] = df.loc[: ,’col_name’].astype(float).

Thank you for reading and hope you traverse your messy data with confidence!

Oita City

Alas, it is time to leave Oita and return home to Singapore. It would be fitting to end the series about our travels in Japan with a post about the city that we called home for the past two years. Up till now, all posts written detailed our experiences in various parts of Japan and Oita Prefecture, but in reality we experienced Japan’s culture, food and people here in Oita City. From commuting to work and Japanese lessons to shopping for groceries and household items, the city of Oita was the place which we have the most memories and attachment to.

In thinking about what to write, I had to look through photo albums for pictures that we took in Oita. Unfortunately, there weren’t many because after the start of the COVID-19 epidemic, all large-scale gatherings were cancelled which meant we didn’t get a chance to see most of the celebrations and events that usually took place annually. Nevertheless, this is a snippet of Oita City that we experienced over the last two years.

Sights

Admittedly, Oita City is not a place with many famous attractions. There are some nice spots littered around the city that visitors can enjoy. The most notable of these in my opinion would be Takasakiyama. It’s a mountain situated between Oita and Beppu and the mountain itself is featured as the city’s mascot – known endearingly as Takamon. This mountain’s residents are the area’s main attraction. They run wild throughout the dense vegetation on the mountain and play at an area where visitors can see them near the foot. They get real close to you but are harmless unless provoked.

Next on the list of places is Heiwakoen or Heiwa Park. It means Peace Park, but it’s not as grand as Hiroshima’s or Nagasaki’s. It’s a great place to go during hanami because the sakura trees are nicely lined up along the canal. We went during that time, but it rained suddenly so we couldn’t see much. On the second occasion, we checked out other parts of the park like the Noh Theater and a Chinese-style gate and pavilion that symbolized Oita City’s relationship with her sister city – Wuhan, China (yes, that Wuhan).

This next place is a little hard to get to but worth a visit if you are in Oita in late April to early May. This is because it’s when wisterias bloom and it’s an amazing sight. It’s a shrine in the south of Oita called Sasamuta Shrine. It is a typical Shinto Shrine except for its garden which boasts a local secret. It has a large wisteria tree. A maze of trellises and wooden scaffolding allow the vines and strings of flowers to hang down from above the walkways. The overhangs drape over the heads of visitors like silky, lilac curtains swaying in the breeze provides a unique entrance to the shrine.

Food

Oita is famous for Toriten, chicken fried tempura-style. You will find that all throughout the restaurants in the city. The one place that I would recommend is called Kujuya, named after the Kuju Mountain Range where they source their ingredients from. We especially enjoy their unique salad, which gathers fresh ingredients from Oita. It comes free with all the set lunches! Their Toriten is the main recommendation and it is really juicy and succulent. If you go at night, the restaurant is transformed into a yakiniku place. Of the three times that we went there for dinner, we were not disappointed. Their beef is from Oita, called Bungo-ono Beef. It is a type of Wagyu and it tastes amazing.

The next mention is a ramen shop whose kanban (sign) just says “Oita Ramen”. Its full name is actually Oita Ramen Congratulations (it sounds better in Japanese – Oita Ramen Omedetai), and it is right next to Oita’s main train station. When I first saw the gaudy yellow sign bordered by Broadway-style lights, I said I would never eat here, it looked too touristy. I’m not sure why but we did end up trying the ramen there and we have not looked back.

I usually give an informal rating for ramen I try based on specific criteria. For this one:
Noodles: 10/10. Perfect thickness, perfect crunchiness/chewiness, tastes amazing.
Broth: 10/10. Perfect mix of creaminess, saltiness and umami. Make no mistake about it, if you eat this everyday, you will have a clogged artery in the next 10 years. But it’s just so unbelievably good that you wouldn’t care.
Meat: 10/10. They actually give you two different cuts of pork if you order the special. Both are delicious in their own way. You get the traditional chashu which is seasoned and braised to perfection, and you also get a rib cut where the bone is removed but the cartilage remains. This is the real kicker. It literally melts in your mouth and it tastes incredible.
Toppings: 8/10. Nothing special about the toppings so it doesn’t get a perfect score because the egg is just a hard-boiled egg (sorry but it should be a flavoured egg); And it doesn’t come with bamboo and black fungus.
Cost: 9/10. Priced at 790yen for the special (the most expensive), it’s really value for money for what you get. You also can ask for 1.5x noodles if you are hungry!

The next recommendation is Hasama House. Our Sensei brought us here on our last meal with him before we left 😥 It is a quaint little restaurant found in North Ozai, which is northeast of Oita Station . The restaurant sits at a corner of a collection of houses and looks like an unsuspecting residential home unless you went closer and noticed the menu and open/close sign. They offered two menus for lunch – a Western and a Japanese one. Both sets included an abundant salad that could rival Kujuya’s and we ended the meal with the apple tart that’s made in-house.

The last recommendation is a modern Japanese restaurant named Ginnan. This place is a go-to for locals who want to have business dinners and company celebrations. They serve Japanese cuisine with cooking techniques adapted from various other styles like Chinese and European. The courses are spread out over a 2-3hour period which creates ample time for conversations and sake between dishes. Their plating is exquisite, and food was absolutely delicious on both the occasions that we went. (Sorry but I lost the photos of the food. I only have one of the shop front).

SPORTS

One of the few major events that came to our city was the Rugby World Cup 2019. It was held just before the pandemic and would be one of the last large-scale events where large crowds could gather in Oita City for a long while. At that time, there was a great atmosphere throughout the city. Shops had rugby related goods, restaurants served rugby-themed menus and screens everywhere were showing live games and highlights. It was especially exciting whenever the Japanese team played. The city would erupt in cheers when the team scored and celebrations would continue if the Cherry Blossoms won.

As Oita City was one of the host cities, we got a chance to watch a live game between New Zealand and Canada. It took place at the largest stadium in Oita, Showa Denko Dome. People from all over had travelled to our city to watch the game and we entered a packed stadium, eagerly anticipating the start of the game. We were also treated to the traditional pre-match haka by the All Blacks. Unsurprisingly, they ousted Canada by a fair margin, but the match was fantastic nonetheless.

I love football so besides rugby we also went to watch Oita Trinita FC, Oita City’s football club. We went on two different occasions at two different venues. Showa Denko Dome is the team’s main stadium but it was used for Rugby World Cup matches so they played at a different venue. Oita Trinita is a mid-table team and their style of play wasn’t the most exciting, but the fans were passionate and the atmosphere was lively.

Final thoughts

We will definitely return to Oita in the future. Until then, we have these photos and memories to look back on. It has been a thoroughly enjoyable experience living and working in Oita City. It may not be as famous as Tokyo, Osaka or Hokkaido but it has its own charms. We end our journey with the view from our street. On a clear day, we can see the mountains to the west. I will miss this view.

Kokonoe

Just when we thought our travels were over, we managed to squeeze one last trip to an unvisited part of Oita Prefecture, to a region called Kokonoe. It was raining in the morning due to a typhoon and it threatened to ruin the day, but thankfully it subsided and we were treated to the spectacular views of the natural landscape that the region offered.

The first place we went to was called Kokonoe Yume Otsurihashi. This is the highest pedestrian suspension bridge in Japan. It costs 500yen for adults to traverse, but it is worth the price as you get a superb panoramic view of the valley below. It also touts colourful views as the seasons change so depending on the time of the year, you may get even more beautiful landscapes.

Next, we went to a place called Bebenko Farmhouse Restaurant. If you are in the area, this place is highly recommended. It serves local produce such as the nicely marbled Bungo-ono Beef from our very own prefecture. We had it in a yakinikudon (grilled meat with rice) and it was so delicious that we ordered an additional steak on the side. On top of that, you can sit outside where it overlooks the plains at the foot of the Kuju Mountain Range. The serene view is a perfect pairing with the hot tea and food that the restaurant serves. Also, there were some animals that the owners reared beside the main building (there was a curious llama which seemed a little out of place).

Most of the Kokonoe region is covered by the Aso-Kuju National Park, thus a trip to Kokonoe wouldn’t be complete without seeing the Kuju mountain range up close (the Aso portion is in Kumamoto and we visited it when we went to Kumamoto). Visitors can only reach the top of any of the peaks on foot so we didn’t make the climb. However, the area surrounding the mountain range was picturesque, so we managed to get a few great photos and views.

We don’t have any more days left in Oita so this marks the last region of Oita that we visit in our time here in Japan. I’ve written about Saiki, Beppu, Taketa, Nakatsu, Kitsuki, Kunisaki, Usa and now Kokonoe (and one more about Oita City coming soon). I would say we have plenty of recommendations for anyone wanting to visit Oita Prefecture and the island of Kyushu. We hope to return to the prefecture to checkout some of the places again in different seasons, and perhaps visit new ones.

Chūgoku (Part 2): Tottori & Shimane

In part 1 of our Chūgoku adventure, we visited Hiroshima and Okayama. Now we head north for part 2, to the 2 prefectures that lie on the shores of the Sea of Japan – Tottori and Shimane.

After a 2 hour drive, we arrived at our ryokan on the fringes of Tottori City. It was the perfect place to see the famous Tottori Sand Dunes. More on that later. Our first stop was the Sand Museum. We expected the museum to have some generic displays or perhaps some history to do with… sand… but we were pleasantly surprised to find that the museum actually holds world-renowned sand sculptures and their themes change every 3-4 years. The theme when we visited was Czechoslovakia.

The main hall of the museum was a massive space that was filled with numerous sand sculptures made by different artists. The sand sculptures were huge in size but intricate in details, and the teams that created these massive displays comprised of skilled sand sculptors from all over the world, including one from Singapore! As the crowning jewel of the exhibit, there was a replica model of Prague Castle with a waterfall at the far end of the main hall. It was awesome.

Right next to the museum were the Tottori Sand Dunes. This desert-looking landscape spans roughly 15km in length and 2.5 km in width and is also next to the sea. There weren’t any dedicated paths so visitors are free to roam wherever and however they wished. We started by following the footstep trails of others but soon ventured on our own way. From certain points, you weren’t able to see beyond the dunes which gave the feeling that you were actually in a vast desert. Then as you walk on further, there will be a few activities relating to the sand and the beach like sand boarding and paragliding.

We bid Tottori adieu and headed to Shimane. We stopped by Yuushien along our drive to Matsue (a city in Shimane). Yuushien is a garden that is well known for their beautiful peonies. I’m not much of a flowers guy, but this garden had amazing colours that no other garden in Japan had. The peonies came in various shades of red and it made the garden bloom with vibrancy. It was springtime which meant it was peak season and tickets were more expensive and it meant that hoards of visitors. Nevertheless, it was worth the visit as the experience was unique.

Izumo Taisha or Izumo Grand Shrine, is the most well-known places in Shimane and usually on the top of lists of must-see shrines in all of Japan. The shrine gains its importance because of the kami or god that is enshrined there. According to the creation myth of Japan, Okuninushi no Okami was the creator of Japan and ruled Izumo. Every year, Shinto’s deities gather here for a meeting and this is when the biggest festival of the shrine is celebrated.

Even though we went there on a gloomy, rainy day, but there were still many visitors to the shrine. The shrine complex is split into a few parts but the main area houses the tallest worship hall in Japan (24 meters). Visitors were not allowed near the main buildings but the area surrounding it had lots of other places to see. There was even a shopping street next to the shrine area.

Many travelers (before COVID) travel to Kyoto each year to see Fushimi Inari Shrine and her Thousand Torii Gates. Actually there are around 30,000 Inari Shrines in Japan (source: http://inari.jp/en/faq/). Taikodani Inari Shrine located in Tsuwano-cho, a small town on the periphery of the prefecture, is another one of the most popular and stunning Inari shrines in Japan. Before returning to Oita, we made a quick stop there to check it out.

A typical Inari Shrine is characterized by its vermillion, lacquered torii gates. The red colour symbolizes protection from evil. Visitors enter through these many gates that line the pathway leading up to the shrine. The beauty and natural splendour of the surrounding landscape was what made this place a worthwhile detour for us. Its location on the slope of the mountain meant that we could see the whole valley. It was also cooled by a gentle breeze which constantly flowed though the shrine complex.

That rounds up a pretty awesome trip in Chūgoku. We spent about a week travelling to the various cities and locations mentioned in the articles, but there were plenty of other things that I didn’t include, like all the food and shops we explored. Thus by the time we got home, we were exhausted but satisfied by the great experiences that we had on this trip. Till next time! Mata ne!

Chūgoku (Part 1): Hiroshima & Okayama

On this trip, we travelled around the Chūgoku region. Chūgoku translates to middle country but it’s situated in the west of Honshu, Japan’s main island. It consists of Hiroshima, Okayama, Shimane, Tottori and Yamaguchi. We hit all 5 prefectures but I’m writing this as a 2-part post as there were plenty of things to mention and many places that we visited.

The first stop on our trip was Hiroshima. Hiroshima is, unfortunately, most known for the tragic occurrence that happened in the city at the end of World War II. Many places around the city mention the dropping of the atomic bomb in their descriptions. Naturally ,we paid a visit to the Atomic Bomb Museum and Peace Park. The museum depicts a lot of the horrors of the aftermath of the atomic bomb blast and its imagery is more poignant and stark than the one in Nagasaki. The Peace Park, which is next to the museum holds many tributes and memorials to both the victims and survivors of this tragic event.

2021 marks the 76th anniversary of the dropping of the A-bomb, and there is no better memorial than the Atomic Bomb Dome across the river from the Peace Park. The Dome was actually the Hiroshima Prefectural Industrial
Promotion Hall before the bomb hit. The fact that it was so close to the epicentre, yet wasn’t completely destroyed is a bit of a miracle. It stands as a reminder of the devastation of atomic weapons and the sufferings of wartime. It is also one of Japan’s UNESCO World Heritage Sites.

On a less somber note, if you do plan on visiting Hiroshima, I highly recommend visiting Miyajima. It’s an island south of Hiroshima City and takes about 1 hour by ferry to get there. We initially wanted to skip this because we read online that the shrine, which was a UNESCO World Heritage site and the island’s most famous attraction, was closed for renovation. We were glad we didn’t because even though the shrine was indeed obscured by scaffolding, there were other things on the island to make the trip worthwhile.

The island was already bustling with activity when we arrived in the late morning. We didn’t expect to see so many high schoolers but it must have been some sort of school excursion. Nevertheless, we were able to get a table at one of the restaurants and enjoy one the region’s most loved seafood – oysters. Shops sell them in a variety of ways but they are mainly served fried or fresh. It was oishii.

After lunch we headed to the temple area and caught a glimpse of the island’s famous torii gate. The gate is actually part of Itsukushima Jinja or Itsukushima Shine and it is built in the water. When the tide is high, the gate appears to be floating on the water’s surface. It was obscured by the construction work so we turned our attention instead to the shrine itself, which is also built on the water. The shrine retained its religious roots in its design with the red pillars and Shinto symbols but the passageways between buildings were boardwalks built above the beach. The foundations were completely covered by water in some parts of the shrine, and in others they were exposed as it was low tide.

Next, we drove into Okayama Prefecture. However, before going to Okayama City itself, we drove onto another ferry which took us to Naoshima. To clarify, Naoshima actually belongs to Kagawa Prefecture (we didn’t know that until after the trip), but we decided to put this in our plan as it was en route to Okayama City plus it was highly recommended. We were not disappointed.

Naoshima is known as Japan’s Art Island and it’s not hard to see why. Some who come to the island stay several nights just to see all the art installations and museums that the island has to offer. We were only stopping by for a few hours so we had to move quickly to see as many things as we could.

The most notable art pieces were the two pumpkins designed by Yayoi Kusama, one of Japan’s most famous contemporary artists. They are on different parts of the island but are easily accessible by car or the public buses that run exclusively on the island. There was a bit of walking as well to see the outdoor art pieces but it was a nice day and the island had some scenic spots so it was worth going on foot.

Another place that we went to was the Chichu Art Museum. This place is a MUST-SEE. We were not allowed to take any pictures inside the museum, but you can google it (…or not if you want to be surprised like us). It was more than a museum, it was an experience. I won’t say much about it here except that you should go early or be prepared to wait as the museum only allows a maximum number of visitors at a time.

In Okayama City itself, we visited Korakoen, one of the three Great Gardens of Japan. Of all the koens that we have paid visits to so far, this was the most worthwhile. It was 410yen, which is relatively cheap, and it was large with many plants and wide spaces to stroll through and admire the view. At certain locations, you could catch glimpses of Okayama Castle, which is where we went next.

There was nothing historically particular about Okayama Castle, but we decided to go in and have a look. It resides on a rather scenic part of the city and the surrounding areas were a pleasant place to take a slow walk.

We headed to Tottori and Shimane for part 2 of our trip to Chūgoku. But before leaving Okayama, we went in search of the statue of local legend and boy hero Momotaro and it shall be the parting gift for this post.

Kunisaki and Usa

Kunisaki and Usa are two cities located in Oita Prefecture, the former being the place where our local airport is situated. We had an opportunity to go to Kunisaki because our friends had asked if we could drop them off at the airport as they were returning to their home country :’-( . We agreed and in return, they covered the cost of the car rental, a pretty fair deal if you ask me. So after we dropped them off, we took a detour and visited some well-known sites that were a short drive from the airport.

We went to 2 places. The first place is called Futagoji and it is a well known temple in the region. We were a bit surprised by this place as it wasn’t a regular temple like we imagined. Firstly, the temple was a blend of Buddhist and Shinto religions. To explain this simply, Shinto was practiced in Japan before Buddhism arrived from China around the 6th century. Both have coexisted rather peacefully but Shinto was the official religion during the Meiji restoration period of Japan. So many shrines and temples around Japan contain elements of both religions. Modern Japanese also practice a mixture of religious rites in their lifetime.

The other reason this place was unique was because of the layout. Usually, temple complexes have about 1-3 levels. The lowest level is where you park your car and enter. If the temple was on a hillside or mountain, you would have to climb a few steps or a short staircase to see the main temple and other shrines. Futagoji however, is a large area within the mountain. There are a pair of twin deities that guard the entrance (the presence of these deities is also a bit unusual). Visitors would then head up a long flight of stairs to reach the ticket booth. After that you are free to explore the grounds littered with many statues, stone plaques, rock formations and temples. You can even hike to the top of the mountain via a trail, but we weren’t prepared for that. It was also beginning to get really hot.

The second place we visited is a more famous site – Usa Jingu or Usa Shrine. This place is dedicated to Hachiman, the spirit of Emperor Ojin and is the head of all Hachiman shrines in Japan. This site is also influenced by both Buddhist and Shinto religions, a common theme for temples in the region. The temple grounds were huge, but thankfully unlike Futagoji it was mostly flat so the walk was less tiring.

It was a hot summer’s day and we picked up some local summer produce before hitting the road. We spent about a total of 5 hours visiting both sites and it was a 2 hour drive back to Oita City. A relatively short trip compared to our other travels. Even though our prefecture wouldn’t naturally be at the top of traveller’s ‘must-see’ lists, the various cities in our prefecture all have something that makes them special – and we would say it’s worth the visit.

Shikoku

The closest neighbouring prefecture to our city is Ehime. Ehime isn’t on our island of Kyushu, it’s actually on another island, Shikoku. The only reason we haven’t travelled there was because the quickest way to get there would be by driving onto a ferry that would take us across. Usually that wouldn’t be an issue, however the websites and ticket reservation processes were all in Japanese. We would also have to travel to the outskirts of the city to board this ferry, so this meant that you had to know your way around. Having leveled up in our Japanese speaking (i.e. we can ask for directions), we were confident that going on this trip would be fine.

Ferry route from Saganoseki, Oita to Misaki, Ehime. Photo courtesy of GoogleMaps

We also had to plan the itinerary. Again, usually this would not be a problem but Shikoku is the smallest of the four main islands of Japan, at just slightly more than 18000km2. It doesn’t have the world renowned sites of Kyoto and Nara, or the natural beauty of Hokkaido. Despite this, there were recommended places to visit so we tried our best to fit as many into our tight schedule as possible, even though many were far away from the main cities and the island is pretty mountainous for its small size.

We arrived at Misaki Port in Ehime on a scorching hot afternoon in the middle of Japan’s summertime. It was around a 2 hour drive to Matsuyama, Ehime’s capital city and our first stop. Even in the car with the air-conditioning on, we still could feel the sun through the windows and when we got out, we immediately start sweating profusely. Those whose Olympic sport is an outdoor one must feel like they are on fire right now. Don’t need to warm up guys, you’d be ready to go as soon as you exit a shaded area.

In Matsuyama, we visited 2 attractions, Matsuyama Castle was the first. Matsuyama’s castle is one of the main attractions in the city and certainly a decent place to visit. However, it was really hot that morning(33° C) and I think the heat made the experience a little less ideal. Inside were exhibits and details about the history of the castle and at the top level, visitors got to see a 360° view of the city.

The second place we went to visit was Dōgo (道後). It was an area of Matsuyama which had a few notable landmarks such as the Dōgo onsen, which is the oldest onsen in Japan, dating back over 3,000 years! The façade of the buildings were undergoing renovation when we visited, but the hot spring was still in operation. The temperature outside was sweltering so we were never going to pay to dip in hot water (we went for ice cream instead). The other attraction in this place was the old Dōgo train station. It had an industrial age feel and had a parked train which I initially thought was a replica model. However, upon some research I realised this train actually still runs!

Subsequently, we drove another 1.5 hours to the next prefecture – Kagawa. We had already made a stop in this prefecture when we visited Naoshima but this was the first time on the mainland. I didn’t know this before, but when we searched for famous food in Kagawa, udon appeared. Kagawa is the largest producer of udon in Japan and the people here adore it. Hence we had fair amounts of udon on this leg of the trip.

In between udon meals, we went to check out some of the places Kagawa had to offer. The first stop we made was Kotohiki Park to see a giant coin made of sand called Zenigata Sunae. Okay, this is probably one of the few times I would recommend against visiting a place. Even if a place was overhyped or warned of a potential bad experience, there usually would be some other things to make it an attraction. This place, in my opinion, was a waste of time. Why, you ask? Firstly, you would not be able to see the entire giant formation if you didn’t have a drone because there was no vantage point. Second, there was nothing else in the park except for bug catchers, which were all kids running around with big nets. Lastly, it was difficult to find and difficult to get to. Oh and did I mention? It was HOT. TLDR: don’t stop here unless you want to see nothing.

Left: what we were promised. Right: what we saw

We also went to a place touted for having the most beautiful sunsets in Japan, Chichibugahama. It means “Father and Mother’s beach” (not sure why).

Lastly, we went to Ritsurin Garden in Takamatsu, the capital city of Kagawa. On their website, it states that Ritsurin is “is the largest Cultural Property Garden in all of Japan” and the Michelin Guide rates this garden as 3 stars (I thought they only ranked food…?). It was a pleasant morning stroll but we left as soon as it became really hot.

Then, we headed for prefecture no.3 – Tokushima. This was the only prefecture that we didn’t stay a night in. We visited two sites during the day on our way to Kochi prefecture. They were the most unique places on our trip and certainly the most prominent in the prefecture. The first was Udatsu which was a street of Edo period houses and shops.

The second was a set of vine bridges in the Iya Valley… wait what? Ok, some context is needed. The Iya Valley is a large area at the heart of Shikoku’s mountain range. When we were there, we could tell that the main activities here were camping, hiking and river rafting as plenty of locals were engaged in those. The valley is flanked by steep slopes and the Iya river runs right through it. Before the advent of modern bridges, the inhabitants of the valley crossed this river via vine bridges. They are constantly maintained to ensure safety, but crossing them still seems rather precarious!

We also encountered a surprise while traversing the winding mountain roads. The village famous for its doll inhabitants is located in this valley. Dubbed ‘The scarecrow village’, Nagoro Village is a tiny settlement where life-sized dolls have outnumbered the human inhabitants. A bit bizarre and definitely creepy at night, we merely drove past and took a few photos. Read more here.

Rounding off the four prefectures was Kochi. We visited the castle, which was again a recommended spot. However, the streets surrounding the castle were bustling as well, which was a little different compared to other castles we visited in Japan. There is a market that runs only on Sunday which we didn’t manage to see, but there was a food market. The place reminded us of food centres in Singapore and Tsukiji Market in Tokyo. The specialty food for Kochi – seared Bonito sashimi.

Shikoku is not a place on everyone’s bucket list but it certainly has its own charm. A car is required if you want to visit but driving from city to city is very short compared to the other prefectures on bigger islands. Overall, I’m glad we made this trip despite the heat as there were places that existed only on the small island. When we took the ferry back across to Kyushu, we drove back home in no time at all. Going to Shikoku could even be a day trip if you started early enough. Maybe if there is a reason to, we would go again.

First time Flutter

So we couldn’t travel around Japan as much as we would have liked, but I managed to channel that energy to finishing my second mobile application. This time the app is a learning and dictionary resource for users who are interested in learning business Chinese and was built with the Flutter framework. It is called QUIKA and it took about 9 months for this baby to go from concept to full launch, a journey which started around the end of September 2020. I’m writing this to journal the steps (and struggles) that were undertaken for this app-making journey, with a little technical background at the beginning.

Flutter is a framework meant to help developers build mobile applications on Android and iOS in one single code block. Traditionally, you would have needed to code in either Kotlin or Java for Android AND have a separate code in Swift for iOS. Thus, even though I didn’t have any experience in Flutter, I was willing to learn the language in order to make the app on both platforms. Also, I had no choice. Our project team only had 3 people, 2 of whom were working full time jobs and had more than their fair share of personal commitments to deal with. They also had never built an app before. That left me to squeeze out what little expertise I had with programming and try to set this thing up.

Initial design for splash screen, category selection and flashcards

Learn by doing. This is probably the best phrase to sum up the entire journey. From the initial set up to the eventual launch, 95% of tasks were something that I’d never done before. Github, StackOverflow and Youtube will have a permanent dock on my Google Chrome browser. Additionally, because I was the main programmer, I had to solve most of the programming problems on my own. I couldn’t say “eh, I don’t know how to do this, can you do it?”. There was no one else. This meant that if I could not find an off-the-shelf solution, I had to homebrew my code and I can tell you, a lot of it is homebrewed.

Enjoy the process. You won’t see the end product or results when you are in the thick of it, but you will know when you are making progress (or not). There were times when I had to get off the terminal and go do some exercise because the solutions were just not coming. I would say that that is actually the best thing to do. You aren’t doing a timed exam nor being assessed daily. And when I did get something solved, or my code didn’t throw errors when running, you feel like a baker who had successfully baked a technically challenging but incredibly delicious cake (Many things can go wrong with cake. I know because my wife bakes).

We took twice the time we planned for. Since our app helps users to learn Chinese, we initially wanted to push it out for testing during Lunar New Year. That plan was slowly pushed to March, then April. Then once we got some feedback, we deliberated long and hard over what we had to do to get the best app we could possibly make. Even now, we are convinced that it can be better. It can always be better. But perfection is the enemy of progress, so rather than overthinking the tweaks and smoothen every aspect of the UI, we decided to launch it and test the waters. The app was launched on the Android Playstore on 9 June 2021, and on the Apple App Store the following day, 3 months later than when we set out to launch.

Old Quiz UI and list customizations that eventually did not make it into the final design

You are not a software engineer, until you are. I don’t have any formal certification in computer programming or software engineering. I doubt that I’m using best practices in a lot of the code that I write (I’m probably not). Nevertheless, I finished a working app; one that is tested on the iPhone and Android phones; one that runs smoothly with no crashes and has 1 or 2 minor bugs. I’m also working on developing my own computer game and other programming endeavors, coded in a different language and entirely different setups. I think you have to do it once to know if you can do it and if you like it. For me it is both.

Most problems are solvable. It’s not to say they were simple. In fact some were really tough. Like when we had to trawl the internet to find 1000 example sentences in Chinese. For that I learnt how to use Beautiful Soup and Selenium. Other problems were very annoying. I knew for these problems, they were due to poor documentation or just systemic/historical issues with some of the frameworks. The process of launching on iOS was particularly cumbersome. Not only is Apple more expensive to publish on, I ran into so many issues which led to much swearing (like when they rejected my app icon because it had an alpha channel…). Despite these issues, we managed to come out the other side with more experience and knowledge than when we first started.

Document your process. Besides commenting your code (which is sacrosanct), you MUST MUST MUST record all your troubleshooting history, especially those that don’t involve code. They can be things like how to resolve merge conflicts in Git, or how to solve issues with Swift reading Dart code (these were the closest I came to physically fighting the laptop). One might ask which processes are worth recording amidst the vast number of problems you solve. The simple answer would be that 1. the solution took a ridiculous amount of time and effort only for the actual process to take minutes; and 2. its something specific that you don’t come across often so you will forget. Perhaps you may even be able to help someone in the future.

As a final note, there is one last item on the list, which is to get feedback on real world users. This app isn’t for me after all. I would like to know if people find this useful, or if there are features that they would like which will be of use to them. My goal is to scale the value and usefulness of software to a bigger and bigger group of society. The first was a personal grocery list app, now it’s a business Chinese resource app, next it would be a game. Beyond that, I’m not sure.

If you want to try the app, search “Quika” on either the Android or Apple app stores. The app icon is the one on the top of this post. You can also find us on https://www.linkedin.com/company/quika-app.

Launched v1.0

Temples of Nara

Nara is a place where you get a good glimpse into Japan before its capital was moved to Kyoto in 794AD. Buddhism was the main religion and a lot of architectural styles of modern Japan arose from that era. There are Seven Great Temples in Nara, Nanto Shichi Daiji, that capture this significance. During our trip there, we visited three: Horyuji, Todaiji and Kofukuji. Places close at around 5pm so it was tough to visit all the temples within the time we were there. My advice is not to miss out on the other attractions like Nara Park and the walking streets. I wrote a longer post about our trip here.

The first temple we visited was Horyuji. It is situated south-west of central Nara and is the furthest away from the centre. You have to take the train and walk, or drive like we did. Within this site laid the oldest wooden buildings in the world. They were built sometime during the Asuka Period (538AD-710AD). It must take a good amount of expert care to preserve these structures because the entrance fee to this site was the most expensive out of all the places of interest we visited (¥1500 for adults). However, you are able to see the structures from outside the paid area and there were plenty of other things to see around so we didn’t go in.

Aside from the western precinct where the old wooden buildings were, there was an eastern precinct that had the Yumedono (hall of visions), Gallery of Temple Treasures and Chuguji Temple. Chuguji is renowned for housing a ‘Smiling Buddha’, which stands out for its unique appearance. Its smile is often compared to the Egyptian Sphinx and the Mona Lisa. The actual statue was elsewhere when we visited so we only saw pictures like the one below.

The next temple we visited was Todaiji. It is conveniently situated in Nara Park so you could just walk there from anywhere in the park. It used to be the largest wooden building in the world until 1998 which is a testament to its massive size. Its main resident is none other than a giant bronze statue of Buddha, one of the largest in Japan. There are also other smaller deities and a temple shop inside the large building. Admission here was ¥600 and its well worth to enter. There were also no deer in the complex, although plenty were just outside the gate leading in.

The last temple we visited was Kofukuji. It was a short distance from Nara Park so we walked over from there. This was the family temple of the Fujiwara Clan, the most powerful aristocratic clan during much of the Nara and Heian Periods. The main buildings in this temple complex were the three Golden Halls, the two Pagodas and the two Round Halls. The grounds of the temple were free to enter but there were admission charges for the buildings. We didn’t go inside where some of the temple’s treasures were displayed, but we could get a good all-round view of the buildings from the outside. The lack of walls also mean that deer from the nearby park were free to roam the grounds.

Of the four remaining temples, only Yakushiji and Saidaiji remain intact while Daianji and Gangoji are only partially standing. The temples are not close to each other so anyone wanting to visit them all will have to do so on separate days. Broadly speaking, they can be separated into groups, those that are in and around Nara Park (Todaiji, Kofukuji, Gangoji) and those that require transport (Horyuji, Yakushiji, Saidaiji, Daianji). You can plan such a trip in this way to make the most efficient use of your time there.