An open API service indexing awesome lists of open source software.

https://github.com/sebsop/guitar-practice-log

Guitar Practice Log Mobile App with Kotlin Multiplatform and Android, offline support, and real-time sync via REST/WebSockets with a Spring Boot + JPA server.
https://github.com/sebsop/guitar-practice-log

jpa-hibernate kotlin kotlin-multiplatform roomdb spring-boot websockets workmanager

Last synced: 1 day ago
JSON representation

Guitar Practice Log Mobile App with Kotlin Multiplatform and Android, offline support, and real-time sync via REST/WebSockets with a Spring Boot + JPA server.

Awesome Lists containing this project

README

          

# 🎸 Guitar Practice Log - Mobile App

A project built with **Kotlin Multiplatform** for cross-platform UI and **native Android/Kotlin** for the full app, paired with a **Spring Boot + JPA + Hibernate** server.
It tracks guitar practice sessions with full offline support and automatic synchronization to the custom REST server.

## πŸ“– Assignment / Course Requirements

The project follows the requirements laid out by the course instructor; see full lab plan [here](https://www.cs.ubbcluj.ro/~dan/ma/labPlan.html)

---

## πŸ“Έ App Mockups - Practice List View + Edit Form (Online/Offline)





---

## πŸ“Œ Overview

The **Guitar Practice Log App** is a simple, intuitive tool for guitar players who want to keep track of their practice sessions. Each session includes:

* Song title
* Date
* Duration
* Focus area (e.g., rhythm, chords, solo)
* Optional notes

The app works **fully offline** and automatically synchronizes all changes with a remote server when the device reconnects.

---

## 🧩 Core Features

### βœ” CRUD for Practice Sessions

Each **PracticeSession** contains:

| Field | Type | Description |
| ------------------ | ------- | ------------------------------------------- |
| ID | Integer | Unique identifier (server/local DB managed) |
| Song Title | Text | Song or exercise practiced |
| Date | Date | Practice day |
| Duration (minutes) | Number | Session length |
| Focus Area | Text | Main skill trained |
| Notes | Text | Optional notes |

### CRUD Behavior

* **Create:** Add a new practice session using a dedicated form with full field labels and validation.
* **Read:** All session details are displayed directly in the list.
* **Update:** Tapping a session opens the edit form, where all fields are pre-populated and can be modified.
* **Delete:** Remove a session using a confirmation dialog; the item is properly identified by its ID.

---

## πŸ“΄ Full Offline Support

All operations work offline and survive app restarts:

| Operation | Offline Behavior |
| --------- | --------------------------------------------------------------------------------- |
| Create | User is notified that the server is offline; the new session is saved locally and queued for sync. |
| Read | Local cached data is displayed, along with a notice that the server is offline. |
| Update | User is notified that the server is offline; changes are saved locally and queued as β€œPending Update.” |
| Delete | User is notified that the server is offline; the item is removed locally and queued as β€œPending Deletion.” |

### πŸ”„ Automatic Sync on Reconnection

When connection returns:

* All pending creates/updates/deletes sync to the server
* Conflicts are detected & resolved directly
* Local DB is refreshed to match server state

### 🎯 Bonus Feature Implemented

**Advanced Background Sync using WorkManager**

* Ensures robust syncing even after app closures or long offline periods
* Handles retries & linear backoff

---

## 🌐 Server Integration

The server is **implemented manually** using **Spring Boot**, **JPA**, and **Hibernate** (no Firebase, no serverless platforms).
Communication uses **REST + WebSockets**:

* **REST** -> main CRUD operations
* **WebSocket** -> real-time updates pushed to the Android client
* Both the client and server include **full debug logging**

---

## πŸ“ Project Structure

```
root
β”œβ”€β”€ idea/ # App concept and domain documentation
β”œβ”€β”€ non-native/ # Kotlin Multiplatform UI-only version
β”‚ └── (KMP UI CRUD with list, create, update, delete)
β”œβ”€β”€ native/ # Full Android implementation
β”‚ β”œβ”€β”€ frontend/ # Android client
β”‚ β”‚ β€’ Local DB (Room)
β”‚ β”‚ β€’ Repository layer
β”‚ β”‚ β€’ Offline caching
β”‚ β”‚ β€’ WorkManager background sync
β”‚ β”‚ β€’ REST client + WebSocket client
β”‚ └── backend/ # Spring Boot server (REST + WebSockets, JPA + Hibernate)
└── README.md # Project documentation
```

---

## πŸ† Evaluation Criteria (All Achieved at β€œExcellent”)

> **Project evolution note:**
>
> * The **non-native Kotlin Multiplatform module** includes **only the UI-only version** (list, create, update, delete).
> * The **native Android module** evolved through **three complete stages**:
> **UI-only β†’ Local Database β†’ Full Server Integration (REST + WebSockets + Offline Sync)**.

---

### 1. **Kotlin Multiplatform – UI-only Version**

* βœ” Recycler/list view with ViewModel + repository
* βœ” No full list/adapter rebuilds
* βœ” Dedicated screens for create & update
* βœ” Field labels, validation, correct pre-population
* βœ” Delete with confirmation

---

### 2. **Native Android – Local Database Version**

* βœ” Values retrieved once, observed via LiveData/Flow
* βœ” Clean repository pattern + background coroutines
* βœ” DB-managed IDs (user never sees internal ID)
* βœ” Update reuses the same DB entity (no delete-and-recreate)
* βœ” Persistence errors shown to user and logged
* βœ” Delete uses only the item ID
* βœ” All DB operations fully logged

---

### 3. **Native Android – Server-Connected Version**

* βœ” Fully custom server (Spring Boot + JPA + Hibernate)
* βœ” REST for CRUD + WebSockets for live updates
* βœ” Complete offline support for Create/Read/Update/Delete
* βœ” Data retrieved once and reused; real-time push updates
* βœ” Create/Update/Delete marshaled cleanly with correct IDs
* βœ” All server operations executed on background coroutines
* βœ” Friendly validation & error UI (no raw exceptions shown)
* βœ” Full debug logging on both client and server
* βœ” Advanced offline-to-online sync using WorkManager

---

## βœ… Summary Table

| Feature | Online | Offline |
| -------------- | --------- | -------------------- |
| View Sessions | βœ” | βœ” (cached) |
| Add Session | βœ” | βœ” (pending sync) |
| Update Session | βœ” | βœ” (pending update) |
| Delete Session | βœ” | βœ” (pending deletion) |
| Auto Sync | Automatic | On reconnection |

---

## πŸ“„ License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---

## πŸ’‘ Contact

Questions, feedback, or ideas? Reach out anytime at [sebastian.soptelea@proton.me](mailto:sebastian.soptelea@proton.me).