Firestore Database structure for a class/lab Booking android app

What would be the best data structure for a class/lab android app using Firestore Database ?

I know it depends on popularity and number of hits/day etc. In my case its a University project , so I guess minimum clicks per day. I am just looking for something that would be easier for me because I am new to the whole no SQL thing.

Here are the needs: There are classrooms. In every classroom there are computers. Classrooms are open from 09:00 - 21:00. The app will allow users to reserve some time at a classroom of choice (half hour based programm).

I think I need 2 top tier collections. Collection Users that contain documents of students. Collection Classrooms that contain documents of classrooms.

From there, I am getting trouble finding a good solution to continue. Any tips, ideas would be more than welcomed. Thanks!

Here is a flow chart I made for better visualization of my project:

Here is a flow chart I made for better visualization of my project.

1 answer

  • answered 2021-10-24 17:02 Canada2000

    First, very impressive graph you created. Great work !

    As mentioned by Frank in his comment, the answer really depends on your specific use case and there is definitely no one solution. I will still share with you some ideas I wish someone shared with me when I started my project (very similar to yours).

    1. Booking Collection: This will be your core collection. You need to add it. A booking is for a computer booked by one user during a period of time. You need to have this as a separate collection for security reasons (users only access their own bookings). You will also use this collection to ensure a computer is not double-booked.
    2. Computer Collection: You mentioned the room collection, but more importantly is the computer collection

    Agreat resource to learn more in this link

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum