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

[SPENCER | TONY] Sign Up - DB Connection #10

Open
4 tasks
lillian-tran opened this issue Oct 19, 2024 · 0 comments
Open
4 tasks

[SPENCER | TONY] Sign Up - DB Connection #10

lillian-tran opened this issue Oct 19, 2024 · 0 comments
Assignees
Milestone

Comments

@lillian-tran
Copy link
Collaborator

lillian-tran commented Oct 19, 2024

Task Description:

When a user creates an account using the sign up form, we want the user to be created in our MongoDB database.
Make an API endpoint that takes in user data from the sign up form and creates the user. We don’t want to create duplicate users so if the email or username already exists in the database, display an error message to the console instead of creating a new user. For the isAdmin field, for now just hard-code it to be false. Don’t worry about authentication, we’ll be working on it in future sprints with Clerk!

References and Resources:

Express docs: https://expressjs.com/en/guide/routing.html
Mongoose docs: https://mongoosejs.com/docs/
MongoDB collection commands: https://www.mongodb.com/docs/manual/reference/method/js-collection/
Using Express with MongoDB and Mongoose: https://dev.to/franciscomendes10866/setup-mongodb-with-mongoose-and-express-4c58
Async/await: https://medium.com/@Abazhenov/using-async-await-in-express-with-node-8-b8af872c0016
(Optional but helpful for debugging): https://apidog.com/blog/how-to-use-postman-for-api-testing/

Acceptance Criteria:

  • Did you link the ticket/issue number with your branch using the pull request template?
  • When the sign up form is submitted, is there a new user in the database?
  • If an existing user (email) tries to sign up, is there an error message?
  • If a username already exists, is there an error message when someone tries to reuse it?
@lillian-tran lillian-tran added this to the SPRINT2 milestone Oct 19, 2024
@lillian-tran lillian-tran changed the title [SPENCER | TONY] Sign Up - Mongo Connection [SPENCER | TONY] Sign Up - DB Connection Oct 19, 2024
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

No branches or pull requests

3 participants