{"id":31727123,"url":"https://github.com/r-siddiq/gymlog","last_synced_at":"2026-05-04T13:35:34.090Z","repository":{"id":314648744,"uuid":"1055268350","full_name":"r-siddiq/GymLog","owner":"r-siddiq","description":"Android workout tracker using Java, MVVM, Room, LiveData; logs exercises per user, displays lists with RecyclerView, handles login, persists LocalDateTime via TypeConverter, Gradle-based build configuration.","archived":false,"fork":false,"pushed_at":"2025-09-13T19:14:13.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-13T21:22:04.734Z","etag":null,"topics":["android-application","dao","gradle","lifecycle","mvvm","room","sqlite","viewbinding","viewmodel","xml"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-siddiq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-12T02:56:24.000Z","updated_at":"2025-09-13T19:14:17.000Z","dependencies_parsed_at":"2025-09-13T21:22:56.211Z","dependency_job_id":"a9729d0c-409f-4f0d-9beb-8aff3170e391","html_url":"https://github.com/r-siddiq/GymLog","commit_stats":null,"previous_names":["r-siddiq/gymlog"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/r-siddiq/GymLog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-siddiq%2FGymLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-siddiq%2FGymLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-siddiq%2FGymLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-siddiq%2FGymLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-siddiq","download_url":"https://codeload.github.com/r-siddiq/GymLog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-siddiq%2FGymLog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000853,"owners_count":26082950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-application","dao","gradle","lifecycle","mvvm","room","sqlite","viewbinding","viewmodel","xml"],"created_at":"2025-10-09T06:18:25.208Z","updated_at":"2025-10-09T06:18:29.616Z","avatar_url":"https://github.com/r-siddiq.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gym Log\n\nAn Android app for tracking workouts with a clean MVVM architecture, Room persistence, and a modern Android 14 (SDK 34) target. For sample I/O traces and additional information, visit the project page:  \nhttps://www.rsiddiq.com/software-design.html\n\n## Highlights\n- **Android SDK 34** (`minSdk=34`, `targetSdk=34`, `compileSdk=34`)\n- **Language:** Java\n- **Architecture:** MVVM (Activities → ViewModel → Repository → Room)\n- **Persistence:** Room Database with entities for `User` and `GymLog`\n- **Reactive UI:** LiveData-backed queries and a RecyclerView adapter\n- **Type safety:** `LocalDateTime` persisted via a custom `TypeConverter`\n- **Build:** Gradle Kotlin DSL\n\n---\n\n## Features\n- Create accounts and log in (basic username/password model with optional admin flag).\n- Add and view workout entries (exercise, weight, reps, timestamp).\n- Per-user filtering of logs with queries ordered by most recent first.\n- Lifecycle-aware data observation via LiveData.\n- RecyclerView-based list rendering with a compact `ViewHolder`/`Adapter` layer.\n\n\u003e Note: The database is configured with `fallbackToDestructiveMigration` (no auto-migrations defined yet). This simplifies local development but will drop data on schema changes during upgrades.\n\n---\n\n## Project Structure\n\n```\napp/\n  src/main/java/com/gymlog/\n    LoginActivity.java\n    MainActivity.java\n    viewHolders/\n      GymLogAdapter.java\n      GymLogViewHolder.java\n      GymLogViewModel.java\n    database/\n      GymLogDatabase.java        # Room database, builder with fallbackToDestructiveMigration\n      GymLogRepository.java      # App data access facade, wraps DAOs\n      GymLogDAO.java             # Queries for GymLog\n      UserDAO.java               # Queries for User\n      entities/\n        GymLog.java              # @Entity(id, exercise, weight, reps, date, userId)\n        User.java                # @Entity(id, username, password, isAdmin)\n      typeConverters/\n        LocalDateTypeConverter.java   # Map LocalDateTime \u003c-\u003e Long/String\n  src/main/res/                  # Layouts, strings, colors, themes\n  src/androidTest/...            # Instrumented test scaffold\n  src/test/...                   # Unit test scaffold\nbuild.gradle.kts                 # Top-level build config\napp/build.gradle.kts            # Android app module (Room, AppCompat, Material, etc.)\nsettings.gradle.kts             # Repos, plugin management\ngradle/libs.versions.toml       # Centralized dependency versions\n```\n\n---\n\n## Data Model\n\n### `User`\n| Field    | Type     | Notes                |\n|----------|----------|----------------------|\n| id       | int (PK) | Auto-generated       |\n| username | String   | Unique handle        |\n| password | String   | Plain-string storage (demo only) |\n| isAdmin  | boolean  | Optional privilege   |\n\n### `GymLog`\n| Field    | Type          | Notes                         |\n|----------|---------------|-------------------------------|\n| id       | int (PK)      | Auto-generated                |\n| exercise | String        | Exercise name                 |\n| weight   | double        | Working weight                |\n| reps     | int           | Repetitions                   |\n| date     | LocalDateTime | Stored via `LocalDateTypeConverter` |\n| userId   | int (FK)      | Owner (User.id)               |\n\n**Key DAO methods**\n- `GymLogDAO.getRecordsByUserId(...)` / `getRecordsByUserIdLiveData(...)` – latest-first ordering.\n- `UserDAO.getUserByUserName(username)` and `getUserByUserId(id)` for auth/lookup.\n\n---\n\n## Build \u0026 Run\n\n### Prerequisites\n- Android Studio Giraffe or later\n- Android SDK Platform 34\n- JDK 17+\n\n### Steps\n1. Clone or unzip the project.\n2. Open the root folder in **Android Studio**.\n3. Let Gradle sync dependencies.\n4. Use the **app** run configuration to build \u0026 deploy to an emulator or device (Android 14 recommended).\n\n**Gradle (Kotlin DSL) dependencies include:**\n- AppCompat, Material, Activity, ConstraintLayout\n- Room (`runtime` + `compiler` via `annotationProcessor`)\n- JUnit / AndroidX Test / Espresso\n\n---\n\n## UI Flow (High Level)\n- **LoginActivity**: Captures credentials and resolves the active `User` via `UserDAO`/`Repository`.\n- **MainActivity**: Displays logs for the active user with a `RecyclerView` (`GymLogAdapter`/`GymLogViewHolder`), plus input fields for adding an entry. `GymLogViewModel` exposes LiveData lists to keep the UI in sync.\n\n---\n\n## Quality \u0026 Security Notes\n- Passwords are stored as plain strings for simplicity. Consider adding hashing (e.g., BCrypt) and input validation for production scenarios.\n- The database uses `fallbackToDestructiveMigration`. For persistence across app upgrades, define Room migrations and remove the fallback.\n- Ensure null/empty input handling for weight/reps; current code logs and continues on parse errors.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-siddiq%2Fgymlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-siddiq%2Fgymlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-siddiq%2Fgymlog/lists"}