Kundvagn · 2021 · university project
Kundvagn - Shopping Cart Android App
A university project: an Android shopping-cart app in Kotlin. The part I cared about was sync: two phones, one cart, and Firestore keeping them honest in real time.
- Layers
- interface, application, data
- Built with
- Kotlin · Android SDK · Firebase · Firestore · Mobile Development
- Elsewhere
- source on GitHub
- 1Firebase Auth · sign-in, one cart per user
- 2Snapshot listener · every device hears every write
- 3Document path · carts/{uid}/items/{id}
- 4Offline queue · writes wait locally, then replay
- 5Total · recomputed on every change
The problem
A university project in Android development with a brief that sounds simple: a shopping-cart app. The hard part was the one I chose to care about: two phones, one cart, and the cart never disagreeing with itself.
What I built
Kundvagn, Swedish for shopping cart, in Kotlin, with Firebase Authentication1 for sign-in and Firestore for the cart itself3. The cart is a live query: a snapshot listener2 keeps every signed-in device in sync in real time, so an item added on one phone shows up on another within a moment. Around that core: product management, automatic totals5, and a Material Design interface kept deliberately plain.
What I learned
Real-time sync is a user-experience feature before it is a technical one. The moment two devices show different totals, trust is gone. I also learned to keep the app thin and let the backend own the truth, a habit that has served me in every system since.