-
Notifications
You must be signed in to change notification settings - Fork 0
Description
User Signup
Description: Create new user accounts with Firebase Auth and initialize user data in database
AC:
Frontend: Signup form with email/password/confirm password
Frontend: Password strength indicator
Frontend: Real-time validation feedback
Backend: Create user record in Postgres with Firebase UID
Backend: Return success with user data
Frontend: Auto-login after successful signup
Frontend: Terms of service checkbox
Tech Notes (take #2)
*Missing: password requirements (min length? complexity rules?)
Our Firebase password policy has these requirements:
-Minimum length: 8 characters
-Maximum length: 12 characters
-Must include:
-1 uppercase character
-1 lowercase character
-1 special character
-1 numeric character
*Firebase Auth method (createUserWithEmailAndPassword)
--Our method: createUserWithEmailAndPassword(auth, email, password). This creates a new user account associated with the specified email address and password. On successful creation of the user account, this user will also be signed in to the application.
*How FastAPI verifies token (Firebase Admin SDK? which endpoint?)
--FastAPI receives the Firebase token from the frontend, verifies it, then communicates with our Postgres db to then receive back JSON with user data.
--ENDPOINT: POST /users/init to create the db row in Postgres
*Postgres schema for user table
--Our user table schema has these columns:
--*id — UUID, primary key
--*firebase_uid — string (max 128), unique identifier from Firebase Auth
--*email — string (max 254), optional
--*display_name — string (max 100), optional
--*created_at — timestamp, defaults to the current time
*Race condition handling (Firebase creates user but Postgres insert fails?)
--We would use try-catch & rollback logic (if Postgres insert fails, delete the Firebase user).
*What user data gets stored in Postgres vs Firebase?
--Postgres stores id, firebase uid, email, display name & "created at" entry. Firebase simply stores an identifier (in our case email address), the type of provider (email), "created at" info, "signed in" info, and the Firebase User UID.
*"landing page within the app" - which route/component?
--Upon successfully signing up, user would be routed to /dashboard
Tech Notes:
Once our database is set up and I have that code pulled down, I will set up a Firebase Auth account for this project. Firebase Auth will store the credentials of users who sign up. It also verifies credentials of users logging in. If it is a valid user, the frontend gets an ID token from Firebase and passes it to our FastAPI backend. FastAPI will verify that token from Firebase and send JSON data back from our Postgres database.
After installing Firebase in the project, I will create a configuration file to store information connecting Firebase to our project that can be imported into whichever components need to access Firebase Auth.
I will then create a "SignupScreen" component within a "screens" subfolder. In that file will be the code creating the form for signing up. I'll import React which will be necessary for JSX and the "use state" hook allowing us to store the component state as well as other React tools related to the UI.
The Signup form will have fields for user's email. It will have two fields for password - one for inputting the password and a second for ensuring you've put the desired password. Our form will show password strength by setting value to the various ways the password may be entered and also have a toggle button to make the password visible to the user as it is input. There will also be another link for "Terms of Service" that will pop up so the user can read it before checking a Terms of Service Checkbox which will also be required before a user can sign up. This will have to be a separate component. We'll have a button for "Sign up" and when that is a success it will take the user to a landing page within the app.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status