jtexp / NutriScope

Nutrition Tracker using USDA NDB API
0 stars 2 forks source link

Data Diagrams for design documentation #24

Closed jtexp closed 7 years ago

jtexp commented 7 years ago

These classes:

https://github.com/jtexp/NutriScope/tree/master/app/src/main/java/edu/utdallas/csdesign/spring17/nutriscope/data/source/ndb/json

And our firebase:

{
  "foodconsumed" : {
    "8pNIt7FbNpfUyKoOQT70rVMbcMl1" : { // the user's key
      "-Kj0KU54GEgs2CAUvswk" : { // a timestamp-like key
        "dateTimeConsumed" : 1493597286,
        "ndbNo" : "09316", // food-key
        "quantity" : 1
      }
    }
  },
  "nutrition" : {
    "8pNIt7FbNpfUyKoOQT70rVMbcMl1" : { // the user's key
      "17286" : {
        "dateStamp" : 17286,
        "key" : "17286", 
        "nutrients" : {
          "203" : 0.30839999999999995, // NdbNutrientId / quantity
          "204" : 0.012,
          "205" : 1.4928,
          "255" : 9.9948,
          "291" : 0.3,
          "301" : 0.0035999999999999995,
          "303" : 3.888E-4,
          "304" : 0.00276,
          "305" : 0.00456,
          "306" : 0.04955999999999999,
          "307" : 0.0012,
          "309" : 4.2E-5,
          "320" : 0,
          "328" : 0,
          "401" : 0.0013679999999999999,
          "404" : 2.52E-6,
          "405" : 4.5599999999999995E-6,
          "406" : 1.2396E-4,
          "415" : 2.8679999999999996E-5,
          "418" : 0,
          "435" : 2.04E-6,
          "601" : 0,
          "605" : 0,
          "606" : 0.00312,
          "645" : 2.4E-4,
          "646" : 0.00516
        }
      }
    }
  },
  "users" : {
    "8pNIt7FbNpfUyKoOQT70rVMbcMl1" : {
      "calorieGoal" : 2500,
      "email" : "john@test.com",
      "nickname" : "John",
      "uid" : "8pNIt7FbNpfUyKoOQT70rVMbcMl1"
    }
  }
}

There's a lot of key value stuff in the JSON. Maybe look into how to go from a json document to a json schema.

jtexp commented 7 years ago

https://github.com/jtexp/NutriScope/blob/master/app/src/main/java/edu/utdallas/csdesign/spring17/nutriscope/data/consumedfood/ConsumedFood.java https://github.com/jtexp/NutriScope/blob/master/app/src/main/java/edu/utdallas/csdesign/spring17/nutriscope/data/user/User.java https://github.com/jtexp/NutriScope/blob/master/app/src/main/java/edu/utdallas/csdesign/spring17/nutriscope/data/nutrition/Nutrition.java