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.
- Host: GitHub
- URL: https://github.com/sebsop/guitar-practice-log
- Owner: sebsop
- License: mit
- Created: 2025-10-19T12:14:48.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2026-04-16T08:48:38.000Z (2 months ago)
- Last Synced: 2026-06-23T03:34:05.276Z (1 day ago)
- Topics: jpa-hibernate, kotlin, kotlin-multiplatform, roomdb, spring-boot, websockets, workmanager
- Language: Kotlin
- Homepage:
- Size: 537 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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).