Closed ghost closed 6 years ago
System Architecture(Chat)
(실제로 snippetable_id는 하나다. ERDPlus tool에서는 2개로 표현할수 밖에 없다.)
User : email과 password는 매니저로 가입할때 사용된다. 매니저가 아닐때 channel_id는 유저가 접속해있는 채널이 id를 뜻한다. image는 프로필 이미지 주소로 사용된다. Channel: manager_id 채널을 관리하는 유저의 id이다. name은 channel의 이름이고, duration은 채널의 지속 시간이다. DirectMessage: sender_id는 DM을 보낸 유저의 아이디이고 receiver_id는 DM을 받은 유저의 아이디이다. Snippet: snippet_type은 관리자의 공지사항인지 아니면 일반 대화인지를 구분하는 column이다. snippetable_id는 snippet이 참조하는 테이블의 id이고, snippetable_type은 참조하는 테이블의 이름이다. user_id는 snippet을 보낸 유저의 아이디이다. content는 유저가 입력한 대화의 내용이다.
User가 매니저일때(is_manager = true) Channel과 1:1관계이다. User가 매니저가 아닐때(is_manager = false) Channel과 1:N관계이다. User는 sender의 관점에서 보낸 DirectMessage와 1:N관계이다. User는 receiver의 관점에서 받은 DirectMessage와 1:N관계이다. User와 Snippet는 1:N 관계이다. User 모델은 DirectMessage모델을 이용한 User - User를 M:N관계이다. Channel과 Snippet은 snippetable_id = channel_id 이고 snippetable_type = Channel이면 1:N 관계이다. DirectMessage와 Snippet은 snippetable_id = direct_message_id 이고 snippetable_type = DirectMessage이면 1:N 관계이다.
----------------- EN In fact, the snippetable_id is one. In the ERDPlus tool, we can only express it as two.
model column Description User: Email and password are used to sign up as a manager. When not in the manager, channel_id is the id of the channel the user is connected to. image is used as the profile image address. Channel: Manager_id is the id of the user managing the channel. name is the name of the channel, and duration is the duration of the channel. DirectMessage: Sender_id is the id of the user who sent the direct message and receiver_id is the id of the user who received the direct message. Snippet: The snippet_type is a column that identifies whether the snippet_type is an manger's announcement or a general conversation. snippetable_id is the id of the table referenced by the snippet, and snippetable_type is the name of the referencing table. User_id is the id of the user who sent the snippet. content is the content of the conversation entered by the user.
Relationship Description When the user is a manager (is_manager = true), it has a 1: 1 relationship with the channel. When the user is not a manager (is_manager = false), it is a 1: N relationship with the Channel. User is 1: N relationship with Direct Message sent from sender's point of view. User is a 1: N relationship with Direct Message received from the perspective of the receiver. User and Snippet are in 1: N relationship. User model is User: User using Direct Message model is M: N relationship. Channel and Snippet are 1: N if snippetable_id = channel_id and snippetable_type = Channel. Direct Message and Snippet are 1: N if snippetable_id = direct_message_id and snippetable_type = Direct Message.
8.API 명세서 : ResetFul + Websocket(새로운 Protocol 정의 필수) @sdu6342
backend design
Model | API | GET | POST | PUT | DELETE |
---|---|---|---|---|---|
User | /user | x | create new user | edit user info | x |
/session | x | sign in | x | sign out | |
Channel | /channel/:channel_hash | get specific channel | x | x | x |
/channel | x | create new channel | x | x | |
DirectMessage | /dm/:channel_hash | get specific direct message (giver, receiver) | x | x | x |
Snippet | /snippet/:type/:id | get snippets by snippet able type & id | x | x | x |
requirements
주고 받는 패킷
{event: integer,
data : object
status: integer(보낸 메시지의 응답 결과일때만 존재함)
}
event는 보내는 요청 또는 응답이 무엇인지를 결정 해준다. data는 해당 이벤트의 결과 값이나 참고해야할 값을 내포한다. 다음의 리스트는 요청 또는 응답에 대한 event list 이다.
Client -> Server events(Request)
Server -> Client events(Response)
TODO : 패킷처리 에러에 대한 리스트 정리, 위 메시지 프로토콜이 최선인지 고민
--------------en The data sent and received by websocket are as follows.
{event: integer,
data: object,
status: integer (exists only if it is response from server)}
The event determines which request or response is sent. data contains the result value of the event or reference value. The following list is the event list for the request or response.
System Architecture
Implementation Plan
Divide the project implementation into the pages that fulfill the requirements of the project.
The distribution of the view by sprint is as follows.
The following table divides the implementation into functions and distributes them to the team members. Each row has a function to implement and an expected time to implement.
page | feature | difficulties | time(mins) | sprint | person | Challenge |
---|---|---|---|---|---|---|
Main | All page routing | 1 | 60 | 2 | 이경환 | |
Channel | User can send message to the channel | 3 | 120 | 3 | 서동욱 | django channel setting |
Channel | User can see other new user's or deleted user's info of the channel | 3 | 120 | 3 | 서동욱 | |
Channel | User can receive messages from the channel | 4 | 180 | 3 | 서동욱, 채경완 | redis |
Channel | Manager can send notice to the manager's channel | 2 | 90 | 3 | 이경환 | |
Channel | User can see all snippets of the channel | 2 | 90 | 3 | 이경환 | |
Channel New | User can make an channel | 2 | 90 | 3 | 채경완 | |
Direct Message | User can make direct meesage with other user | 3 | 120 | 4 | 서동욱 | |
Direct Message | User can send meesage in direct message | 2 | 90 | 4 | 이경환 | |
Direct Message | User can receive meessage in direct message | 2 | 90 | 4 | 채경완 | |
Direct Message | User can receive alram about new direct message or new snippet of channel | 4 | 180 | 4 | 서동욱, 이경환 | |
User Access | User can change profile or name and access to channel | 2 | 90 | 4 | 채경완 | |
Sign Up | User can make a manager account | 2 | 60 | 5 | 서동욱, 채경완 | |
Sign Up | User can sign In as a manager | 2 | 60 | 5 | 채경완, 이경환 |
We would set up our testing from sprint 3,
We except our testing coverage up to 90%.
Details are below
참고 자료 https://github.com/swsnu/swppfall2018/blob/master/project/design-and-planning-examples/Design_and_Planning_example.pdf
To Do List
[x] 1.System Architecture : MVC @sdu6342
[x] 2.Model : ER-diagram(DB, Class) @sdu6342
[x] 3.View : all page & details @KyoungWan
[x] 4.Controller : data flow (client - server) using MVC @KyoungWan
[x] Design Detail
위의 것들을 작성한 후, 밑의 2개는 같이 해야할 듯!
[x] Implementation Plan : 스프린트 별로 할 일들 (#5 Spec문서에도 포함되어야 한다.)
[x] Testing Plan