Giter Club home page Giter Club logo

keypod's Introduction

KeyPod — Simple Key Value Store

An ANU Software Innovation Institute demo project for Solid Pods

Authors: Graham Williams, Anushka Vidanage, Jessica Moore, Zheyuan Xu, Kevin Wang, Ninad Bhat, Dawei Chen.

ANU Software Innovation Institute

License: GNU GPL V3

Introduction

KeyPod is a simple key value data store app that can be used as a template and to demonstrate a Flutter app utilising data stored in Solid Pods.

The app is a simple tool for displaying a table of pairs of keys and values. You can add new pairs, edit the pairs, and delete the pairs, and have the changes saved to your Solid Pod.

On starting the app you will be presented with the solidpod login screen (using SolidLogin() from solidpod).

KeyPod Login

Here you have the option to Login to your Solid Pod before you use the functionality of the app. Alternatively you can Continue to the app without a log in. Many apps will provide some functionality without access to your actual data, and when access is needed the app can call solidLoginPopup() from the solidpod package to login in to your solid pod.

If you don't have a Solid Pod yet then you can Register for one on a Solid server. The Info button can be tapped to browse more information about the app.

Getting Started with Flutter

This project is a starting point for a Flutter application utilising Solid Pods.

A few resources to get you started if this is your first Flutter project using Solid Pods:

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Acknowledgements

Images were generated using Bing Image Creator from Designer, powered by DALL-E3.

The app was developed by the Software Innovation Institute of the Australian National University.

keypod's People

Contributors

anushkavidanage avatar cdawei avatar gjwgit avatar junhaow1 avatar ninadbhat avatar zheyxu avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

jaxiii junhaow1

keypod's Issues

KEYPOD: Additional actions for the table

User Story

I am using my keypod to store my secret passwords.

Can we have additional actions like COPY to copy the VALUE into the clipboard, and an EYE to toggle showing the VALUE and showing ******* instead.

KEYPOD: Override package intl with version 0.19.0

solid-auth requires intl: ^0.19.0 while other dependencies of solidpod depends on intl: ^0.18.0, we need to override the version of intl by add the line

intl: ^0.19.0

in the dependency_overrides section of pubspec.yaml.

KEYPOD HOME: New LOGOUT button

Add a logout button up the top next to the About button in the Keypod app using a logout icon.

Same functionality as the "Forget Remote Solid Server Login Info" - presumably a single function call to solidpod.

KEY POD: Restructure the app to ready for release

Description

In preparation for releasing the app change the work flow for KEY POD to be:

SolidLogin page

  • As it currently is with: Login | Continue | Register | Info
  • Info link to keypod repo README.md)

KeyValue Table

This becomes the first page (home) of the app

Replace Home button with Testing to go to the testing page.

Testing page

Go Back to go back to the main app page

KEY POD: Clicking "Show private data" right after POD is intialised shows POD initialisation page instead of file content

If a POD is not initialised, it seems there is a bug for showing private data using the following steps:

  1. Start Keypod and click Login
  2. The app goes to the POD intialisation page after successfully logging in, enter your security key (called password) and click "SUBMIT"
  3. The app goes to the test page with many buttons, click "Show private data"

Now Keypod should show the page with private key-value pairs, but instead it shows the POD initialisation page.

KEYPOD: Add initial GUI for viewing data from POD

Description

Replace the placeholder Text widget with a simple text view widget to display the current contents of the key-value-note data from the POD.

Why

So that we have a very simple app that shows encrypted data reading from a POD.

KEYPOD HOME: Replace SAVE button with icon

It might be nice to be consistent with having icons up the top right for SAVE (I've done TESTING).

The SAVE icon should be grey until the data changes and then it becomes black.

Image

KEY POD: License is GPL not MIT - fix the source files.

I tend to make apps GPLv3 (so others that build on our freely given work in the app need to make their code freely available too if they distribute it) and libraries MIT (so they can be freely used without the viral nature of the GPL)

The appropriate license is in license.dart (for dart file headers) and in LICENSE.

KEY POD: Refactor

Opinionated structure:

lib/
  main.dart
  home.dart
  app.dart
  features/
    key_edit.dart
  constants/
  utils/
  widgets/

KEY POD: Understand and resolve the context sync gaps

Description

How can we resolve the following issue.

$ flutter analyze lib
Analyzing lib...                                                        

   info • Don't use 'BuildContext's across async gaps • lib/home.dart:130:51 • use_build_context_synchronously
   info • Don't use 'BuildContext's across async gaps • lib/home.dart:140:9 • use_build_context_synchronously

2 issues found. (ran in 0.8s)

KEYPOD: Show ID/webID of logged-in user

Anushka suggested that we could show the ID/webID of logged-in user in the keypod app, as is commonly done in many apps.

Also add an indicator if a user has not logged in.

For example, at the top-/bottom-left corner, show the user's webID if logged in, or display "Not logged in".

KEYPOD: Add Logout button on the test page

Implement a logout button on the test page (home.dart) for users to logging out the app. It should call the logout function from solidpod. This is the front end task for anusii/solidpod#118

TODO:

  • Add a logout button on page home.dart
  • Remove the back arrow at the top-left of page home.dart

KEY POD: Exception on startup

Description

I start up the dev branch (and the PR branches), click CONTINUE or LOGIN and I get the following exception which needs to be caught or fixed:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:solidpod/src/solid/utils/rdf.dart': Failed assertion: line 73 pos 14: '!(dataMap[sub] as Map).containsKey(pre)': is not true.
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      parseTTL (package:solidpod/src/solid/utils/rdf.dart:73:14)
#3      loadPrvTTL (package:solidpod/src/solid/utils/misc.dart:91:12)
<asynchronous suspension>
#4      KeyManager._loadIndKeyFile (package:solidpod/src/solid/utils/key_management.dart:500:17)
<asynchronous suspension>
#5      KeyManager.hasIndividualKey (package:solidpod/src/solid/utils/key_management.dart:394:7)
<asynchronous suspension>
#6      readPod (package:solidpod/src/solid/read_pod.dart:67:11)
<asynchronous suspension>
#7      HomeScreenState._writePrivateData (package:keypod/screens/home.dart:129:27)
<asynchronous suspension>

The GUI just shows:

Image

KEYPOD: Why does the appname need to be passed to the home screen

Description

In lib/screens/home.dart we see the following doc and requirements to have appname passed to the Home widget. Why is that required as a parameter? Could we not determine the appname from the pubspec as in:

              final appNameVersion = await getAppNameVersion();

So That

The template app is simple and demonstrative of the best approach.

Closing Criteria

  • Decide if to remove the appName parameter

If removed:

  • The appname is obtained within the Home class
  • The appname is displayed in the AppBar title
  • The appname is displayed in the About popup
  • The app continues to function as before

Detail

From home.page

/// Widget represents the home screen of the application.
///
/// It only requires [appName] to be passed to it during initialization.
/// This is because this page is designed to be work in offline as well.

class Home extends StatefulWidget {
  /// Initialise widget variables

  const Home({required this.appName, super.key});
  final String appName;

KEYPOD: Split About Dialog into own file about.dart

Description

Migrate the current showAboutDialog in home.dart to its own file about.dart

So That

To unclutter home.dart and so reduce the number of lines in the file in accordance with style guidelines and to have a nice simple template app source code.

Closing Criteria

  • The app works just the same

KEY POD: Add a button in the TESTING page to go back to the HOME page

User Story

I have started up KEYPOD and going in to KEYPODS I see that I am already logged in. I want to test the login so I click GO BACK and then go to TESTING to forget the local login information. But I can't get back to the home screen

Image

Like on the KEYPAD table screen, can we please have a back button.

Image

KEYPOD: Widget to view, insert, edit, delete rows of key-value pairs

User Story

As a user of the keypod demo and template app the home screen will have a button view with two buttons and an about along the bottom. This will mimic a typical app that I as the app builder might construct.

The first button KEYPODS will be this new table display of the key value pairs, able to edit, save, delete the entries that are stored in my POD.

The second button TESTING is then the current Test page with miscellaneous testing buttons like it is now.

The ABOUT is aligned to the right and is the usual about popup.

Depends

Description

This milestone is to implement a simple widget in keypod that is displayed as the home page.

Why

This will demonstrate the readPod and witePod functionality and will then essentially be the final KeyPod demonstrator app.

Closing Criteria

  • App has two buttons KEYPODS and TESTING and an ABOUT button along the bottom.
  • The keypod page will display a table with two columns for a key and a value.
  • Two buttons are available LOAD and SAVE
  • If already logged into the solid pod (initial SolidLogin) the table is populated with data from the Solid Pod
  • If already logged into the solid pod (initial SolidLogin) the LOAD button is greyed out (data already loaded)
  • If not already logged into the solid pod (initial SolidLogin) the LOAD button is active
  • When the LOAD button is tapped it will call SolidLoginPopup to ensure the user is already logged in and then lload the data into the table.
  • If there is no data in the solid pod (e.g., expected data file not found) then table is empty and LOAD becomes greyed out
  • Each row in the table can be deleted, edited
  • A new row can be inserted to add a new key-value entry
  • After any change is made to the data the SAVE button (originally greyed out) becomes active
  • Changes are saved to the Solid Pod when the SAVE button is tapped.
  • The table can not be changed unless the LOAD button has been tapped. First time we have just an empty table.

KEYPOD: In the About dialog show my WebID

User Story

As an end user I want to see my WebID that I logged in with somewhere. Perhaps a good place for it is in the About dialog, just before the Authors: put "Your WebID is: https://....."

Image

KEYPOD: Relocate installers

Installers (binary files in the installers/ folder) usually change in every release, so it may not be a good idea to put them in the git repository.

A better option might be attaching them with a particular release of the main branch (GitHub allows to upload binary files when creating a release).

KEYPOD: Login animation on home page cannot be cancelled

Image
The animation is there forever and clicking the "Cancel" button seems to change nothing.

To reproduce:

  1. Start the keypod app, click "Login" and log into a POD
  2. In the home page, click the back arrow at the top left to go back to the login page
  3. Click the "Login" button again

KEYPOD: Update index.html

When building keypod for chrome (using Flutter 3.22.2), it warns

Warning: In index.html:37: Local variable for "serviceWorkerVersion" is deprecated. 
Use "{{flutter_service_worker_version}}" template token instead.

Warning: In index.html:46: "FlutterLoader.loadEntrypoint" is deprecated.
Use "FlutterLoader.load" instead.

Update the index.html to resolve this.

KEYPOD: "You have successfully logged in" Full-Screen Message to Pop-Up Widget

Description

After inputting the security key, the message "You have successfully logged in" currently displays as a full-screen message. This should be changed to a pop-up widget to enhance user experience and avoid disrupting the user workflow. The pop-up widget will appear in the center of the screen and allow users to easily dismiss it or proceed with their activities without the need to navigate away from the current page.

Why

Displaying the login success message as a pop-up widget rather than a full-screen message improves the user experience by minimizing interruptions and maintaining context. Full-screen messages can be intrusive and disorienting, especially if users are in the middle of a task. A pop-up widget provides a more subtle notification, allowing users to acknowledge the message without losing their place or flow in the application. This change is crucial for maintaining a seamless and efficient user interface, ensuring that users can continue their activities with minimal disruption.

Closing Criteria

  • The "You have successfully logged in" message is displayed as a pop-up widget in the center of the screen.

  • Users can easily dismiss the pop-up widget or proceed with their activities without navigating away from the current page.

  • The pop-up widget does not obstruct any essential elements of the current page and maintains the overall user workflow.

KEYPOD TESTING: Add unit testing to ensure over 90% coverage

Description

$ make coverage
COVERAGE
00:01 +1: All tests passed!                                                                                                                        

+---------------------------+-------+------+-------+
| file                      | lines | hits | cover |
+---------------------------+-------+------+-------+
| lib/main.dart             | 34    | 24   | 71    |
| lib/utils/is_desktop.dart | 2     | 0    | 0     |
| total                     | 36    | 24   | 67    |
+---------------------------+-------+------+-------+

The code coverage is too low: 67%. Expected at least 90%.
make: [support/flutter.mk:261: coverage] Error 1 (ignored)

------------------------------------------------------------------------

KEYPOD: Enhance DataTable Interaction: Implement Sortable Columns by Clicking Headers

Description

Implement sortable columns in the DataTable to enhance data interaction capabilities by allowing users to sort data by clicking on the column headers. Currently, our DataTable allows viewing, inserting, editing, and deleting rows of key-value pairs, but lacks the functionality to sort columns directly from the user interface. This feature would enable users to organize data more efficiently and find required information faster by simply clicking on the headers of any column.

Why

Introducing sortable columns will significantly improve the user experience by providing a dynamic way to manage and view data. Sorting is a critical feature for data tables as it helps users prioritize, organize, and make quicker decisions based on key data points. This functionality is particularly important in environments with large datasets, enabling users to easily ascend or descend data according to any column. It is essential for enhancing data readability and operational efficiency within the platform.

Closing Criteria

  • Clicking a DataTable column header toggles between ascending and descending order for that column.

  • Visual indicators (such as arrows or highlights) are displayed on the column headers to show the current sort order.

  • Ensure that sorting persists during pagination, insertion, editing, or deletion of rows.

SOLID: Add initial dependency

Description

Add dependency on the solid package from git to puspec.yaml.

Why

So that we can test the workflow for a private repository in our app build before we make the library public.

Closing Criteria

  • Test that we can use the Calculate class in the keypod main.dart
    final calculator = Calculator();
    print('{calculator.addOne(2)} == 3');
    print('{calculator.addOne(-7)} == -6');
    print('{calculator.addOne(0)} == 1');

KEYPOD: Fix Duplicate Key Exception in Key-Value Pair Editor

Description

In our key-value pair editor, it is currently possible to add the same key twice. However, when clicking "Save," this leads to an exception. This issue needs to be addressed by implementing a check for duplicate keys before saving to the POD. The system should alert the user to any duplicates and prevent saving until the issue is resolved.

Why

Preventing duplicate keys is crucial to maintaining data integrity and avoiding runtime exceptions. Allowing duplicates can lead to unpredictable behavior and potential data corruption. By ensuring that each key is unique before saving, we can provide a more robust and user-friendly experience. This fix will prevent users from encountering errors and ensure that data is stored correctly.

Closing Criteria

  • Implement a check for duplicate keys in the key-value pair editor before saving.

  • Display an alert to the user if duplicate keys are detected, specifying the duplicate keys.

  • Prevent the save operation if duplicate keys are present until the user resolves the issue.

  • Conduct thorough testing to ensure no exceptions occur due to duplicate keys.

  • Update documentation to reflect the new validation checks and user alerts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.