forked from patwill92/group-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabaseStructure.txt
93 lines (65 loc) · 2.09 KB
/
databaseStructure.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
Below is a database structure that I think will fit our needs. Please let me know if this works for you.
I think we can do everything we set out to do at the beginning of our project with a structure like this.
In the example below, I use terms such as "recipeKey3." The keys I am referring to will be the ids of the
recipes returned back from the spoonacular api. They won't be nicely formatted and will look something
like: "4HDIJEj6weOSwQLtL3vom6Iemp33". The user keys will be the "uid" of users that have signed up in our application
You can get the uid of the current user in JavaScript like so: "firebase.auth().currentUser.uid"
*/
root{
//@Annalisa: the popular recipes value is your thing so structure it however you want. However, I think it would be
//cool to have a structure like this:
popularRecipes : [recipeKey456, recipeKey123, recipeKey789, ... , recipeKey777]
0-index 1-index 2-index 50-index
//the first index corresponds to the recipe in recipes/ with the most 'aggregateLikesFromApi' and descends from there
//whatever you plan to do, let Pat and I know so we're all on the same page.
userRecipes{
userKey1 { //corresponds to the uid of a user defined by firebase.auth()
recipeKey1 : true //corresponds to the recipe key in recipes/
recipeKey6 : true // I have specified the value of this child as 'true'. The value can be anything, as long as it's not null.
recipeKey24 : true
},
userKey2 {
},
.
.
.
userKeyN {
},
}
recipes{
recipeKey1 {
//recipe information goes here. Can just be the object returned by the API call.
//you'll have recipe information such as:
aggregateLikes: Number,
title: String,
id: id (will be the same value as the recipe key),
sourceUrl: url of the source recipe
.
.
.
}
recipeKey2 {
},
.
.
.
recipeKeyN {
},
}
usersInfo{
userKey1 { //corresponds to the uid of a user defined by firebase.auth()
state{
length : number,
directions : "html string containing ordered list of directions",
},
},
userKey2 {
},
.
.
.
userKeyN {
},
}
}