net-art-uchicago / cta-file-sharing

a collaborative artware project by Media Art and Design students at the University of Chicago.
GNU General Public License v3.0
2 stars 15 forks source link

Designing + Implementing the Database #10

Open trishbansal opened 1 year ago

trishbansal commented 1 year ago

I will be designing a way to structure the data we require in a organized manner by creating a JSON file to hold the data. In order to understand what data we need to store and how we want to access them I will be collaborating with members of the front end, back end, and design teams. Once I have the structure of my JSON decided, I will write a Python script to initialize it and work with the other backend folk to update and maintain it.

armiesingh commented 1 year ago

Working with Trisha on storing user data (usernames, passwords) and geodata associated with the user's content.

trishbansal commented 1 year ago
[
  {
    "poem": "abc",
    "date/time": 1,
    "author": 2,
    "lat":3,
    "long":4
  }, 
  {
    "poem": "abc2",
    "date/time": 1,
    "author": 2,
    "lat": 3,
    "long": 4
 }
]
bermanisaac commented 1 year ago

@trishbansal I like the look of this. Two questions: Is the author of each poem considered a string or a number? I know JS gives us a lot of freedom with dynamic typing, but we should expect a string for an author name, right? Second, do we want to be storing any information about which bus or which bus route a given poem was written on? That might help us feed poems back to users, although I'm not sure if we've made any decisions about what that algorithm will look like. If you want to store that info, individual buses just have a number, while each route has a string. (Usually the string is just like "171" or "55", but there's a couple odd ones like "X9" and "J14"

nbriz commented 1 year ago

@trishbansal i reformatted ur comment to make the data structure easier to read.

@bermanisaac brings up a good point about the author (this will likely be a string like the poem) as well as the bus routes, that's also info we're going to get from the poet when they submit their text, so we should probably also store that in the object.

@trishbansal + @armiesingh i'd also remove the "/" from "date/time" (slashes in property names will cause problems), u can just make it "date" or "time".

make sure u share this design w/the rest of the class on slack so that any of the other folks interacting w/this data can share their thoughts. if it looks good to everyone else u can start working on code... although, one more design step u should document here before coding anything are the functions u plan on writing for the REST API team (things like saveNewPoem(object) or getPoems() etc.) so u can get some feedback on them from that

trishbansal commented 1 year ago

Updated JSON format:

[
  {
    "poem": "abc",
    "date": 1, //(agreed upon date format)
    "author": 2,
    "lat":3,
    "long":4,
    "route": 123
  }, 
  {
    "poem": "abc2",
    "date": 1, //(agreed upon date format)
    "author": 2,
    "lat": 3,
    "long": 4,
   "route": 123
 }
]

Functions: