Giter VIP home page Giter VIP logo

tcl-12-smart-shopping-list's Introduction

Overview

What is this project?

The goal of this project is to collaborate with your Collab Lab team to create a “smart” shopping list app that learns your buying habits and helps you remember what you’re likely to need to buy on your next trip to the store.

How does it work?

As a user, you will enter items (e.g., “Greek yogurt” or “Paper towels”) into your list. Each time you buy the item, you mark it as purchased in the list. Over time, the app comes to understand the intervals at which you buy different items. If an item is likely to be due to be bought soon, it rises to the top of the shopping list.

Check out an example

Every team builds their app from the same set of instructions, but each comes out a little different and reflecting the personality of the group.

📺   Check out a video demo of the app Cohort 6 made here: TCL Demo Video Screenshot

More details for contributors

🎉   If you’re a Collab Lab participant, first of all: WELCOME! We’re so excited to work with you and collaborate on something amazing.

Make your first contribution!

The first thing you will want to do before your kick-off call is make your first contribution to this repo. This will help make sure you’re ready to go on day one.

  • Get this project set up locally by following the instructions below in this README.
  • Add your name to the CONTRIBUTORS.md file
    • Be sure to do this from your local environment and not from GitHub in your browser. The purpose (aside from highlighting our amazing team) is to make sure you’re local environment is all set up and ready to go come day 1!
    • Commit to the main branch and push it up to the remote repo. (Over the next 8 weeks, we will rely on feature branches as we collaborate on the project, but for this task committing to main will do just fine.)

What else should contributors know?

For additional details on how your cohort will operate, please check out the project brief.


Project setup

Download Node and NPM

Clone project locally

  • On GitHub, navigate to the repo for your cohort’s project (you’re probably there right now, click the "Code" tab at the top). screenshot of "Code" tab on GitHub
  • Click the green "Clone or download" button and copy the web URL. screenshot of how to copy the web URL for a GitHub repo
  • From your terminal, cd into the directory where you want this project to live. screenshot of how to navigate folders in terminal
  • Once you’re in the directory, type git clone followed by the web URL you just copied to your clipboard from GitHub. screenshot of how to git clone
  • Then navigate into the project by typing cd followed by the project directory’s name. screenshot of how to cd into the project directory

Update dependancies

  • Once you have the project locally and you and in the project directory, you’ll want to update all the project’s dependancies. To do so, type the following into your terminal: npm update screenshot of npm update in the terminal
  • Maybe take a sip of coffee or check in on Twitter, this could take a minute -- don’t worry.

Access the project in your browser

  • After you’ve cloned the project locally and updated the dependancies, you should be able to see the project at localhost:3000. screenshot of the react project

🎉 You did it! You’re ready to start contributing. Don’t forget to complete the first task by adding your name to CONTRIBUTORS.md from your local enviroment, committing those changes, and creating a pull request.


Boilerplate information

Everything in this section is automatically generated when you create a new app using create-react-app. These details can be really helpful in learning how to launch and manage your React app with npm.

↓↓↓ create-react-app boilerplate ↓↓↓

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm run build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

tcl-12-smart-shopping-list's People

Contributors

gabbyj avatar terchiem avatar edenbekele avatar alexandra-lim avatar aayushkh avatar skillitzimberg avatar segdeha avatar daredtech avatar jmkuchman avatar alilynne avatar mxmason avatar erostribe avatar

Watchers

Jayson J. Phillips avatar James Cloos avatar Juan Andrade avatar Tito Agudelo avatar Chris Dopuch avatar David Lluna avatar Eddie avatar Joey Laguna avatar  avatar Golfo Vasiliou avatar LaQuita avatar Melina Mejía Bedoya avatar  avatar

Forkers

erostribe gabbyj

tcl-12-smart-shopping-list's Issues

12. As a user, I want to view a list of my shopping list items in order of how soon I am likely to need to buy each of them again so that it’s clear what I need to buy soon.

Possible item states are as follows:

  • Need to buy soon (fewer than 7 days)
  • Need to buy kind of soon (between 7 & 30 days)
  • Need to buy not soon (more than 30 days)
  • Inactive (when there’s only 1 purchase in the database or the purchase is really out of date [the time that has elapsed since the last purchase is 2x what was estimated])

AC:

  • Items in the list are shown as visually distinct (e.g., with a different background color on the list item) according to how soon the item is expected to be bought again: Soon, Kind of soon, Not soon, Inactive
  • Items should be sorted by the estimated number of days until next purchase
  • Items with the same number of estimated days until next purchase should be sorted alphabetically
  • Items in the different states should be described distinctly when read by a screen reader

2. As a user, I want to be able to navigate between the “list” view and the “add an item” view so that the interface is clearly delinteated between viewing and adding.

This is 1 of 2 stories that should be completed in the first week to enable further development of the app.

AC:

  • react-router-dom has been added as a project dependency
  • Links are present and persistent at the bottom of the app: one for the “list” view, the other for the “add an item” view
  • When one of the links is clicked, the browser URL updates to represent the current view and a matching view component is displayed
  • Whichever view is selected, the corresponding link should display in bold text

Consolidate API calls

Move all API calls to Firestore to one 'services' file.
Update function signatures (the order in which they accept arguments) to make them match and ensure that they're more predictable (e.g. item, token in the same order for all functions)

6. As a user, I want to be alerted when I’m entering an item that is the same as something already on my list so I can avoid duplicate items.

AC:

  • Show an error message if the user tries to submit a new item that has the exact same name as an existing item
  • Show an error message if the user tries to submit a new item that has the same name as an existing item, where capitalization has been normalized and punctuation has been removed
  • The user’s original input should be what gets saved in the database

5. As a user, I want to join an existing shopping list so I can share a shopping list with another person.

Tokens can be shared with other users to allow them to co-manage a given list.

Joining an existing list consists of the following:

  • User enters an existing token
  • Save the token to localStorage
  • Show the user the existing list

AC:

  • When the user does not already have a token in localStorage, on the onboarding/home screen, a simple form is displayed that allows the user to enter a token
  • Entering the token and hitting submit saves the token to localStorage, effectively giving them joint control of the list
  • On submit, show an error if the token does not exist
  • If they get an error message, allow them to try again or create a new list

Restructure Database

User story: As a developer, I would like a database that will scale more fluidly as we add new features.

Acceptance criteria:

  • All API requests (getting, updating, deleting) work as before
  • Filtering the list works as before
  • Ordering the list works as before

Pain points with current implementations:

  • Too much nesting: We currently have to dig in three layers to get to an item's details.
  • Querying is complex and doesn't use the methods that firestore recommends.
  • Firebase docs scare us away from nesting, BUT it can be useful. We currently have objects with properties but we can do something else to make it easier to add and access those elements. All lists are not evil.

Resources:

Notes:

  • Suggestion: All lists are not evil, we could consider using a proper list here.
  • Talk openly. Share openly about your ideas in Slack. Ask for thoughts!
  • Firestore allows nested collections. Collection of lists with a subcollection that is the items of the list.

11. As a user, I want to be able to delete items from my shopping list so that my list isn’t cluttered with items I don’t want to buy in the future.

It’s possible our users may make an error when entering an item or may decide they won’t be buying a certain item again in the future. Let’s help them keep their lists tidy!

AC:

  • User is able to delete an item from the shopping list
  • Before deleting, prompt the user to confirm that they really want to delete the item to prevent accidental deletions
  • Deletion should cause the associated record(s) in the database to be deleted

13. As a user, I want to view details of my purchases to better understand my purchase patterns.

AC:

  • From the shopping list, user can tap to navigate to a detailed view of the item
  • Detail view includes the following information:
    • Name of the item
    • Last purchased date
    • Estimated number of days until the next purchase
    • Number of times the item has been purchased
  • When in the “item details” view, a back arrow should appear in the header that takes the user back to the “list” view

4. As a user, I want to add a new item to my shopping list so I can start recording purchases.

A shopping list item consists of the following data points:

  • Name of item
  • How soon are you likely to buy it again?
    • Soon (in the next 7 days)
    • Kind of soon (in the next 14 days)
    • Not soon (in the next 30 days)
  • Last purchased date

AC:

  • User is presented with a form that allows them to enter the name of the item and select how soon they anticipate needing to buy it again (Soon, Kind of Soon, Not Soon)
  • When the user submits the form, the item is saved to the database, associated with the user’s token
  • Along with the item name, an integer corresponding to the estimated number of days until next purchase is saved: 7 for “Soon”, 14 for “Kind of Soon”, and 30 for “Not Soon”
  • The last purchased date should be set to null initially (i.e. you can create an item without purchasing it)
  • Item names should be displayed as a simple, unordered list on the list view after they’re added

3. As a user, I want to set up a new shopping list so I can start tracking purchased items.

A shopping list consists of a set of items associated with a user’s token. Creating a new list consists of the following sequence:

  • Generate a new, unique token
  • Save the token to localStorage
  • Show the user the list view

The following script should be used to generate a suitable token: src/lib/tokens.js

AC:

  • For users who do not already have a token/list, a button or link exists on the home screen that allows them to create a new list
  • Clicking the button/link generates a new token and saves it to localStorage
  • Once the token has been created and saved, the user is redirected to the "list" view

9. As a user, I want to filter my shopping list to make it easier to locate an item in the list.

AC:

  • Display a text field above the top of the shopping list
  • As the user types into the field, the list should narrow to display only items that contain the text the user entered in the filter field
  • When the field has text in it, the user should be able to tap a UI element (e.g., with an "X" button next to the field) to clear the field
  • The filter text should match any part of the item name (i.e. it should not only match from the start of the string)

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.