Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added create user endpoints #29

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

kilehsu
Copy link

@kilehsu kilehsu commented Jan 22, 2025

Tracking Info

Resolves #9

Changes

Added create user backend that works in both the MongoDB and Firebase. It checks the body to make sure the request is correct and it handles email duplication.

  • TODO
    Correctly implementing with firebase
    I used my own firebase config and it seems to work. Not sure if this is how we want to intialize our firebase in the future.

Testing

I have tested to make sure it creates a user
image

image image image

Tested with validator errors
image
image
image
image

@kilehsu kilehsu requested a review from mraysu as a code owner January 22, 2025 00:37
@mraysu
Copy link
Collaborator

mraysu commented Jan 22, 2025

Looks good, a few things before I can approve.

  1. In backend/src/app.ts, we do not need to invoke dotenv.config(), this is what backend/src/config.ts is for. Use config.ts for verifying and exporting backend environment variables.
  2. In backend/src/controllers/user.ts, we want to make sure our errors are propagating across our middleware functions. Please add a next: NextFunction parameter to the createUser function, and pass caught errors to said function. example
  3. @SaazM created a service account key for us to use and added it to our .env variables. Check the drive for the updated .env so we can save the key as a single shared secret.
  4. In backend/src/util/firebase.ts, to initialize our app, you shouldn't need to specify a databaseURL since we aren't using a firebase database.

Please merge your code with main and push these changes.

@mraysu mraysu requested a review from SaazM January 23, 2025 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create User Backend Route
2 participants