-
Notifications
You must be signed in to change notification settings - Fork 24
👥 Design of account sync feature
Joseph Azevedo edited this page Oct 24, 2021
·
19 revisions
- Account login via Firebase Authentication
- Document storage via Firebase Cloud Firestore
- Separation of state into schedule data (list of schedule terms, schedule versions) and view state (current schedule term, current schedule version, light/dark mode)
- Separate state into:
- schedule data
- UI state (not including light/dark mode since that is a separate local storage key)
- This uses a new hook,
useLocalStorageNoSync
, which is based on https://usehooks.com/useLocalStorage. This does not sync changes across tabs, unlikeuseLocalStorageState
(from https://github.com/astoilkov/use-local-storage-state), which is used in the schedule data.
- This uses a new hook,
- Add schedule data v2:
// Version 2 schedule data (2021-10-23) // =================================== // - addition of unique keys for schedule versions // - addition of createdAt fields for schedule versions // to provide natural, reconcilable, sort order // - removal of all `currentIndex` and `currentTerm` fields // (instead to be stored in separate ui state)
- Using Firebase UI Web for React: https://github.com/firebase/firebaseui-web-react
- Goal: local state, upon first login it gets uploaded to Firebase
- If logged out, local state remains
- (need to add some sort of reconciliation functionality)
- Add
AccountContext
to app that contains state of login, and is loaded under theAppDataLoader
- Add UI to top right with auth state, and shift around items in the header to make room
- Make the UI usable on mobile displays
- Clean up app skeletons to not need each variant and instead change based on props
- Add dark mode theming to email flow
- (future) Fix the tooltip upon copying CRNs to use a sane approach
- Use a single document-per-user's account data with the full JSON stored
- Upon initial login, upload this
- Any updates cause a write, transparently to the rest of the stack
- Fix Firestore console warning
- (future) add production Firebase app, security
- (future) TODO disable firebase integration when running locally without credentials