briansostudio / teamform

teamform for comp3111
0 stars 0 forks source link

Firebase schema changes #16

Closed BrianSo closed 7 years ago

BrianSo commented 7 years ago

After discussing the user, events, and radar implementation. I want to make several changes to the current schema

The changes are:

  1. added users: users is bind to the app. The account can be reused for different events. Member still remain in the schema. Member is bind to each event and store only the information that will be different in different events. (this change is reference to issue #9 )
  2. added radar data: the radar labels are input by the event organizer and the label values are input by the members. (this change is reference to issue #8 )
  3. added schedule data to the users
  4. added event password for the event for administration
  5. added teamSize restriction for the event

@narwhlae Is it possible to change the data schema? How much of code depends on the schema now?

@narwhlae @clementf2b There is also one critical issue, how to store the user authentication data? It can be authenticated by both email/password or social login. Is firebase has builtin support? How could we reference the firebase currentUser to the data schema? So I can store the schedule data publicly.

Here is the schema I proposed

root
    eventList
        ref(../events/:eventId) : String (eg hackUST)
    events
        :eventId
            name : (eg hackUST)
            description : String (eg A 24 hours Hackathon in HKUST)
            adminPassword : md5(String)
            criteria
                index(): String (eg Android)
            members
                :memberId
                    name : String (eg Brian)
                    status: String (eg pending)
                    schedule
                        intervals
                            :intervalId
                                start: Number (eg 0)
                                end: Number (eg 86400)
                    criteria
                        index() : Number (eg 100)
            teams
                :teamId
                    name : String (eg BrianSo Studio)
                    description : String (eg Welcome to BrianSo Studio)
                    tags
                        :hash : String (eg Brian)
                    leader : ref(../../members/:memberId)
                    members
                        index() : ref(../../../members/:memberId)
            requests
                :requestId
                    member: ref(../../members/:memberId)
                    team: ref(../../teams/:teamId)
                    message : String (eg I want to join your team)
                    status: String (eg 'DENIED')

Here is the current schema

root
    events
        ref(../:eventId) : String (eg hackUST)
    :eventId
        name : (eg hackUST)
        members
            :memberId
                name : String (eg Brian)
                status : String (eg Pending)
        teams
            :teamId
                name : String (eg BrianSo Studio)
                leader: ref(../../members/:memberId)
                members
                    ref(../../../members/:memberId) : String (eg Clement)
                requests
                    ref(../../../members/:memberId)
                        msg : String (eg I want to join your team)
clementf2b commented 7 years ago

I think we can store the user data on the database and firebase got a unique uid for each account in the Authentication page. We can store the data as the following photo. For the other part, we may need to have a meeting to discuss deeply. screen shot 2016-11-10 at 8 34 21 pm

0xinterface commented 7 years ago

@BrianSo why is there no radar attribute in the user schema for storing individual skill set?

BrianSo commented 7 years ago

I think we can store the user data on the database and firebase got a unique uid for each account in the Authentication page

Do you mean the firebase built in authentication or the authentication implemented by us?

BrianSo commented 7 years ago

@narwhlae

why is there no radar attribute in the user schema for storing individual skill set?

Radar data is stored under member which depends on different events. See schema change no. 2 as quoted.

2.added radar data: the radar labels are input by the event organizer and the label values are input by the members. (this change is reference to issue #8 )

0xinterface commented 7 years ago

@BrianSo I have question about the view implementation of displaying radar chart, since each member can have their own radar chart, shouldn't there be some sort of profile page for the user for viewing? or can you show me a rough draft of user interface on display radar chart

clementf2b commented 7 years ago

@BrianSo the firebase built in authentication

BrianSo commented 7 years ago

So the built in authentication will return a uid?

clementf2b commented 7 years ago

yes

0xinterface commented 7 years ago

the newer revision of changes for firebase database schema is as follow, approved and await for implemenations

root
    eventList
        ref(../events/:eventId) : String (eg hackUST)
    events
        :eventId
            name : (eg hackUST)
            description : String (eg A 24 hours Hackathon in HKUST)
            adminPassword : md5(String)
            radar
                labels
                    :labelId : String (eg Android)
            members
                :memberId
                    user : ref(/users/:userId)
                    status: String (eg pending)
                    radar
                        skillLevels
                            ref(../../../../radar/labels/:labelId) : Number (eg 100)
            teams
                :teamId
                    name : String (eg BrianSo Studio)
                    description : String (eg Welcome to BrianSo Studio)
                    tags
                        :hash : String (eg Brian)
                    leader : ref(../../members/:memberId)
                    members
                        ref(../../../members/:memberId): String (eg clement)
            requests
                :requestId
                    member: ref(../../members/:memberId)
                    team: ref(../../teams/:teamId)
                    message : String (eg I want to join your team)
    users
        :userId
            name : String (eg Brian)
            schedule
                intervals
                    :intervalId
                        start: Number (eg 0)
                        end: Number (eg 86400)
BrianSo commented 7 years ago

As users is merged with members, the schema should be as follow:

root
    eventList
        ref(../events/:eventId) : String (eg hackUST)
    events
        :eventId
            name : (eg hackUST)
            description : String (eg A 24 hours Hackathon in HKUST)
            adminPassword : md5(String)
            radar
                labels
                    :labelId : String (eg Android)
            members
                :memberId
                    name : String (eg Brian)
                    status: String (eg pending)
                    schedule
                        intervals
                            :intervalId
                                start: Number (eg 0)
                                end: Number (eg 86400)
                    radar
                        skillLevels
                            ref(../../../../radar/labels/:labelId) : Number (eg 100)
            teams
                :teamId
                    name : String (eg BrianSo Studio)
                    description : String (eg Welcome to BrianSo Studio)
                    tags
                        :hash : String (eg Brian)
                    leader : ref(../../members/:memberId)
                    members
                        ref(../../../members/:memberId): String (eg clement)
            requests
                :requestId
                    member: ref(../../members/:memberId)
                    team: ref(../../teams/:teamId)
                    message : String (eg I want to join your team)