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

🛠️ [TASK] : Implement persistence storage #1454

Open
6 tasks
Tracked by #1255
minikin opened this issue Jan 2, 2025 · 0 comments
Open
6 tasks
Tracked by #1255

🛠️ [TASK] : Implement persistence storage #1454

minikin opened this issue Jan 2, 2025 · 0 comments
Labels
dart Pull requests that update Dart code F14

Comments

@minikin
Copy link
Collaborator

minikin commented Jan 2, 2025

Summary

Implement a local storage solution in our Flutter application, following the architectural design and guidelines provided by the architecture team. The primary goal is to enable data caching and offline access (for proposals and comments only for F14 scope.) while ensuring the solution remains scalable and adaptable for future data types.

The solution must work seamlessly on the following platforms: Web, iOS, Android, macOS, Linux, and Windows.

Task Details

  1. Integrate a Local Storage Library

    • Please take a look at the architectural recommendations.
    • Ensure the chosen library supports all target platforms.
  2. Implement the Agreed-Upon Storage Architecture

    • Set up the necessary layers (service/repository, data sources, etc.) according to the architects’ proposed design.
    • Apply dependency injection (DI) patterns for better testability and maintainability.
  3. Caching, Synchronization, and Offline Mode

    • Add logic to store data (proposals and comments) locally and handle synchronization with the backend.
    • Implement a basic conflict-resolution approach for data updates from offline to online.
  4. Performance and Security Optimization

    • Add indexes (if needed) and optimize queries for large datasets.
    • Use encryption or secure storage if recommended by the architectural guidelines.
  5. Basic Testing

    • Cover core functionality with tests: saving, reading, and deleting data, plus offline/online transitions.
    • Ensure these tests run successfully across all major platforms (at least Web, iOS, and Android).

Key Requirements

  • Alignment with Architectural Proposal: Follow the recommended approach and best practices provided by the architecture team, including choice of libraries, DI setup, and class structures.
  • Multi-Platform Support: The implementation must be validated on Web, iOS, and Android at a minimum, with consideration for macOS, Linux, and Windows if feasible.
  • Flexibility and Scalability: The code should be easily extensible for future data types and additional functionality.
  • Security: For sensitive data, ensure encryption and appropriate error handling based on the architectural guidance.

Implementation Steps

  1. Review the Architectural Document

    • Familiarize yourself with the proposed libraries, patterns, and diagrams.
    • Clarify any open questions with the architecture team.
  2. Set Up the Environment

    • Confirm that the project is configured for multi-platform builds (Web, iOS, Android, etc.).
    • Install and configure the chosen local storage library (or libraries).
  3. Establish the Base Structure

    • Create repositories, services, or data sources following the recommended layering strategy.
    • Prepare models (DTOs, entities, etc.) for storing and serializing/deserializing data.
  4. Implement Caching and Sync Logic

    • Add methods to save, read, and delete data from the local storage.
    • Develop a basic sync mechanism:
      • Identify data that needs updating on the backend.
      • Handle possible conflicts (e.g., version mismatches).
  5. Optimize and Test

    • Write unit tests and/or integration tests for core storage and syncing operations.
    • Check performance with larger datasets if possible.
    • Implement security measures (encryption, transactions, etc.) as recommended.
  6. Document the Solution

    • Briefly document key classes/methods (Repository, Service, Models).
    • Note any future improvements or unresolved issues.

Acceptance Criteria

  • A functioning local storage solution is successfully integrated and tested on the Web, iOS, and Android.
  • The implementation follows the architectural recommendations (layered structure, DI, etc.).
  • Local data (proposals, comments, etc.) can be stored, retrieved, and synchronized after going offline.
  • Core operations are covered by tests.
  • Security measures and potential vulnerabilities (encryption, data corruption, etc.) are addressed.
  • Basic documentation is provided for libraries used, key methods, and next steps for improvements.

Additional Notes

  • If you encounter any unanticipated constraints (e.g., a library that does not fully support one of the platforms), document the issue and suggest possible workarounds.
  • A code review and testing session will be scheduled after this implementation to verify that the solution meets all requirements.
@minikin minikin changed the title Implement persistence storage 🛠️ [TASK] : Implement persistence storage Jan 2, 2025
@minikin minikin added dart Pull requests that update Dart code F14 labels Jan 2, 2025
@minikin minikin moved this from New to 📋 Backlog in Catalyst Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dart Pull requests that update Dart code F14
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant