diff --git a/Shopify-Cart/src/main/resources/application.properties b/Shopify-Cart/src/main/resources/application.properties index 44b3588..9304483 100644 --- a/Shopify-Cart/src/main/resources/application.properties +++ b/Shopify-Cart/src/main/resources/application.properties @@ -1,7 +1,7 @@ server.port=8002 -spring.datasource.url=jdbc:mysql://10.3.117.26:3306/Shopify_DB?createDatabaseIfNotExist=true -spring.datasource.username=testuser +spring.datasource.url=jdbc:mysql://10.3.117.23:3306/Shopify_DB?createDatabaseIfNotExist=true +spring.datasource.username=testuser1 spring.datasource.password=PASSWORD123 server.servlet.context-path=/api2 diff --git a/ShopifyUI/proxy.conf.json b/ShopifyUI/proxy.conf.json index b722973..c5e5576 100644 --- a/ShopifyUI/proxy.conf.json +++ b/ShopifyUI/proxy.conf.json @@ -1,14 +1,14 @@ { "/api1": { - "target": "http://10.3.117.26:8001", + "target": "http://10.3.117.23:8001", "secure": false }, "/api2": { - "target": "http://10.3.117.26:8002", + "target": "http://10.3.117.23:8002", "secure": false }, "/api3": { - "target": "http://10.3.117.26:8003", + "target": "http://10.3.117.23:8003", "secure": false } } \ No newline at end of file diff --git a/ShopifyUI/src/app/app-routing.module.ts b/ShopifyUI/src/app/app-routing.module.ts index 4b229cc..a42caa0 100644 --- a/ShopifyUI/src/app/app-routing.module.ts +++ b/ShopifyUI/src/app/app-routing.module.ts @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { LoginComponent } from './auth/login/login.component'; import { SignUpComponent } from './auth/sign-up/sign-up.component'; +import { AdminComponent } from './components/admin/admin.component'; import { CartComponent } from './components/cart/cart.component'; import { HomeComponent } from './components/home/home.component'; import { PaymentsComponent } from './components/payments/payments.component'; @@ -16,7 +17,8 @@ const routes: Routes = [ { path: 'cart/:user_id', component: CartComponent}, { path: 'payment', component: PaymentsComponent}, { path: 'login', component: LoginComponent}, - { path: 'signup', component: SignUpComponent} + { path: 'signup', component: SignUpComponent}, + { path: 'admin', component: AdminComponent}, ]; @NgModule({ diff --git a/ShopifyUI/src/app/auth/login/login.component.ts b/ShopifyUI/src/app/auth/login/login.component.ts index 4d211ba..5142888 100644 --- a/ShopifyUI/src/app/auth/login/login.component.ts +++ b/ShopifyUI/src/app/auth/login/login.component.ts @@ -33,14 +33,18 @@ export class LoginComponent implements OnInit { username: this.loginForm.value.username, password: this.loginForm.value.password } - // this.userService.loginUser(user).subscribe(data => { - // window.sessionStorage.setItem("username", user.username); - // window.sessionStorage.setItem("authcode", btoa(user.username + ":" + user.password)); - // window.sessionStorage.setItem("isLoggedIn", "true"); - // this.route.navigateByUrl("/"); - // }, - // (err: any) => { - // this.msg = "Invalid Credentials" - // }) + this.userService.loginUser(user).subscribe(data => { + console.log(data) + this.userService.getUserByName(user.username).subscribe(data1 => { + window.sessionStorage.setItem("username", user.username); + window.sessionStorage.setItem("user_id", String(data1.id)); + window.sessionStorage.setItem("authcode", btoa(user.username + ":" + user.password)); + window.sessionStorage.setItem("isLoggedIn", "true"); + this.route.navigateByUrl("/"); + }) + }, + (err: any) => { + this.msg = "Invalid Credentials" + }) } } diff --git a/ShopifyUI/src/app/auth/sign-up/sign-up.component.css b/ShopifyUI/src/app/auth/sign-up/sign-up.component.css index b070a5a..2cbc823 100644 --- a/ShopifyUI/src/app/auth/sign-up/sign-up.component.css +++ b/ShopifyUI/src/app/auth/sign-up/sign-up.component.css @@ -3,6 +3,7 @@ border: none; padding: 16px; height: 570px; + overflow-y: scroll; box-shadow: 2px 4px 14px 0px rgba(0, 0, 0, 0.74); -webkit-box-shadow: 2px 4px 14px 0px rgba(0, 0, 0, 0.74); -moz-box-shadow: 2px 4px 14px 0px rgba(0, 0, 0, 0.74); @@ -29,5 +30,4 @@ .login_form p { color: #E74C3C; -} - \ No newline at end of file +} \ No newline at end of file diff --git a/ShopifyUI/src/app/auth/sign-up/sign-up.component.html b/ShopifyUI/src/app/auth/sign-up/sign-up.component.html index f6a4244..6a85182 100644 --- a/ShopifyUI/src/app/auth/sign-up/sign-up.component.html +++ b/ShopifyUI/src/app/auth/sign-up/sign-up.component.html @@ -29,6 +29,41 @@

Invalid Password



+ +
+

Invalid Mobile Number

+
+

+ +
+

Invalid Email

+
+

+ +
+

Invalid Address

+
+

+ +
+

Invalid City

+
+

+ +
+

Invalid State

+
+

+ +
+

Invalid Country

+
+

+ +
+

Invalid PinCode

+
+

diff --git a/ShopifyUI/src/app/auth/sign-up/sign-up.component.ts b/ShopifyUI/src/app/auth/sign-up/sign-up.component.ts index 5616eec..5d63892 100644 --- a/ShopifyUI/src/app/auth/sign-up/sign-up.component.ts +++ b/ShopifyUI/src/app/auth/sign-up/sign-up.component.ts @@ -19,6 +19,13 @@ export class SignUpComponent implements OnInit { name: new FormControl(''), username: new FormControl(''), password: new FormControl(''), + mobileNumber: new FormControl(''), + emailId: new FormControl(''), + address: new FormControl(''), + city: new FormControl(''), + state: new FormControl(''), + country: new FormControl(''), + pinCode: new FormControl('') }) } @@ -26,7 +33,14 @@ export class SignUpComponent implements OnInit { this.signUpForm = new FormGroup({ name: new FormControl('', Validators.required), username: new FormControl('', Validators.required), - password: new FormControl('', Validators.required) + password: new FormControl('', Validators.required), + mobileNumber: new FormControl('',Validators.required), + emailId: new FormControl('',Validators.required), + address: new FormControl('',Validators.required), + city: new FormControl('',Validators.required), + state: new FormControl('',Validators.required), + country: new FormControl('',Validators.required), + pinCode: new FormControl('',Validators.required) }) } @@ -35,13 +49,21 @@ export class SignUpComponent implements OnInit { name: this.signUpForm.value.name, username: this.signUpForm.value.username, password: this.signUpForm.value.password, + mobileNumber: this.signUpForm.value.mobileNumber, + emailId: this.signUpForm.value.emailId, + address: this.signUpForm.value.address, + city: this.signUpForm.value.city, + state: this.signUpForm.value.state, + country: this.signUpForm.value.country, + pinCode: this.signUpForm.value.pinCode, + } - // this.userService.postUser(user).subscribe(data => { - // this.route.navigateByUrl("/login?msg=sign-up%20success"); - // }, - // (err: any) => { - // this.msg = "Could Not Sign In"; - // }) + this.userService.postUser(user).subscribe(data => { + this.route.navigateByUrl("/login?msg=sign-up%20success"); + }, + (err: any) => { + this.msg = "Could Not Sign In"; + }) } } diff --git a/ShopifyUI/src/app/components/admin/admin.component.css b/ShopifyUI/src/app/components/admin/admin.component.css index e69de29..05e567b 100644 --- a/ShopifyUI/src/app/components/admin/admin.component.css +++ b/ShopifyUI/src/app/components/admin/admin.component.css @@ -0,0 +1,18 @@ +.admin-heading { + font-size: 5em; + font-weight: 700; + color: #1B4F72; +} + +.card-heading { + /* font-size: 5em; */ + font-weight: 500; + background-color: #1B4F72; + padding: 12px 16px; + height: 250px; + border-radius: 20px; +} + +.card-heading h3 { + vertical-align: middle; +} \ No newline at end of file diff --git a/ShopifyUI/src/app/components/admin/admin.component.html b/ShopifyUI/src/app/components/admin/admin.component.html index 49659db..0e74394 100644 --- a/ShopifyUI/src/app/components/admin/admin.component.html +++ b/ShopifyUI/src/app/components/admin/admin.component.html @@ -1 +1,38 @@ -

admin works!

+ +


+
+
+

Welcome Admin

+
+
+


+
+
+
+

+

View All Orders

+
+
+
+
+

+

View All Products

+
+
+
+
+

+

View User Requests

+
+
+
\ No newline at end of file diff --git a/ShopifyUI/src/app/components/cart/cart.component.html b/ShopifyUI/src/app/components/cart/cart.component.html index bd442c0..8e3f2dd 100644 --- a/ShopifyUI/src/app/components/cart/cart.component.html +++ b/ShopifyUI/src/app/components/cart/cart.component.html @@ -1,19 +1,36 @@ -