| 기능 | FB Service | api 함수 | Key Arguments | Response | 비고 |
|---|---|---|---|---|---|
| 회원가입 | Authentication | createUserWithEmailAndPassword |
email, password | ||
| 팬레터 추가 | Firestore | addDoc |
{ | ||
| nickname: "닉네임", | |||||
| content: "내용" | |||||
| } | |||||
| 팬레터리스트 조회 | Firestore | getDocs |
[ { | ||
| “속성1”: 데이터1 | |||||
| }, … ] | |||||
| 프로필 수정 | Authentication | updateProfile |
(수정할 속성만 선택적으로 기입) | ||
| { | |||||
| displayName: “변경할 닉네임”, | |||||
| photoURL: “변경할 프로필이미지” | |||||
| } | |||||
| 이미지 업로드 | Storage | uploadBytes |
File 객체 |
참고: https://firebase.google.com/docs/firestore/manage-data/add-data?hl=ko&authuser=0
<aside> 💡
</aside>
Firebase는 NoSQL 이기 때문에 ERD (Entity Relation Diagram)으로 Table 및 Table간 관계를 명시할 필요는 없으나 아래와 같이 Collection 설계는 반드시 필요합니다.
| Post Collection | Type |
|---|---|
| title | String |
| content | String |
| creator | String |
| createdAt | String |
| comments | Array: Object[] |
| likes | Array: String[] |
<aside> 💡
Firebase 콜렉션 설계 예시
</aside>