case_study/qurbanku.kt

Qurbanku

An Android app that lets a mosque's qurbani committee and its congregation organize and jointly fund qurbani animals, from publishing an animal to verifying every payment.

Role
Sole Android developer
Context
Undergraduate thesis, built for Masjid Al Huda, Malang
Timeline
Sep 2023 — Jul 2024
Stack
Kotlin · MVVM · Firebase · CameraX · Google Maps
Qurbanku home screen listing nearby mosques
01_problem.kt

The problem

Every Eid al-Adha, mosque committees collect money for shared qurbani animals. A cow is usually split between seven people, so one animal means seven payments to chase and confirm. This is usually coordinated through chat groups, paper lists, and bank transfers checked by hand, which leads to three problems:

  • No single source of truth. Which shares are still open lives in someone's notes or chat history.
  • Slow payment checks. Proofs of transfer arrive as chat photos, mixed in with everything else.
  • Little visibility for congregants. Participants have to ask whether their payment was received or their animal has been slaughtered.
02_solution.kt

How it works

Two roles share one app. Each signs up separately and lands on its own home screen.

  1. Committee

    Publishes an animal

    Species, weight, price, operational costs, number of shares, and a photo from the in-app camera.

  2. Congregant

    Finds a mosque and joins

    Browses mosques on a list or map, sees the cost per share and seats left, and uploads proof of transfer.

  3. Committee

    Verifies the payment

    Reviews the proof, then accepts it, which reserves the share, or rejects it with a note.

  4. Both

    Track it to the end

    The committee marks the animal as slaughtered, and congregants see every status in their history.

03_architecture.kt

Architecture

MVVM with a repository layer. Screens only talk to ViewModels, and only repositories touch the Firebase SDKs.

04_decisions.kt

Key decisions

01

Shares are reserved only after payment is verified

Joining creates a pending transaction, not a seat. A congregant is added to the animal's participant list with FieldValue.arrayUnion only when the committee accepts the proof, which also prevents duplicates. Seats left are calculated from that list, and the join button disables itself when the animal is full or already slaughtered.

02

An in-app camera for reliable proof photos

Proofs of transfer and animal photos are taken with CameraX, with gallery upload as a fallback. Before upload, each photo has its rotation fixed and is compressed to under 1 MB, which keeps uploads fast on mobile data and Storage costs low.

03

Location first, address second

The committee picks the mosque's position on a Google Map instead of typing an address. The app stores coordinates and turns them into a readable address with the Geocoder, so congregants can find nearby mosques on a map using Fused Location.

04

One user model, two roles

Both roles live in a single user collection with an admin flag. At login, the app checks that the chosen role matches the stored one before routing to the committee or congregant home. One-shot results like login and registration use a SingleLiveEvent, so they don't fire again on rotation.

05_demo.kt

Demo

06_retrospective.kt

What I'd do differently today

Qurbanku was my first full app from idea to thesis defence. Looking back with production experience, these are the changes I would make:

  • Enforce seat limits atomically. Accepting a payment updates the transaction and the participant list in two separate writes, and doesn't re-check capacity. A Firestore transaction would make both writes succeed or fail together and reject an animal that is already full.
  • Coroutines and Flow instead of nested callbacks. Repositories use callback chains. Suspending functions with await() and Flow would flatten them and make errors easier to handle.
  • Hilt for dependency injection instead of a hand-written ViewModelFactory.
  • Tests. Unit tests for ViewModels and repositories with the Firebase Emulator Suite, which the project doesn't have yet.
  • Security rules and key restrictions reviewed as part of the release, not after it.

> cd ../projects

Want to see more?