Git Product home page Git Product logo

librarian_app's Introduction

Librarian

About

Librarian is the first app in Library OS. It is intended to be used by volunteers or employees of a lending library to record inventory, manage members, and check items in/out.

Running the app

Set environment variables

API_HOST (http://localhost:8088/lending)
API_KEY
APP_URL
SUPABASE_URL
SUPABASE_PUBLIC_KEY

Supabase variables are required for production environments, but not for local development.

Launch in Chrome

flutter run -d chrome

For a better debugging experience, use the Flutter dev tools in Visual Studio Code.

Project Structure

The repository is organized "feature-first," so things become more specific as you go down the folder hierarchy.

  • core folders contain Business Logic.
  • data folders contain Repostories.
  • models contains Models or ViewModels.
  • providers folders contain Providers, which maintain shared app state and notify widgets of changes.
  • widgets folders contain UI Widgets (and controllers) that compose larger widgets or pages.
  • pages folders contain UI widgets that represent pages. These are generally wrapped in a Scaffold widget.

librarian_app's People

Contributors

dillonfagan avatar jcm427 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

librarian_app's Issues

'New Update Available' Modal

When a new version of the app is deployed, the user sees a modal that prompts them to reload/update the app.

Dev Notes

  • We can accomplish this by including a json file hosted at the root of the app, which includes the current version.
  • The version is loaded at runtime and then a periodic event checks the file every few hours.
  • If the version in the most recent response is different than the one current loaded, then there is an update available.

Create Loan / Show loading indicator when selecting loan borrower

When the user clicks the Borrower field to select the borrower for a new loan, there is a network delay. The user often instinctively clicks again, causing the wrong borrower to become selected. We should add a loading indicator or a similar solution to solve this problem.

View and edit thing image in thing details pane

Requirements

  • Image of the thing is visible in the details pane
  • When hovering over the image, icon buttons appear, indicating that it can be removed or replaced
  • Pressing the delete button removes the image and is considered an unsaved change
  • Pressing the replace button immediately prompts for a replacement, then is considered an unsaved change

Borrower data can be stale when opening a new loan

Sometimes, members might join just minutes before borrowing from the library. The app holds onto cached data, however. So there are cases where someone might not appear in the list, requiring the user to refresh the page.

Edit Borrower Details

From Borrower Details, the user can edit the following details:

  • Name
  • Email address
  • Phone number

Loan Details

  • Borrower
  • Thing
  • Checked out date
  • Due back date
  • Checked in date (if closed)
  • Notes

From this screen, Alice can edit the details of a given loan or close it.

Create Thing is a page on mobile

Currently, when a user clicks the "+" button on the Things page, a modal opens to create a new thing. This modal should be a page on mobile, as it becomes cramped on the smaller screen.

Requirements

  • On mobile, tapping the Add button from the things screen opens a Create Thing page
  • On desktop, the same modal appears

Create separate Edit dialog for record details

The current UI gives users the ability to modify record details directly from the details widget.

Making a change automatically shows the "Unsaved Changes" indicator, activates the save/cancel buttons, etc.

This presents some technical challenges, as we have to maintain TextEditingController state that is accessible to the save/cancel logic. For now, we use providers to hold the values, but this makes it hard to handle rebuilds.

We should explore creating separate Edit dialogs for each type of record instead of allowing the user to edit directly from the details widget.

Insights page

Time period options are "All Time", "YTD", and "This Month".

Library Statistics

Loans

A "loan" is each instance of a thing being lent out.

  • Total Loans (number, time period options)
  • Value of Loans (number, time period options)
  • Total Loans (monthly chart)
  • Total Loans (day of week chart)
  • Percent Active, Returned, Overdue (pie chart)

Members

  • Total Members (number)
  • Total Active Members (number)
  • Total Borrowers (number, time period options)
  • New Member Signups (monthly chart)

Things

  • Types of Unique Things (number)
  • Total Items in Inventory (number)
  • Most popular things by loans (list)

Member Demographics

  • Total Members (number)
  • Member Age (age bar chart)
  • Gender (pie chart)
  • DIY Comfort (pie chart)
  • Housing (horizontal bar chart)

Member Requests

  • Requested Workshops (inbox section)
  • Requested Things (inbox section)

Hide/unhide thing in online catalog

Requirements

  • From the thing details pane, the user is able to hide/unhide the thing.
  • Hiding a thing removes it from view in the catalog app.

Actions / Extend Active Loans - Email Notifications

When an admin user runs the Extend Active Loans action, due dates are updated, but the borrower isn't notified. We need to add the ability to write a message that is sent to all borrowers affected by the change.

Inventory / Item Details / Image

From Thing Details, the user should be able to click on an item and see its unique image, which is also editable with the rest of the record's details.

Create Button Menu

When a user clicks the 'Create' button, it currently creates a Loan or Thing depending on which area of the app is selected. This isn't the most intuitive setup, as some people struggle to understand that the button is contextual.

Instead of a contextual button, we should implement a 'Create' button that opens a menu, listing all the things the user may create.

Requirements

  • When the user clicks the Create button, a menu appears.
  • The Create menu includes Loan and Thing as options.

Delete inventory item

Requirements

  • From a thing details pane, the user is able to delete an individual inventory item.
  • When clicking the delete button, the user is alerted to confirm the deletion, as this is a destructive action.

Item Details [View Only]

From Thing Details, a librarian user needs to be able to view an item's details.

Requirements

  • On desktop, tapping on an item opens a details modal with:
    • Name (from the thing)
    • Number
    • Brand
    • Description
    • Estimated Value

Delete thing

Requirements

  • From the toolbar of a thing details pane, the user is able to delete a thing.
  • When clicking the delete button, the user is asked to confirm, as this is a destructive action.

User Profile

Requirements

  • On Desktop, the user's profile name and avatar are displayed at top right of the screen.

Item > Hide/Unhide

As a librarian user, I need to be able to hide/unhide a specific thing, in the event it becomes damaged or otherwise unavailable for lending.

Requirements

  • The user is able to quickly hide/unhide an item from Thing Details.

Automatically sign out after 24 hours

Requirements

  • After 24 hours of inactivity, the user is automatically logged out and sent to a page explaining that the session expired.
  • A button to sign back in is visible on the page. Clicking it goes back to the signin page.

Settings / Library / Logo

From the Settings page, an admin user is able to replace or remove the library's logo. The logo is currently stored in Supabase under library/settings/logo.

Login

When navigating to the initial app screen, Alice is greeted with a means of logging in (preferably a PIN). Submitting the login form navigates Alice to the Loans screen.

Create / New Item (Shortcut)

From the Create Menu, the user is able to quickly create a new item. When clicking the menu option, a modal appears to search for and select a thing. Then the user is navigated to the thing record and the New Item modal appears.

Thing Details > Categories

As a librarian user, I would like to view and edit thing categories from the details screen.

Requirements

  • Categories are shown in the thing details
  • A category can be removed
  • A category can be added from a list (full screen on mobile, modal window on desktop)

Borrower Details

  • Name
  • Email
  • Phone
  • Status
  • Issues (overdue loan, suspended, etc.)

From the Borrower Details screen, Alice can view and update a borrower's details contact info. She can also view the borrower's status and reasons for an inactive status, like an overdue loan or unpaid dues. In the event of unpaid dues, there should be a QR code for the borrower to pay their dues.

Since we don't have a connection to Givebutter's API yet, we should consider having an override button in the app which removes the unpaid dues issue from the borrower.

PWA Icon

The current PWA icon does not look great, especially when installed on iOS.

Thing Details / Requires Safety Goggles

As a librarian user, I need to be able to toggle the "Requires Safety Goggles" flag from the Thing Details screen.

Requirements

  • Can discard changes after checking/unchecking
  • Changes are saved when hitting save

Settings / Catalog Settings

Requirements

  • From the Catalog section of the Settings page, the user is able to configure various aspects of the catalog web app for this library.

The user can:

  • Enable/Disable the catalog app
  • Choose a color scheme for the app (3 options)
  • Choose a logo -- should probably be moved to the General section the Settings page

Loan Builder

The Loan Builder is a 3-step process that guides Alice through the opening of a new loan.

Steps

  1. Select Borrower
  2. Add Things
  3. Confirm Loan Details

When complete, Alice is redirected to the Loans screen where she can see the new loan(s) she created. Note that each thing selected will generate a loan in the app.

Loan Details / Thing Image

To more easily identify the item being returned, we should add the Thing or Item image in the Loan Details. (A lot of librarians are not familiar with all the tools we carry.)

Add thing image when recording inventory

Requirements

  • When recording new inventory items, the user is able to snap a photo.
  • The photo is set for all items, even if quantity > 1.
  • Asynchronous requests should show some indication of loading in the UI.

Borrowers

The Borrowers screen shows a searchable list of all the library's borrowers, with their name and some indication of standing (active vs inactive).

Tapping a borrower brings us to the Borrower Details screen.

Refactor state management with Riverpod

Requirements

  • All existing app/module/widget state is refactored using Riverpod providers.
  • Folder structure changes as needed.
  • Consider undoing the recent file.suffix.dart pattern of naming files. It was one developer's way of organizing the project, but there are better ways that are more accepted by the Flutter dev community.

Actions / Extend Active Loans

In the event of a closure for any reason, a librarian admin may need to extend all loan due dates to the next date with open hours.

Requirements

  • The user can extend the due date of all open loans to a chosen date โœ…
  • All borrowers are notified of the change via email
  • The user can write a message that is included in the email

Edit: Emailing functionality will be added in a followup issue, to reduce the scope of this one.

Requires Safety Goggles Prompt

When adding a thing to a loan that requires safety goggles, a dismissible dialog appears warning that safety goggles are required.

If safety goggles are already part of the loan, the dialog does not appear.

Spacing of loan details is erratic

Because of the layout on the loan details pane, the details are inconsistently spaced depending on the data.
Ideally, the fields should never shift position.
There is also an issue with overflow sometimes, if the thing name in the system is long.

Item Details [Edit]

As a librarian user, I need the ability to edit details of existing items from the item details.

Requirements

  • Brand is editable
  • Description is editable
  • Estimated Value is editable
  • Hidden is editable priority

Loans

All open loans are listed on this screen. Each loan shows a thing name, borrower, and due date. The loans are sorted by due date, with soonest at the top. There should be some special indication that the loan is due back today.

Overdue loans should stay at the top and have some indication they are overdue.

There is a way of toggling closed loans, so that Alice can view a loan that was previously closed.

Loans should be searchable by borrower name or thing.

Tapping a loan opens the Loan Details screen.

Independent Due Dates (Open a loan for each lent item)

When we create a loan with multiple items, our API currently creates one loan record with all of the items. We should explore creating one loan for each item, so that each item can have an independent due date. This change would also simplify how we close loans.

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.