Giter Club home page Giter Club logo

fitlit-refactor's Introduction

Refactor Tractor (Fitlit Version A)

Aug-02-2021 16-48-39

Learning Goals

  • Build on top of pre-existing code that you did not write and navigate someone else’s codebase
  • Make network requests to API endpoints to retrieve and manipulate data
  • Refactor pre-existing code and use inheritance to DRY up repetitive logic
  • Ensure your app is following best practices for accessibility
  • Leverage Sass to DRY up your CSS
  • Incorporate Webpack to streamline your workflow process
  • Work on good Git-flow practices

Technologies Used

  • JavaScript (Vanilla)
  • HTML
  • CSS
  • Lighthouse (Accessibility tool)
  • Sass
  • Lint
  • Mocha & Chai
  • Github Projects

Contributors

fitlit-refactor's People

Contributors

hannahhch avatar maeduphorne avatar nikhil9999 avatar samantha-brown avatar sarahrudy avatar

Forkers

samantha-brown

fitlit-refactor's Issues

Questions for Hannah:

  • should we comment code out that we don't think belongs and keep it until the end or should we refactor compelely?

  • should we just create a branch called original-code or something so we always something to look back to?

  • What does USER STORIES mean?

  • What should we prioritize?

ReadME

  • Contributors
  • Overview of project/goals
  • Technologies used
  • Code architecture
  • Challenges, wins, and any other reflections
  • Gif/screenshoots
  • Future designs/extensions

Sleep Class:

  • For a user, their sleep quality each day over the course of a given week (7 days) - you should be able to calculate this for any week, not just the latest week
    method does not exist -- calculateAverageQualityThisWeek() could be a helper method or have useful logic
  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

User Class:

  • Should have a method to:
  • Return a user’s first name only

method written on line 24 - 27

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Activity Class:

  • For a user, did they reach their step goal for a given day (specified by a date)?

Activity class line 24 - compareStepGoal()

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

UserRepository

  • A UserRepository holds onto all of the User objects
  • It should have a parameter to take in user data
  • make sure that userRepository holds all of the user objects

  • check that both method and tests are working working and passing

  • make sure the code is DRY/dynamic

  • check that variable names follow conventions

  • check syntax

  • check placement of function (does it need to be moved?)

Activity Class

  • For all users, what is the average number of:
    • stairs climbed for a specified date
      User Repo 43 -- calculateAverageStairs()
    • steps taken for a specific date
      User Repo 29 -- calculateAverageSteps()
    • minutes active for a specific date
      User Repo line 57 -- calculateAverageMinutesActive()
  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Sleep Class:

  • For a user (identified by their userID), the average number of hours slept per day

line 68 in User class -- updateSleep()

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Sleep Class:

  • For a user, how many hours slept each day over the course of a given week (7 days) - you should be able to calculate this for any week, not just the latest week

method does not exist -- could be a helper method or have useful logic? :
calculateAverageHoursThisWeek

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Activity Class:

  • For a specific day (specified by a date), return the miles a user has walked based on their number of steps (use their strideLength to help calculate this)

Activity class line 18 -- calculateMiles()

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Hydration class:

  • For a user, how many fluid ounces of water consumed each day over the course of a week (7 days) - return the amount for each day
  • method does not exist -- add method and testing

  • check that both method and tests are working working and passing

  • make sure the code is DRY/dynamic

  • check that variable names follow conventions

  • check syntax - ES6 compatible

  • check placement of function (does it need to be moved?)

UserRepository

  • It should have methods to determine:
    • Given a user’s ID, what is their user data?
    • The average step goal amongst all users

functions exist in UserRepo - lines 7-21

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Activity Class

  • For a user, find their all-time stair climbing record

user class 89 -- findClimbingRecord()

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Hydration Class:

  • For a user (identified by their userID - this is the same for all methods requiring a specific user’s data), the average fluid ounces consumed per day for all time

User Repo line 74-79 -- calculateAverageDailyWater()

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Sleep class:

  • For all users, the average sleep quality

UserRepo line 22 -- alculateAverageSleepQuality()

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Sleep Class:

  • For a user, their average sleep quality per day over all time

User Repository line 22 - 28 -- calculateAverageSleepQuality()

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Activity Class

  • For a user, (identified by their userID) how many minutes were they active for a given day (specified by a date)?

DOES NOT EXIST

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Sleep Class:

  • For a user, their sleep quality for a specific day (identified by a date)

line 45 -- updateSleep()
(if not this function, it may not exist??)

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Activity Class:

  • For a user, how many minutes active did they average for a given week (7 days)?

User Repo -- line 57 -- calculateAverageMinutesActive()

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Sleep Class:

  • For a user, how many hours they slept for a specific day (identified by a date)

user class line 45 ?? - updateSleep()
(if not this function, it may not exist yet)

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Activity Class:

  • For a user, find all the days where they exceeded their step goal

METHOD DOES NOT EXIST

  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

Initial Project Set Up

  • Fork / clone repos to local
  • Complete DTR
  • Set up Project Board with issues
  • Submit repo link to project manager

User Class:

  • A User represents a single user
    • It should have a parameter to take in a userData object
    • Each user holds on to the user properties from the data file
  • check that both method and tests are working working and passing
  • make sure the code is DRY/dynamic
  • check that variable names follow conventions
  • check syntax - ES6 compatible
  • check placement of function (does it need to be moved?)

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.