tamraj-kilvish / kilvish

http://kilvish.in
3 stars 2 forks source link

Integrate Firebase Realtime DB & fetch real data for home & detail screen. #29

Open pocha opened 9 months ago

pocha commented 9 months ago

Realtime DB data structure here

For our case, the data need to be like

users: {
  <id>: {
      tags: {tag_id1, tag_id2 ..}
   }
}

tags: {
  <tag_id>: {
     name: _string_
     owner: _user_id_
     shared_with: { user_id1, user_id2},
     expenses: {expense_id1, expense_id2}
  }
}

expenses: {
   <expense_id>: {
       timestamp: _number_,
       from: user_id,
       to: user_id,
       amount: _number_,
       tags: {tag_id1, tag_id2}
   }
}

Populate some data manually in Realtime DB for a user including tag + expenses & show the data in home & detail screen

For reading data from the Firebase DB, use onValue() rather using get() as explained here

pocha commented 8 months ago