aburd / beats-with-friends

A piece of software where beatmakers can make beats with each other.
3 stars 0 forks source link

Feat/group chat #24

Closed kimm950 closed 1 year ago

kimm950 commented 2 years ago

IMPORTANT: Please do not create a Pull Request without creating an issue first.

close https://github.com/aburd/beats-with-friends/issues/12

Screen Shot 2022-08-29 at 18 14 23

*Any change needs to be documented in issues so that people are aware of what's being developed. Made chats as a top-level key in the db

I created the new API and the db setting for the chat.

Screen Shot 2022-09-21 at 13 22 12
chats {
 chat {
  id: whatEverId(group || song)
  messages: {
    messageKey: {
      message
   }
  }
 }
}

Users can send messages in the group

none

aburd commented 2 years ago

@kimm950 Tested out the feature. Works great! I made some suggestions though!

basileberjot commented 2 years ago

@kimm950 I noticed the beat player starts when typing a message and entering space key. Other than that feature works great!

kimm950 commented 2 years ago

@aburd

to make chats a top-level key in firebase

Agreed and I started working on this. Got one thing to discuss though. Do you think I should generate group data by using the new chat API? like how you did for the users in group? or call the chat API independently from the component directly?

aburd commented 2 years ago

@kimm950

Do you think I should generate group data by using the new chat API? like how you did for the users in group? or call the chat API independently from the component directly?

If I understand what you're asking correctly, you're wondering about how much logic surrounding the API we should expose to components by putting most of the logic in the API modules, right? maybe like what I did here.

If that's the case, the components shouldn't know about any of the messy details of the database. The API should take care of all the heavy-lifting. For example, all the users can do right now is chat inside the group. Therefore, when you create a group, it should come with a chat. So you'd need to add that chat create api, then include it in the group create api. The page component should do all the data fetching as is necessary and pass it on to its children.

At least that's what I feel!

kimm950 commented 2 years ago

@aburd

So you'd need to add that chat create api, then include it in the group create API

let me do this 👍 thanks for the suggestions

kimm950 commented 1 year ago

@aburd Made the chat as a top-level key and resolved the conflicts from this PR

aburd commented 1 year ago

@kimm950 LGTM!