8 min read
Photo Credit: Allison & Rupert PhotographyA few days ago, I had an experience that reminded me of how much I enjoyed building applications and software development in general. Through frustration, passion and intrinsic motivation, I was able to achieve something I did not think was possible. I built an entire mobile application three days before I had ever done so. This article aims to share with you what I have learned in the hopes you can learn what I learned during this sleep-deprived endeavour.
What happened was that I was building a new feature on the web application when I got an email from Google threatening to remove our developer account on the Google Play Store unless I updated the packages. This is not anything new, and because I am primarily a web developer, it was always a struggle to get it done, but usually, I would prevail after a few hours, and I could leave it for another six months.
This time, those few hours turned into an entire day with no end in sight. Feeling disheartened and a little worried, I began to re-think my options.
• I could continue hacking away at the keyboard and hope I could figure out the problem before a ridiculous time passed and wasted a ton of time on an application I didn't even like, or,
• I could re-build the entire application
The application was pretty old, and the last time I had to update the mobile app, I also needed to update from react-native 0.6 something to 0.74, and I was not keen to repeat this process indefinitely. Some other issues came into consideration.
• I never liked the fact it used redux-saga. This is my personal preference, but for the size of the application, I always thought that it was more hindrance than helpful.
• The UI looked terrible. Seriously, it looked like it was from 2010.
The app was also fairly unreliable, and since I only touched it once every six months or so, it was really difficult for me to diagnose the issues and know why architectural decisions were made the way they were.
After careful consideration and speaking to my boss, we decided it was a better option to re-build the app.This was both exciting and a little terrifying, mainly because I had never built a mobile app and had very limited experience working with react-native. Still, I trusted my gut and moved forward.
Doing some research, I quickly deduced that it would be easiest to use react-native and expo since I was already very familiar with React, and expo would make for quicker development and testing. I am a big fan of doing courses and have completed dozens over the last few years. I remembered that a year or so ago, I had aspirations to build a mobile app but never quite got around to it, but I had bought a course on react-native from coding with Mosh. Even though the course is pretty old, it gave me a basic understanding and provided me with a direction of where I needed to look to find the relevant information.
This was also the first time I had used chatGPT as a tool to speed up my development process. I use co-pilot to speed up the writing of predictable code, but up till this point, I had not used any form of AI to help with debugging code or look for relevant packages to the problems I was trying to solve. Although the syntax was frequently wrong, the general gist of the code it gave was helpful. I was surprised just how much it helped to speed up development and meant I didn't need to search for hours on stack overflow as it was likely doing this for me. I also ended up buying the react-query course from UI.Dev and I was not disappointed. I had a feeling their courses would be good, having been a subscriber to their bytes email for a long time, but up until this point, I had not had a decent enough reason to buy into their learning platform.
I ended up building the react-native app without redux and used react-query for data handling and the context API for other small things I wanted to keep track of within the app. The backend of the application was already there, as it's the same one we use for the web application, so I just needed to connect the dots in that regard.
React-Native is an absolute joy to work with. I really love all the native features it provides access to, and since the app needs access to the camera and file system, it wasn't hard to get this up and running quickly. I also absolutely love the @tanstack/react-query library. I thought the RTK query package was good, but react-query is amazing. It meant I was able to quickly handle caching and invalidations with absolute ease and completely replace redux-saga, which I was, naturally, thrilled with.
I noticed something else within me, too. When I was writing the app, a lot of the components you need were built for you — touchables, alerts, modals and so on — which meant I was able to focus less on the UI and more on achieving the solution to the problem I was actually trying to solve. Maybe it's ego, or because I started off at a design agency, but in web development, I always felt that it was almost cheating to use a UI library to speed up development, so I would only reach for a pre-built solution if I had no other choice. This just isn't right; while I now see there are use cases for creating your own UI components, and I will still create them on a very regular basis, it just doesn't make sense to try and reinvent the wheel every time I build an application. So, moving forward, I will definitely use UI libraries if they solve my problem.
Since the app is relatively simple, it meant that the stress I was feeling was at the Goldilocks point, which was stressful enough that I was really driven but not so stressed that I was immobilized. The one thing that was not good, though, was I felt like I got obsessed with building the app, and my work days turned to sixteen hour plus work days, not including breaks, and I could feel my health deteriorating quickly. I can imagine that If I had not hit my hours cap for the week, I could have easily run myself into the ground. Still, it was honestly an awesome experience and I am really proud of what I achieved in those few days. My partner and I are both really excited about building mobile applications for ourselves now and I will continue my journey down this path of mobile app development.