---
# System prepended metadata

title: LAB2

---

# LAB2
[toc]

### **Deadline** **<span style="color:red">4/13</span>**

* Demo Time: 4/12 (Wed.) 12:00 – 15:00, 4/13 (Thu.) 15:00 – 17:00

### **Grading Policy**

1. - [ ] (10%) System Architecture – Chart @chilin70 
1. - [ ] (10%) System Architecture – Description @chilin70 
1. - [ ] (10%) Specifications
1. - [ ] (20%) API Design & Documents
1. - [ ] (40%) Implementation
        * [x] (10%) Clients can send data to the server
        * [x] (10%) The server can store the received data in the database
        * [x] (10%) Clients can view the data via the website/or any UI
        * [x] (10%) API gateway
1. - [ ] (10%) Questions asked by TAs


## System Design

![](https://i.imgur.com/FBRWzJY.png)


### DB schema

#### user.user

| column | type | description              |
| ------ |:---- |:------------------------ |
| U_Id   |      |                          |
| email  |      | user email when register |
| passwd |      | user hashed passwd when register |
|        |      |                          |

#### user.info

| column   | type | description                |
|:-------- |:---- |:-------------------------- |
| U_Id     |      |                            |
| email    |      | user email                 |
| passwd   |      | user hashed passwd         |
| username |      | username display to public |
| sex      |      | man, women or other        |
|          |      |                            |

#### user.friend

TBD

#### chat.msg

| column        | type | description                  |
|:------------- |:---- |:---------------------------- |
| U_Id_sender   |      | sender U_Id                  |
| U_Id_receiver |      | receiver U_Id                |
| msg           |      | message                      |
| datetime      |      | timestamp of sending message |
|               |      |                              |

## API

### auth system

`/register`: new user
`/login`: login by email and passwd
`/info`: upload username personal info

### chat system

`/chat`: list all match friend
`/chat/<U_Id>`: list history message or chating with specific friend

### match system

`/match`: random generate person and query info of persion to match
