20210621
기존의 AWS 서버를 이용하여 LAMP 방식을 사용할까 하다가 요새는 앱 개발에 Firebase를 많이 사용한다고 하여 그것을 써 보기로 한다.
초반에 사용자가 적을 때는 free라고 한다.
특히 authentication을 위해서 email 뿐 아니라 phone SMS 방식을 지원하기 때문에 사용자 편의성이 높다.
20210622
Firebase에서 제공하는 DB 중에서 Realtime Database와 Cloud Firestore가 있는데, Realtime Database가 약간 더 빠른 듯(?)하고
read-write 횟수가 아니라 용량에 따라 과금하기 때문에 본 프로젝트같은 text 위주의 contents에서는 더 유리할 듯 하지만
복잡한 query를 사용할 수 없다는 것, JSON 방식으로서 child node 개수가 많아지면 시간 지연이 심해진다는 점,
DB가 커지면 저절로 스케일링되는 게 아니라 샤딩(?)을 해 줘야한다는 점, 등등 단점이 많은 듯 하다.
아마 이러한 단점들 때문에 Cloud Firestore가 새로 개발된 것 같다. 그래서 Cloud Firestore를 사용하기로 한다.
20210625
Cloud Firestore 공부 중이다.
20210727
Firebase Authentication
navigation in SwiftUI
The following tutorial is helpful.
But this is in old version of Swift. It should be modified a little as follows.
another firebase tutorial:
Firebase Tutorial: Getting Started
Learn Firebase fundamentals including saving data, real-time sync, authentication, user status and offline support.
swift 공부할 필요.
@StateObject, @ObservedObject, @EnvironmentObject in Swift
SwiftUI는 iOS 14부터 AppDelegate, SceneDelegate 를 사용하지 않는다고 함.
(그런데 위 예들은 AppDelegate를 사용하고 있음.)
어떻게 바뀌었는지 정리한 글.
Firebase 를 swift 에서 사용하는 기존 방식은 AppDelegate 를 사용한다.
새로운 방식들:
결국 firebase homepage 를 참고하는 게 제일 좋을 듯.
--------------
Finally
--------------
1. Add Firebase to iOS project
https://www.treeofwords.com/walu/AccessMonad?i=12707
2. Sample iOS project with Firebase
3. enable sign-in method in Firebase console
select Authentication > Sign-in method > enable "email/password" or etc.
4. sign up in iOS device
check in Firebase console
select Authentication > Users
You can see that there is a new user just signed up.
----------------
Firestore
----------------