Gowrisankar J g 4 years ago
parent
commit
baba82073c
12 changed files with 45 additions and 24 deletions
  1. 6
      Angular-UrbanBazaar/angular.json
  2. 19
      Angular-UrbanBazaar/proxy.config.json
  3. 13
      Angular-UrbanBazaar/src/app/components/cart/cart.component.css
  4. 10
      Angular-UrbanBazaar/src/app/components/cart/cart.component.html
  5. 1
      Angular-UrbanBazaar/src/app/components/home/home.component.css
  6. 2
      Angular-UrbanBazaar/src/app/services/cart.service.ts
  7. 2
      Angular-UrbanBazaar/src/app/services/member-user.service.ts
  8. 2
      Angular-UrbanBazaar/src/app/services/orders.service.ts
  9. 2
      Angular-UrbanBazaar/src/app/services/product-category.service.ts
  10. 2
      Angular-UrbanBazaar/src/app/services/product.service.ts
  11. 2
      Angular-UrbanBazaar/src/app/services/user.service.ts
  12. 8
      grocery_db_tables.sql

6
Angular-UrbanBazaar/angular.json

@ -69,10 +69,12 @@
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"configurations": { "configurations": {
"production": { "production": {
"browserTarget": "Angular-UrbanBazaar:build:production"
"browserTarget": "Angular-UrbanBazaar:build:production",
"proxyConfig": "proxy.config.json"
}, },
"development": { "development": {
"browserTarget": "Angular-UrbanBazaar:build:development"
"browserTarget": "Angular-UrbanBazaar:build:development",
"proxyConfig": "proxy.config.json"
} }
}, },
"defaultConfiguration": "development" "defaultConfiguration": "development"

19
Angular-UrbanBazaar/proxy.config.json

@ -0,0 +1,19 @@
{
"/products":{
"target":"http://10.3.117.7:8002",
"secure":false
},
"/user":{
"target":"http://10.3.117.7:8006",
"secure":false
},
"/orders":{
"target":"http://10.3.117.7:8003",
"secure":false
},
"/cart":{
"target":"http://10.3.117.7:8004",
"secure":false
}
}

13
Angular-UrbanBazaar/src/app/components/cart/cart.component.css

@ -29,11 +29,8 @@ h4,h6{
align-items: center; align-items: center;
} }
/* .center .btn{
font-size: 14px !important;
margin-top: 20px !important;
font-weight: 400;
padding: 12px 72px;
border-radius: 3px !important;
} */
.CartButtons{
border-radius: 15px;
border-color:antiquewhite ;
background-color: beige;
}

10
Angular-UrbanBazaar/src/app/components/cart/cart.component.html

@ -18,14 +18,14 @@
<td>{{c.productname}}</td> <td>{{c.productname}}</td>
<td>{{c.productprice}}</td> <td>{{c.productprice}}</td>
<td> <td>
<button class="deleteButton" (click)="removeItem(c)">Delete</button>
<button class="CartButtons" (click)="removeItem(c)">Delete</button>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="4"></td> <td colspan="4"></td>
<td><button (click)=emptyCart()>Empty Cart</button></td>
<td><button routerLink='/'>Shop More</button></td>
<td><button>Checkout</button></td>
<td><button (click)=emptyCart() class="CartButtons">Empty Cart</button></td>
<td><button routerLink='/home' class="CartButtons">Shop More</button></td>
<td><button class="CartButtons">Checkout</button></td>
<td><strong>Grand Total : Rs.{{grandTotal}}</strong></td> <td><strong>Grand Total : Rs.{{grandTotal}}</strong></td>
</tr> </tr>
</tbody> </tbody>
@ -46,7 +46,7 @@
alt=""> alt="">
<h4>Your cart is empty!</h4> <h4>Your cart is empty!</h4>
<h6>Add item to it now</h6> <h6>Add item to it now</h6>
<button class="shopNow" routerLink='/'>Shop Now</button>
<button class="shopNow" routerLink='/home'>Shop Now</button>
</div> </div>
</div> </div>
</ng-container> </ng-container>

1
Angular-UrbanBazaar/src/app/components/home/home.component.css

@ -39,4 +39,5 @@ body {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-grow:1; flex-grow:1;
flex-wrap: wrap;
} }

2
Angular-UrbanBazaar/src/app/services/cart.service.ts

@ -9,7 +9,7 @@ import { Cart } from '../models/cart';
}) })
export class CartService { export class CartService {
private _url : String = "http://localhost:9000";
private _url : String = "http://localhost:4405/cart";
constructor(private _http : HttpClient) { } constructor(private _http : HttpClient) { }
// public showAllOrder():Observable<Cart[]> // public showAllOrder():Observable<Cart[]>

2
Angular-UrbanBazaar/src/app/services/member-user.service.ts

@ -8,7 +8,7 @@ import { MemberUser } from '../models/member-user';
}) })
export class MemberUserService { export class MemberUserService {
private _url : String = "http://localhost:8001/user";
private _url : String = "http://localhost:4405/user";
constructor(private _http : HttpClient) { } constructor(private _http : HttpClient) { }

2
Angular-UrbanBazaar/src/app/services/orders.service.ts

@ -8,7 +8,7 @@ import { Orders } from '../models/orders';
}) })
export class OrdersService { export class OrdersService {
private _url : String = "http://localhost:8003/orders";
private _url : String = "http://localhost:4405/orders";
constructor(private _http : HttpClient) { } constructor(private _http : HttpClient) { }

2
Angular-UrbanBazaar/src/app/services/product-category.service.ts

@ -8,7 +8,7 @@ import { ProductCategory } from '../models/product-category';
}) })
export class ProductCategoryService { export class ProductCategoryService {
private _url : String = "http://localhost:8002/products";
private _url : String = "http://localhost:4405/products";
constructor(private _http : HttpClient) { } constructor(private _http : HttpClient) { }

2
Angular-UrbanBazaar/src/app/services/product.service.ts

@ -8,7 +8,7 @@ import {map} from 'rxjs/operators';
providedIn: 'root' providedIn: 'root'
}) })
export class ProductService { export class ProductService {
private _url : String = "http://localhost:8002/products";
private _url : String = "http://localhost:4405/products";
search : string; search : string;
constructor(private _http : HttpClient) { } constructor(private _http : HttpClient) { }

2
Angular-UrbanBazaar/src/app/services/user.service.ts

@ -9,7 +9,7 @@ import { User } from '../models/user';
}) })
export class UserService { export class UserService {
private _url : String = "http://localhost:8001/user";
private _url : String = "http://localhost:4405/user";
currentUser : User; currentUser : User;
constructor(private _http : HttpClient) { } constructor(private _http : HttpClient) { }

8
grocery_db_tables.sql

@ -140,9 +140,10 @@ SELECT * FROM orders;
-- Members Table Schema -- Members Table Schema
create table `members`( create table `members`(
`UserID` int(11) NOT NULL,
`MemberID` int(11) not null,
`UserID` int(11) NOT NULL,
`MemberID` int(11) not null AUTO_INCREMENT,
`MemberName` varchar(20) not null, `MemberName` varchar(20) not null,
`MemberDoorNumber` int(4) not null,
`TotalItems` int(3) not null default 0, `TotalItems` int(3) not null default 0,
`MemberPhone` varchar(15) not null, `MemberPhone` varchar(15) not null,
`MemberTotalAmount` float not null default 0, `MemberTotalAmount` float not null default 0,
@ -158,10 +159,11 @@ select * from members;
-- Cart Table Schema -- Cart Table Schema
CREATE TABLE IF NOT EXISTS `cart` ( CREATE TABLE IF NOT EXISTS `cart` (
`CartID` int NOT NULL,
`CartID` int NOT NULL AUTO_INCREMENT,
`UserID` int NOT NULL, `UserID` int NOT NULL,
`OrderID` int NOT NULL, `OrderID` int NOT NULL,
`ProductName` varchar(50) NOT NULL, `ProductName` varchar(50) NOT NULL,
`ProductPrice` int(5) NOT NULL,
`Quantity` int NOT NULL, `Quantity` int NOT NULL,
PRIMARY KEY (`CartID`), PRIMARY KEY (`CartID`),
FOREIGN KEY (`UserID`) REFERENCES users(`UserID`) FOREIGN KEY (`UserID`) REFERENCES users(`UserID`)

Loading…
Cancel
Save