Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Online Update Mechanism for Absolute Azkar JSON #66

Open
14 tasks
AbdelrahmanBayoumi opened this issue Aug 3, 2024 · 0 comments
Open
14 tasks
Labels
enhancement New feature or request

Comments

@AbdelrahmanBayoumi
Copy link
Owner

Description:

I want to have the Absolute Azkar list managed online in a JSON file hosted on GitHub, so that I can easily update and maintain the Azkar without needing database migration scripts. The app should automatically check for updates and download the latest version of the JSON file. Additionally, the app should handle local CRUD operations on Azkar without conflicts when updates are downloaded.

Acceptance Criteria:

  1. Online JSON Hosting:

    • The Absolute Azkar list should be stored in a JSON file hosted on GitHub.
    • The JSON file should be versioned using GitHub releases.
  2. Check for Updates:

    • The app should check for the latest version of the JSON file on GitHub.
    • If a new version is available, the app should download and replace the local JSON file.
  3. Local CRUD Operations:

    • Each Zekr should have a unique UUID.
    • The app should allow users to perform CRUD operations (Create, Read, Update, Delete) on Azkar locally.
    • Local changes should be stored separately to avoid conflicts with updates.
  4. Conflict Resolution:

    • When a new version of the JSON file is downloaded, the app should merge local changes with the updated JSON.
    • Local additions should be appended to the merged list if they don't exist in the updated JSON.
    • Local updates should overwrite existing Azkar based on UUID matching.
    • Deleted Azkar should be removed from the updated JSON based on UUID matching.
  5. Version Management:

    • The app should store the version number of the currently used JSON file locally.
    • After merging, the app should update the local version number to match the downloaded JSON.

Tasks:

  1. Store Azkar in JSON Format Online:

    • Create a JSON file with the Absolute Azkar list.
    • Host the JSON file on GitHub and create a release.
  2. Check for Updates:

    • Implement a feature to check for the latest version of the JSON file on GitHub.
    • Use the GitHub API or HTTP requests to fetch the latest release version.
    • Compare the local version with the latest version and download the updated JSON if necessary.
  3. Download and Replace JSON:

    • Implement functionality to download the latest JSON file and replace the local version.
    • Store the JSON file locally for offline functionality.
  4. Handle CRUD Operations with UUIDs:

    • Assign a unique UUID to each Zekr in the JSON file.
    • Load the JSON file and maintain a map of UUIDs to track Azkar.
    • Implement CRUD operations for Azkar with UUID tracking.
  5. Merge Local Changes:

    • Implement conflict resolution logic to merge local changes with the updated JSON.
    • Append new local Azkar, overwrite updates, and remove deleted Azkar based on UUID matching.
  6. Version Management:

    • Store the version number of the currently used JSON file locally.
    • Update the local version number after merging with the downloaded JSON.

Additional Information:

  • Ensure the app can function offline by storing the JSON file locally.
  • Handle network errors gracefully when checking for updates or downloading the JSON file.
  • Provide user feedback when updates are downloaded and merged successfully.

Example JSON Structure:

[
  {
    "uuid": "123e4567-e89b-12d3-a456-426614174000",
    "text": "الحمد لله",
    "timestamp": "2024-08-03T12:00:00Z"
  },
  ...
]
@AbdelrahmanBayoumi AbdelrahmanBayoumi added the enhancement New feature or request label Aug 3, 2024
@AbdelrahmanBayoumi AbdelrahmanBayoumi moved this to 🚢 Todo in Azkar Roadmap Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🚢 Todo
Development

No branches or pull requests

1 participant