Sharing experience developing budgeting app.
I think it more harder to documenting application than building application.
Created: 2023 Dec 01
Updated: 2024 Mar 14
This time I want to sharing my experience working for my side project on November 2023. In this side project I want to build Mobile Application and Rest API Application, those application have goal to managing personal and my family financial. Of course there are some much application with same goal for managing financial, whether it is a mobile application or desktop application. But if I want to use those application with comfortable and for long term, I need to pay the application. Of course I am agree to appreciate the developer who build the application, But in this case and to be honest, I don't have more budget to appreciate the other developer. So I build my own application for myself or anyother people with same condition.
Oh ya, before I starting the topic I would like to express my gratitude to [ PT. Arkamaya ] for accepting me as a full stack web developer and allowing me to WFH ( working from home ) for one month in August 2023. Because Bandung is so far away with my family I decided to give up the position, so thank you so much [ Pak Irfan ], [ Pak Achmad ] and [ Pak Ade ].
And let's back to the topic, and I really want to build this application because:
- Financial budgeting and tracking for myself and wife.
- Costs money to use the app comfortably and long term.
- Gain more experience with learning new 2 programming language for me.
- Waiting for the results of my application for job vacancies.
In accordance with the goals above, of course I need build applications more than 1. So I think to achieve the goal with minimum requirement and limited time, I can build API Application and Mobile Application, by using 2 different programming languages. API Application using Rust Programming Language, for Mobile Application using Kotlin Programming Language(Java like).
API Application
[ https://github.com/okumaru/rust-api ]
This application use main programming language is Rust. And some of libraries to support usability,
- [ Tokio ] asynchronous runtime.
- [ Hyper ] HTTP library to build API.
- [ Sqlx ], SQL toolkit.
- and any other else.
You can the repository for more detail. And to be honest, there some libraries in this project not be usefull for this application. I install those libraries because I just want to solve the coding problem, But after I try and try solve the problem, I just need to make difference logic. It doesn't mean the libraries is useless, but I just make wrong logic and try to solve with libraries, and not yet remove those libraries from the application.
Mobile Application
[ https://github.com/okumaru/mobile-app-budget ]
This application use main programming language Kotlin.
- [ Jetpack Compose ] layouting for device like Tablet or Mobile.
- [ ViewModel ], to communicating with API.
- some other libraries too.
Same like API Application, I installed unused libraries in this application because I want to solve the coding problem.
For more details of tech stack and infrastructure I will update this blog.
It's mean this 2 applications still in beta version. After I developing those application I found 2 issues and need to be repaird. 1 in Mobile application and 1 in API application. I found Mobile application look like lacking on touch the button or screen. And feature edit record transaction not compatible with design database. For now, I still cannot fix those issue because full of schedules. But I hope, I can solve the issues before end of June.
Developing API
I already learning Rust programming language from last year( 2022 ), and I already build other 2 project using this programming language. To be honest those 2 project not complicated and managed data saved in JSON file.
On this application, I try to save the record in database. And I choose mariadb for database because I think it's not wort it if I use noSql. Because this project doesn't need multiple service yet, and I just have limited time. And I think it need a long time for this application will have big data.
Why I use Rust library Tokio Hyper? There any other else Rust library to build Rest API. Actually I'm interested to build gRPC Application from Rust, I searching gRPC library from Rust and I found Tonic from Tokio. Because I just have limited time to build this Application, Better I make Rest API Application than gRPC Application. Because Tokio provide library for Rest API too, I'm try to use Hyper (with hope my code will be not much change if I switch from Hyper to Tonic).
For Sqlx, to be honest I don't like ORM library because I think it's better use RAW Query than ORM. Because if I change the ORM library to any other ORM library, I must change the code how to execute the query to sql.
For the libraries installed in this application, I'm not believe those libraries are the best libraries for this type of project. But I want to believe, this application will be working with those libraries. We'll be not know if we not try, isn't?
Of course I did much refactoring the source code, it's not easy to learning this programming language (Rust), but why I keep want to learning this programming language? Because I think this programming language very strict. I really like the compiler suggesting me how to fix the issue. I think it's similar to Typescript and the result output of application can be executeable or can be installed to any OS. Cost time in building/developing this application are much in reading documentation of libraries and try and retrying how to use the libraries right way. Here the summaries what I did to building API Application.
- Start the project with Tokio Hyper, because I think I need to know how to make API first with this library.
- Develop routing and handlers using Tokio Hyper. For example, devine request path, expected result if success or failed.
- Restruktur skeleton, to implement HTTP GET request can catch request query.
- Implement library Sqlx to this application for communication with database.
- Restruktur skeleton again, because I want to implement transaction for Sqlx. So one or more query failed execute to database bundled query will be rolled back.
Most difficulte process for developing this application are,
- Rust programming language I think most stricted programming language, because in this programming language validating ownership of variable, so we just can use variable with borrowing or cloning the variable.
- I think my implementation transaction for library Sqlx still not perfect and I not yet test it. But at least I know and implemented the transaction for Sqlx. If my implementation is not valid I can change later.
- I have limited reference, because example of code not many publised in internet.
But I still like this programming language and I want to learn and build more using this programming language.
Developing Mobile
Actually I not yet using Kotlin as programming language to build Mobile Application. But I believe I can build and use the application. So I starting project with process,
- Starting with one, two, three sample project from android studio, tutorial and youtube.
- Making layout or page with implementing jetpack compose.
- Building ViewModel to communicating data for Mobile layout with API Application, and add some other library of Ktor to make request to API.
- Add libraries Room and Ksp because I want config of Mobile Application saved in local Mobile and financial data record saved in API Application.
Because it's my first time using Kotlin, jetpack compose, viewmodel and any other libraries, I doing multiple refactor for this application. But I think it's fine, because I can know concept how to Kotlin, jetpack compose and viewmodel working. The most difficulte step to building this application are,
- Because I still green in this type application, all of the process it's feel hard. Each tutorial from internet have difference step how to build Mobile application using Kotlin. Excepting making jetpack compose I think it's the easiest process to building Mobile application.
- The next is, how to communicating data between Mobile Application with API Application. So in this process I discover ViewModel to syncronsynchronize layout with API.
- Because there are 2 way to storing data for this application one on API Application and Local Room, I think it's not easy as just use ViewModel. So I make Base Activity, and any other activity will extended to Base Activity. So each Activity can get config of communicating Mobile with API Application.
- Uploading output of application to Google Play Store. Because right now need a DUNS. And still dont know to request DUNS, I already requested but I still not yet get response from them.
I think developing this type application using Kotlin and Jetpack Compose is more interesting than using Resource Layout. To be honest, I still dont know how to setup layout if I using Resource Layout in Android Studio.
Maybe this is the closing story how I building API and Mobile Application. I like building some application because I want my application can be helping any other people.
(Beta)
1
Organic Traffic.
(Beta)
0
Link in post.
(Beta)
0
Image in post.