1. DB 설계 및 프로젝트 구조 - jmini1234/tripmate GitHub Wiki

1. DB 설계

Firebase Realtime Database

일반적인 HTTP 요청이 아닌 동기화를 사용하므로 데이터가 변경될 때마다 연결된 모든 기기가 수 밀리초 내에 업데이트를 수신한다.

"fcmTokens":{
    "token-key":"token-value", 
    ...
}
"messages":{
    "BERLIN(GERMANY)":{
        "message_image_key":{
            "imageUrl":"profile URL",
            "location":"location info",
            "name": "current username",
            "storageUrl":"image file URL",
            "time":"sending time"
        }, 
        "message_text_key":{
            "imageUrl":"profile URL",
            "location":"location info",
            "name": "current username",
            "text":"input text",
            "time":"sending time"
        },
        ...
    }, 
    "DANANG(VIETNAM)": {...},
    ...
}
"status":{
    "username":{
        "bookmark":{
            "bookmarkkey":{
                "image":"bookmark image URL",
                "status": "room name",
                "time":"message time"
            },
            ...
        },
        "location":{
            "status":"current room name"
        }
    },
    ...
}

2. 프로젝트 구조

project Structure

tripmate
├─ .firebase
├─ .git
├─ functions
│  ├─ .eslintrc.json
│  ├─ index.js
│  ├─ package.json
├─ public
│  ├─ images
│  ├─ scripts
│  |  ├─ list.js
│  |  ├─ login.js
│  |  ├─ main.js
│  |  ├─ map.js
│  ├─ styles
│  |  ├─ index.css
│  |  ├─ list.css
│  |  ├─ main.css
│  |  ├─ map.css
│  ├─ favicon.ico
│  ├─ firebase-messaging-sw.js
│  ├─ index.html
│  ├─ list.html
│  ├─ main.html
│  ├─ manifest.json
│  ├─ test.html
├─ .firebaserc
├─ .gitignore
├─ database-rules.json
├─ firebase.json
├─ storage.rules
└─ README.md