andrejoe / DON

Statistic App
MIT License
0 stars 0 forks source link

Database Redesign #1

Open andrejoe opened 9 years ago

andrejoe commented 9 years ago

The Database/s of the base app is somewhat different to what we want. As a primary goal, focus should be on the proper design and structure of the databases. Once we have finished with the database design we can then move it to a host so that we no longer need to think about it and can focus on the next issues.

Firstly, lets have a look at the current database/s structure.

Using Robomongo to manage the mongo database it seems the server has created a data base by the name "bucketlistapp". As, it seems with all mongo databases there are three folders "Collections", "Functions", and "Users". I think for the time being we only need to focus on the "Collecxtions" folder. I imagin the "User" folder maybe used for restricting direct access to the database. Im not sure what the "Functions" folder is for at the moment.

In the "Collections" Folder there is two more folders. "System" and "appUsers". On the command line the collections are shown as "appUsers" and "system.indexes". So I am guessing the "System" folder and the "system.indexes" collections is part of mongo and not part of the app. According to the literature anything beginning with "system" is reserved by mongo for internal stuff.

Ok ... so it look as though we only have one collection at the moment "appUsers". I'm expecting there to be at least one more, so I will run the client, create a user and enter some bucketlist data, then see what collections we have.

Attempting to add users and add data has proved that there is a problem with popup messages in the base app. I will add this as a separate issue, and come back here after I am able to get users registered and data added without problems.

After correcting the previous issue, I have found what was expected. There is a second collection "bucketList". This collection contains all user lists. To differentiate between users there is a field for user "token" and "user" email. In the present state it seems that the base app simply uses the user email as the token. I think however this field is in place for a better security measure to be applied. This is important (so I will lodge a separate issue for this).

andrejoe commented 9 years ago

The "bucketLists" collection seems like a good candidate for a starting place for individual bids (rather than "to-dos"). Change the collection name "bucketLists" to "bidLists".

The list should contain every bid which is up to be challanged or waiting to toss, inlcuding the current users bids and waiting tosses.

There will need to filter and sort options for this list. Before we decide on these we need to clearly specify what each list item must include.

  1. Bid value.
  2. Toss number (time).
  3. Place for two user names/ids
  4. Bid Lock status (point where no changes can be made before toss)
  5. Countdown
  6. Result