-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a combination of 2 commits. This is a combination of 3 commits. Implemented user registration feature with input validation, password hashing, and database integration user login feature Implemented user registration feature with input validation, password hashing, and database integration fix(user registration): resolve registration bug - ensure that a user provide neccessary inputs - restructure user entity - refactor other codes depending on user registration logic [Fixes #39] rebasing from develop , adding verifie route and service and send email to the user rebasing from develop , adding verifie route and service and send email to the user fix(user registration): resolve registration bug - ensure that a user provide neccessary inputs - restructure user entity - refactor other codes depending on user registration logic [Fixes #39] Update README.md user login feature
- Loading branch information
1 parent
a6c5eac
commit 21fd82e
Showing
28 changed files
with
906 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
PORT= ******************************** | ||
APP_ENV= ******************************** | ||
PDN_DB_NAME= ***************************** | ||
|
||
TEST_DB_HOST= ******************************** | ||
TEST_DB_PORT= ******************************** | ||
TEST_DB_USER= ******************************** | ||
TEST_DB_PASS= ******************************** | ||
TEST_DB_NAME= ******************************** | ||
|
||
DEV_DB_HOST= ******************************** | ||
DEV_DB_PORT= ******************************** | ||
DEV_DB_USER= ******************************** | ||
DEV_DB_PASS= ***************************** | ||
DEV_DB_TYPE= ******************************* | ||
DEV_DB_NAME= ******************************* | ||
|
||
PDN_DB_HOST= ******************************** | ||
PDN_DB_PORT= ******************************** | ||
PDN_DB_USER= ******************************** | ||
PDN_DB_PASS= ******************************** | ||
PDN_DB_PASS= ******************************** | ||
PDN_DB_NAME= ***************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ package-lock.json | |
coverage/ | ||
dist | ||
/src/logs | ||
.DS_Stor | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class CreateUserMigration1614495123940 implements MigrationInterface { | ||
public async up (queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
CREATE TABLE "user" ( | ||
"id" uuid NOT NULL DEFAULT uuid_generate_v4(), | ||
"firstName" character varying NOT NULL, | ||
"lastName" character varying NOT NULL, | ||
"email" character varying NOT NULL, | ||
"password" character varying NOT NULL, | ||
"gender" character varying NOT NULL, | ||
"phoneNumber" character varying NOT NULL, | ||
"photoUrl" character varying, | ||
"verified" boolean NOT NULL, | ||
"status" character varying NOT NULL CHECK (status IN ('active', 'suspended')), | ||
"userType" character varying NOT NULL DEFAULT 'Buyer' CHECK (userType IN ('Admin', 'Buyer', 'Vendor')), | ||
"createdAt" TIMESTAMP NOT NULL DEFAULT now(), | ||
"updatedAt" TIMESTAMP NOT NULL DEFAULT now(), | ||
CONSTRAINT "UQ_e12875dfb3b1d92d7d7c5377e22" UNIQUE ("email"), | ||
CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id") | ||
) | ||
`); | ||
} | ||
|
||
public async down (queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP TABLE "user"`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,39 @@ | ||
module.exports = { | ||
"type": "postgres", | ||
"host": `${process.env.DEV_DB_HOST}`, | ||
"port": `${process.env.DEV_DB_PORT}`, | ||
"username": `${process.env.DEV_DB_USER}`, | ||
"password": `${process.env.DEV_DB_PASS}`, | ||
"database": `${process.env.DEV_DB_NAME}`, | ||
"synchronize": true, | ||
"logging": false, | ||
"entities": [ | ||
"src/entities/**/*.ts" | ||
], | ||
"migrations": [ | ||
"src/migrations/**/*.ts" | ||
], | ||
"subscribers": [ | ||
"src/subscribers/**/*.ts" | ||
], | ||
"cli": { | ||
"entitiesDir": "src/entities", | ||
"migrationsDir": "src/migrations", | ||
"subscribersDir": "src/subscribers" | ||
} | ||
}; | ||
const devConfig = { | ||
type: 'postgres', | ||
host: process.env.DEV_DB_HOST, | ||
port: process.env.DEV_DB_PORT, | ||
username: process.env.DEV_DB_USER, | ||
password: process.env.DEV_DB_PASS, | ||
database: process.env.DEV_DB_NAME, | ||
synchronize: true, | ||
logging: false, | ||
entities: ['src/entities/**/*.ts'], | ||
migrations: ['src/migrations/**/*.ts'], | ||
subscribers: ['src/subscribers/**/*.ts'], | ||
cli: { | ||
entitiesDir: 'src/entities', | ||
migrationsDir: 'src/migrations', | ||
subscribersDir: 'src/subscribers', | ||
}, | ||
}; | ||
|
||
const testConfig = { | ||
type: 'postgres', | ||
host: process.env.TEST_DB_HOST, | ||
port: process.env.TEST_DB_PORT, | ||
username: process.env.TEST_DB_USER, | ||
password: process.env.TEST_DB_PASS, | ||
database: process.env.TEST_DB_NAME, | ||
synchronize: true, | ||
logging: false, | ||
entities: ['src/entities/**/*.ts'], | ||
migrations: ['src/migrations/**/*.ts'], | ||
subscribers: ['src/subscribers/**/*.ts'], | ||
cli: { | ||
entitiesDir: 'src/entities', | ||
migrationsDir: 'src/migrations', | ||
subscribersDir: 'src/subscribers', | ||
}, | ||
}; | ||
|
||
module.exports = process.env.NODE_ENV === 'test' ? testConfig : devConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.