Giter Club home page Giter Club logo

synced-shopping-list's Introduction

Synced Shopping List

A shopping list PWA synced between clients.

Stack

  • React (CRA)
  • Typescript
  • Material-UI
  • Firebase
  • Netlify (hosting + functions)

Additional Capabilities

  1. Support fully offline. By nature firebase realtime doesn't support offline mode. This app does.
  2. When there is a new version, the app refreshes automatically (instead of console.log supplied by CRA template)

Installation

App

yarn

Database (Firebase realtime database)

  1. Follow the instruction - https://firebase.google.com/docs/database/web/start.
  2. Rename env.sample to .env.local and update its content with the details received from firebase.
  3. Set up authentication - https://firebase.google.com/docs/database/security/get-started#set_up. The UI doesn't have login so it only supports external providers (e.g. Google)
  4. Limit the users who can access the db to avoid exceeding the free plan. You can do it by setting the rules write / read to certain users, like this:
{
  "rules": {
    ".read": "auth.token.email == '[email protected]' ||
							auth.token.email == '[email protected]'",
    ".write": "auth.token.email == '[email protected]' ||
							auth.token.email == '[email protected]'",
  }
}

Storage (for item's image)

Messaging (Push Notifications)

In order to let the server (the code will published soon) to send a push notification, the app should register itself to FCM ("Firebase Cloud Messaging"), get a token and submit it to server. In order to do this:

  1. Register the app and get the Notification Token.
  2. Add it as REACT_APP_NOTIFICATION_TOKEN to env.local / server env variable.

Deploy

deploy with netlify

In the process you'll set the build variables the same as in the .env file.

Notes:

  1. If you configure netlify manually (not via the "Deploy" button), don't forget to configure the build variables.
  2. yarn push triggers also npm version which bumps the app's version which reflected in the UI (main nav at the bottom)

Run

yarn start

Run local functions under port 9999

netlify functions:serve

The proxy function aims to solve the CORS issue when trying to save an image from Google search result (Item Details > Image > Replace (Google)).

Credits

  • Illustrations by undraw โค๏ธ

synced-shopping-list's People

Contributors

dependabot[bot] avatar moshfeu avatar shayanypn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

synced-shopping-list's Issues

Allow to add prices

So the user can take the smart decisions about where is the cheapest place to buy from

Add urgency indicator

Product details - dropdown - "Urgent", "Normal".
Products list - red color if urgent

[Bug] Showing item is exist instead of set it as not taken

As a user I set an item as taken (check the checkbox), let's say Milk.
Then I type "Milk" in the input and hit "Enter".

Expected result
The item will re-added to the non taken list

Actual Result
The app shows "the item is already exist" info message

Add images from Google

Add option to add images from Google by searching a term

Screen Shot 2022-12-15 at 11 32 41

Add a modal with a search modal

Run auth and load from cache parallel

Currently, the app first runs authentication and if the user logged in, it loads and presents the the data (products, categories etc.)
This cause an issue when the network is not great so the authentication is slow.
The solution is the app to load the data from localStorage in parallel and if the data exists, show it. If not, wait for the authentication to finish, then load and show the data.

Don't add duplicates

Actual behaviour
Currently when a user types an existing items' name in the search input and submits the item is added to the list.

Expected behaviour

  • When the item exists in the history, it should add from history but not to create a new item
  • When the item exists in the list, it shouldn't add the item and notify the user that the item is already exists.

Add the option to remove an item not just check

Currently it's only possible to check an item so if I added an item accidentally, I need to check it and go to the checked list and clear it

UI options

  • A button in the item details panel
  • Long press on the item and the option shows up

Trim autocomplete term

So when the phone's keyboard autocompletes with a space after, the results still show up

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.