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

feat(sign up): implement users sign up #10

Merged
merged 2 commits into from
Apr 19, 2024
Merged

Conversation

yvanddniyo
Copy link
Collaborator

@yvanddniyo yvanddniyo commented Apr 18, 2024

What does this PR do?
This pull request addresses the implementation of a sign-up method utilizing PostgreSQL as the backend database. The sign-up process allows new users to register for an account within the system.

Description of Task to be completed?
Here are the endpoint working:

  • GET /api/v1/users
  • POST /api/v1/users/register

How should this be manually tested?

  1. Clone the repository.
  2. Checkout to the branch ft-user-signup-#187431242.
  3. Run npm install to install dependencies.
  4. Run npm run dev to start the development server.
  5. Open your postman or other your testing app and run http://localhost:3000/api/v1/users this allow you to retrieve existing user within in the database.
  6. Use the endpoint of http://localhost:3000/api/v1/users/register to register a user using name, username, email and password.

What are the relevant pivotal tracker stories?
#187431242

Screenshot

test screenshoot

Screenshot (1)

 - user can be to sign up using name, username, email, and password.
 - user can't be able to sign up  twice using same email.

[Delivers #187431242]
@soleil00
Copy link
Collaborator

your branch ahs conflict did u forget to pull??
ffrom origin dev??

@yvanddniyo yvanddniyo force-pushed the ft-user-signup-#187431242 branch 2 times, most recently from d7fb1a0 to fbba50d Compare April 18, 2024 11:30
Comment on lines 7 to 13
dialect: "postgres",
dialectOptions: {
ssl: {
require: true,
rejectUnauthorized: false,
},
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think this can allow us to use local database

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allow us to connect to the deployed Database so we are no longer use local database. we're using the deployed one.

@@ -1,6 +1,7 @@
import express from "express";
import cors from "cors";
import appROutes from "../routes";
import userRoutes from "../routes/userRoutes";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this our main router

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i fix it

@teerenzo
Copy link
Member

work also on your PR naming conversion

@yvanddniyo yvanddniyo force-pushed the ft-user-signup-#187431242 branch from fbba50d to 76e7975 Compare April 18, 2024 18:41
@teerenzo
Copy link
Member

testing are failing on CI/CD

@yvanddniyo yvanddniyo force-pushed the ft-user-signup-#187431242 branch from 76e7975 to 87cfeb7 Compare April 18, 2024 19:54
package.json Outdated
@@ -11,11 +11,13 @@
"seed": "npx sequelize-cli db:seed:all",
"lint": "npx eslint .",
"lint:fix": "npx eslint --fix .",
"test": "cross-env NODE_ENV=test jest --detectOpenHandles --coverage"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bring back cross-env NODE_ENV=test

@@ -7,11 +7,18 @@ module.exports = {
dialect: "postgres",
},
test: {
url: process.env.TEST_DB,
url: process.env.TEST_DB_CONNECTION,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove TEST_DB_CONNECTION instead use TEST_DB

src/utils/env.ts Outdated
@@ -4,5 +4,5 @@ dotenv.config();
export const env = {
port: process.env.PORT || 3000,
db_url: process.env.DB_CONNECTION as string,
test_db_url: process.env.TEST_DB as string,
test_db_url: process.env.TEST_DB_CONNECTION as string,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same issue remove TEST_DB_CONNECTION use TEST_DB

@yvanddniyo yvanddniyo force-pushed the ft-user-signup-#187431242 branch from 87cfeb7 to 90bf557 Compare April 18, 2024 20:46
@yvanddniyo yvanddniyo force-pushed the ft-user-signup-#187431242 branch from 90bf557 to 22a0bc3 Compare April 18, 2024 20:58
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@teerenzo teerenzo merged commit f554f6b into dev Apr 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants