Compare commits

...

4 Commits

Author SHA1 Message Date
Nitya Jain 1869df986c Remove duplicated directory 4 years ago
Nitya Jain 966a9bfe00 Remove duplicated directory 4 years ago
Nitya Jain 33b9fbae63 OrderService 4 years ago
Nitya Jain a88a603d09 ProductService 4 years ago
1074 changed files with 0 additions and 57222 deletions
Split View
  1. 0
      OrderService/OrderService/.gitignore
  2. 0
      OrderService/OrderService/.mvn/wrapper/MavenWrapperDownloader.java
  3. 0
      OrderService/OrderService/.mvn/wrapper/maven-wrapper.jar
  4. 0
      OrderService/OrderService/.mvn/wrapper/maven-wrapper.properties
  5. 0
      OrderService/OrderService/mvnw
  6. 0
      OrderService/OrderService/mvnw.cmd
  7. 0
      OrderService/OrderService/pom.xml
  8. 0
      OrderService/OrderService/src/main/java/com/example/demo/OrderServiceApplication.java
  9. 0
      OrderService/OrderService/src/main/java/com/example/demo/config/MessagingConfig.java
  10. 0
      OrderService/OrderService/src/main/java/com/example/demo/controller/OrderController.java
  11. 0
      OrderService/OrderService/src/main/java/com/example/demo/model/Cart.java
  12. 0
      OrderService/OrderService/src/main/java/com/example/demo/model/CartDto.java
  13. 0
      OrderService/OrderService/src/main/java/com/example/demo/model/OrderDto.java
  14. 0
      OrderService/OrderService/src/main/java/com/example/demo/model/OrderStatus.java
  15. 0
      OrderService/OrderService/src/main/java/com/example/demo/model/Orders.java
  16. 0
      OrderService/OrderService/src/main/java/com/example/demo/model/Product.java
  17. 0
      OrderService/OrderService/src/main/java/com/example/demo/model/User.java
  18. 0
      OrderService/OrderService/src/main/java/com/example/demo/repository/CartRepo.java
  19. 0
      OrderService/OrderService/src/main/java/com/example/demo/repository/OrderRepo.java
  20. 0
      OrderService/OrderService/src/main/java/com/example/demo/repository/ProductRepo.java
  21. 0
      OrderService/OrderService/src/main/java/com/example/demo/repository/UserRepo.java
  22. 0
      OrderService/OrderService/src/main/resources/application.properties
  23. 0
      OrderService/OrderService/src/test/java/com/example/demo/OrderServiceApplicationTests.java
  24. 0
      ProductService/ProductService/.gitignore
  25. 0
      ProductService/ProductService/.mvn/wrapper/MavenWrapperDownloader.java
  26. 0
      ProductService/ProductService/.mvn/wrapper/maven-wrapper.jar
  27. 0
      ProductService/ProductService/.mvn/wrapper/maven-wrapper.properties
  28. 0
      ProductService/ProductService/mvnw
  29. 0
      ProductService/ProductService/mvnw.cmd
  30. 0
      ProductService/ProductService/pom.xml
  31. 0
      ProductService/ProductService/src/main/java/com/example/demo/Product.java
  32. 0
      ProductService/ProductService/src/main/java/com/example/demo/ProductController.java
  33. 0
      ProductService/ProductService/src/main/java/com/example/demo/ProductRepo.java
  34. 0
      ProductService/ProductService/src/main/java/com/example/demo/ProductServiceApplication.java
  35. 0
      ProductService/ProductService/src/main/resources/application.properties
  36. 0
      ProductService/ProductService/src/main/resources/generated.json
  37. 0
      ProductService/ProductService/src/test/java/com/example/demo/ProductServiceApplicationTests.java
  38. 17
      angular_frontend/.browserslistrc
  39. 16
      angular_frontend/.editorconfig
  40. 45
      angular_frontend/.gitignore
  41. 27
      angular_frontend/README.md
  42. 106
      angular_frontend/angular.json
  43. 44
      angular_frontend/karma.conf.js
  44. 12122
      angular_frontend/package-lock.json
  45. 39
      angular_frontend/package.json
  46. 18
      angular_frontend/proxy.conf.json
  47. 39
      angular_frontend/src/app/app-routing.module.ts
  48. 29
      angular_frontend/src/app/app.component.css
  49. 45
      angular_frontend/src/app/app.component.html
  50. 35
      angular_frontend/src/app/app.component.spec.ts
  51. 10
      angular_frontend/src/app/app.component.ts
  52. 50
      angular_frontend/src/app/app.module.ts
  53. 100
      angular_frontend/src/app/auth/login/login.component.css
  54. 19
      angular_frontend/src/app/auth/login/login.component.html
  55. 25
      angular_frontend/src/app/auth/login/login.component.spec.ts
  56. 63
      angular_frontend/src/app/auth/login/login.component.ts
  57. 16
      angular_frontend/src/app/auth/service/auth-guard.service.spec.ts
  58. 21
      angular_frontend/src/app/auth/service/auth-guard.service.ts
  59. 16
      angular_frontend/src/app/auth/service/auth.service.spec.ts
  60. 23
      angular_frontend/src/app/auth/service/auth.service.ts
  61. BIN
      angular_frontend/src/app/banana.jpg
  62. 24
      angular_frontend/src/app/components/account/account.component.css
  63. 18
      angular_frontend/src/app/components/account/account.component.html
  64. 25
      angular_frontend/src/app/components/account/account.component.spec.ts
  65. 45
      angular_frontend/src/app/components/account/account.component.ts
  66. 131
      angular_frontend/src/app/components/beverages/beverages.component.css
  67. 8
      angular_frontend/src/app/components/beverages/beverages.component.html
  68. 25
      angular_frontend/src/app/components/beverages/beverages.component.spec.ts
  69. 37
      angular_frontend/src/app/components/beverages/beverages.component.ts
  70. 50
      angular_frontend/src/app/components/cart/cart.component.css
  71. 50
      angular_frontend/src/app/components/cart/cart.component.html
  72. 25
      angular_frontend/src/app/components/cart/cart.component.spec.ts
  73. 159
      angular_frontend/src/app/components/cart/cart.component.ts
  74. 100
      angular_frontend/src/app/components/edit-account/edit-account.component.css
  75. 51
      angular_frontend/src/app/components/edit-account/edit-account.component.html
  76. 25
      angular_frontend/src/app/components/edit-account/edit-account.component.spec.ts
  77. 79
      angular_frontend/src/app/components/edit-account/edit-account.component.ts
  78. 131
      angular_frontend/src/app/components/fruits/fruits.component.css
  79. 9
      angular_frontend/src/app/components/fruits/fruits.component.html
  80. 25
      angular_frontend/src/app/components/fruits/fruits.component.spec.ts
  81. 39
      angular_frontend/src/app/components/fruits/fruits.component.ts
  82. BIN
      angular_frontend/src/app/components/home/g1.jpg
  83. 26
      angular_frontend/src/app/components/home/home.component.css
  84. 11
      angular_frontend/src/app/components/home/home.component.html
  85. 25
      angular_frontend/src/app/components/home/home.component.spec.ts
  86. 27
      angular_frontend/src/app/components/home/home.component.ts
  87. 131
      angular_frontend/src/app/components/medicines/medicines.component.css
  88. 9
      angular_frontend/src/app/components/medicines/medicines.component.html
  89. 25
      angular_frontend/src/app/components/medicines/medicines.component.spec.ts
  90. 37
      angular_frontend/src/app/components/medicines/medicines.component.ts
  91. 51
      angular_frontend/src/app/components/orders/orders.component.css
  92. 30
      angular_frontend/src/app/components/orders/orders.component.html
  93. 25
      angular_frontend/src/app/components/orders/orders.component.spec.ts
  94. 38
      angular_frontend/src/app/components/orders/orders.component.ts
  95. 146
      angular_frontend/src/app/components/product/product.component.css
  96. 27
      angular_frontend/src/app/components/product/product.component.html
  97. 25
      angular_frontend/src/app/components/product/product.component.spec.ts
  98. 74
      angular_frontend/src/app/components/product/product.component.ts
  99. 171
      angular_frontend/src/app/components/sign-up/sign-up.component.css
  100. 65
      angular_frontend/src/app/components/sign-up/sign-up.component.html

springboot_backend/CartService/.gitignore → OrderService/OrderService/.gitignore

springboot_backend/CartService/.mvn/wrapper/MavenWrapperDownloader.java → OrderService/OrderService/.mvn/wrapper/MavenWrapperDownloader.java

springboot_backend/CartService/.mvn/wrapper/maven-wrapper.jar → OrderService/OrderService/.mvn/wrapper/maven-wrapper.jar

springboot_backend/CartService/.mvn/wrapper/maven-wrapper.properties → OrderService/OrderService/.mvn/wrapper/maven-wrapper.properties

springboot_backend/CartService/mvnw → OrderService/OrderService/mvnw

springboot_backend/CartService/mvnw.cmd → OrderService/OrderService/mvnw.cmd

springboot_backend/OrderService/pom.xml → OrderService/OrderService/pom.xml

springboot_backend/OrderService/src/main/java/com/example/demo/OrderServiceApplication.java → OrderService/OrderService/src/main/java/com/example/demo/OrderServiceApplication.java

springboot_backend/OrderService/src/main/java/com/example/demo/config/MessagingConfig.java → OrderService/OrderService/src/main/java/com/example/demo/config/MessagingConfig.java

springboot_backend/OrderService/src/main/java/com/example/demo/controller/OrderController.java → OrderService/OrderService/src/main/java/com/example/demo/controller/OrderController.java

springboot_backend/CartService/src/main/java/com/example/demo/model/Cart.java → OrderService/OrderService/src/main/java/com/example/demo/model/Cart.java

springboot_backend/OrderService/src/main/java/com/example/demo/model/CartDto.java → OrderService/OrderService/src/main/java/com/example/demo/model/CartDto.java

springboot_backend/OrderService/src/main/java/com/example/demo/model/OrderDto.java → OrderService/OrderService/src/main/java/com/example/demo/model/OrderDto.java

springboot_backend/OrderService/src/main/java/com/example/demo/model/OrderStatus.java → OrderService/OrderService/src/main/java/com/example/demo/model/OrderStatus.java

springboot_backend/OrderService/src/main/java/com/example/demo/model/Orders.java → OrderService/OrderService/src/main/java/com/example/demo/model/Orders.java

springboot_backend/CartService/src/main/java/com/example/demo/model/Product.java → OrderService/OrderService/src/main/java/com/example/demo/model/Product.java

springboot_backend/CartService/src/main/java/com/example/demo/model/User.java → OrderService/OrderService/src/main/java/com/example/demo/model/User.java

springboot_backend/OrderService/src/main/java/com/example/demo/repository/CartRepo.java → OrderService/OrderService/src/main/java/com/example/demo/repository/CartRepo.java

springboot_backend/OrderService/src/main/java/com/example/demo/repository/OrderRepo.java → OrderService/OrderService/src/main/java/com/example/demo/repository/OrderRepo.java

springboot_backend/CartService/src/main/java/com/example/demo/repository/ProductRepo.java → OrderService/OrderService/src/main/java/com/example/demo/repository/ProductRepo.java

springboot_backend/CartService/src/main/java/com/example/demo/repository/UserRepo.java → OrderService/OrderService/src/main/java/com/example/demo/repository/UserRepo.java

springboot_backend/OrderService/src/main/resources/application.properties → OrderService/OrderService/src/main/resources/application.properties

springboot_backend/OrderService/src/test/java/com/example/demo/OrderServiceApplicationTests.java → OrderService/OrderService/src/test/java/com/example/demo/OrderServiceApplicationTests.java

springboot_backend/OrderService/.gitignore → ProductService/ProductService/.gitignore

springboot_backend/OrderService/.mvn/wrapper/MavenWrapperDownloader.java → ProductService/ProductService/.mvn/wrapper/MavenWrapperDownloader.java

springboot_backend/OrderService/.mvn/wrapper/maven-wrapper.jar → ProductService/ProductService/.mvn/wrapper/maven-wrapper.jar

springboot_backend/OrderService/.mvn/wrapper/maven-wrapper.properties → ProductService/ProductService/.mvn/wrapper/maven-wrapper.properties

springboot_backend/OrderService/mvnw → ProductService/ProductService/mvnw

springboot_backend/OrderService/mvnw.cmd → ProductService/ProductService/mvnw.cmd

springboot_backend/ProductService/pom.xml → ProductService/ProductService/pom.xml

springboot_backend/ProductService/src/main/java/com/example/demo/Product.java → ProductService/ProductService/src/main/java/com/example/demo/Product.java

springboot_backend/ProductService/src/main/java/com/example/demo/ProductController.java → ProductService/ProductService/src/main/java/com/example/demo/ProductController.java

springboot_backend/ProductService/src/main/java/com/example/demo/ProductRepo.java → ProductService/ProductService/src/main/java/com/example/demo/ProductRepo.java

springboot_backend/ProductService/src/main/java/com/example/demo/ProductServiceApplication.java → ProductService/ProductService/src/main/java/com/example/demo/ProductServiceApplication.java

springboot_backend/ProductService/src/main/resources/application.properties → ProductService/ProductService/src/main/resources/application.properties

springboot_backend/ProductService/src/main/resources/generated.json → ProductService/ProductService/src/main/resources/generated.json

springboot_backend/ProductService/src/test/java/com/example/demo/ProductServiceApplicationTests.java → ProductService/ProductService/src/test/java/com/example/demo/ProductServiceApplicationTests.java

17
angular_frontend/.browserslistrc

@ -1,17 +0,0 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

16
angular_frontend/.editorconfig

@ -1,16 +0,0 @@
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false

45
angular_frontend/.gitignore

@ -1,45 +0,0 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db

27
angular_frontend/README.md

@ -1,27 +0,0 @@
# GroceryApp
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.1.1.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

106
angular_frontend/angular.json

@ -1,106 +0,0 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"groceryApp": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/groceryApp",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "groceryApp:build:production"
},
"development": {
"browserTarget": "groceryApp:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "groceryApp:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"defaultProject": "groceryApp"
}

44
angular_frontend/karma.conf.js

@ -1,44 +0,0 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/groceryApp'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

12122
angular_frontend/package-lock.json
File diff suppressed because it is too large
View File

39
angular_frontend/package.json

@ -1,39 +0,0 @@
{
"name": "grocery-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json --port 17599",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.1.1",
"@angular/common": "~12.1.1",
"@angular/compiler": "~12.1.1",
"@angular/core": "~12.1.1",
"@angular/forms": "~12.1.1",
"@angular/platform-browser": "~12.1.1",
"@angular/platform-browser-dynamic": "~12.1.1",
"@angular/router": "~12.1.1",
"rxjs": "~6.6.0",
"tslib": "^2.2.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.1.1",
"@angular/cli": "~12.1.1",
"@angular/compiler-cli": "~12.1.1",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.7.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"typescript": "~4.3.2"
}
}

18
angular_frontend/proxy.conf.json

@ -1,18 +0,0 @@
{
"/userapi": {
"target": "http://10.3.117.30:5007",
"secure": false
},
"/productapi": {
"target": "http://10.3.117.30:5008",
"secure": false
},
"/cartapi": {
"target": "http://10.3.117.30:5006",
"secure": false
},
"/orderapi": {
"target": "http://10.3.117.30:5009",
"secure": false
}
}

39
angular_frontend/src/app/app-routing.module.ts

@ -1,39 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './auth/login/login.component';
import { AuthGuardService } from './auth/service/auth-guard.service';
import { AccountComponent } from './components/account/account.component';
import { BeveragesComponent } from './components/beverages/beverages.component';
import { CartComponent } from './components/cart/cart.component';
import { EditAccountComponent } from './components/edit-account/edit-account.component';
import { FruitsComponent } from './components/fruits/fruits.component';
import { HomeComponent } from './components/home/home.component';
import { MedicinesComponent } from './components/medicines/medicines.component';
import { OrdersComponent } from './components/orders/orders.component';
import { ProductComponent } from './components/product/product.component';
import { SignUpComponent } from './components/sign-up/sign-up.component';
import { SnacksComponent } from './components/snacks/snacks.component';
import { VegetablesComponent } from './components/vegetables/vegetables.component';
const routes: Routes = [
// {path: '', component:HomeComponent},
{path: 'account/:uid', component : AccountComponent},
{path: 'product', component : ProductComponent},
{path : 'account-edit/:aid',component : EditAccountComponent },
{path: 'register', component : SignUpComponent},
{path: 'home', component : HomeComponent},
{path: 'fruits', component : FruitsComponent},
{path: 'snacks', component : SnacksComponent},
{path: 'medicines', component : MedicinesComponent},
{path: 'beverages', component : BeveragesComponent},
{path: 'vegetables', component : VegetablesComponent},
{path: 'login', component : LoginComponent},
{path: 'cart', component : CartComponent},
{path: 'order', component : OrdersComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

29
angular_frontend/src/app/app.component.css

@ -1,29 +0,0 @@
body, html {
height: 100%;
}
.bg {
/* The image used */
background-image: url("g1.jpg");
/* Full height */
height: 100%;
width: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
opacity: 0.9;
}
.button {
font: bold 15px Arial;
text-decoration: none;
background-color: #5fe697;
color: #05151f;
border-radius: 4px;
padding: 6px 8px 6px 8px;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #CCCCCC;
}

45
angular_frontend/src/app/app.component.html

@ -1,45 +0,0 @@
<div class="bg">
<div>
<h1 style="text-align:center; opacity: 15; font-size: 50px;" >Express Grocery</h1>
</div>
<hr>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a routerLink="/register" class="button">Register</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a routerLink="/login" class="button">Login</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<!-- <a routerLink="/account" class="button">My Account</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a routerLink="/product" class="button">Items Available</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a routerLink="/cart" class="button">My Cart</a> -->
<hr>
<router-outlet></router-outlet>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>

35
angular_frontend/src/app/app.component.spec.ts

@ -1,35 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'groceryApp'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('groceryApp');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('groceryApp app is running!');
});
});

10
angular_frontend/src/app/app.component.ts

@ -1,10 +0,0 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
}

50
angular_frontend/src/app/app.module.ts

@ -1,50 +0,0 @@
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import {HttpClientModule} from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { AccountComponent } from './components/account/account.component';
import { EditAccountComponent } from './components/edit-account/edit-account.component';
import { SignUpComponent } from './components/sign-up/sign-up.component';
import { LoginComponent } from './auth/login/login.component';
import { ProductComponent } from './components/product/product.component';
import { CartComponent } from './components/cart/cart.component';
import { FilterPipe } from './shared/filter.pipe';
import { FruitsComponent } from './components/fruits/fruits.component';
import { VegetablesComponent } from './components/vegetables/vegetables.component';
import { SnacksComponent } from './components/snacks/snacks.component';
import { BeveragesComponent } from './components/beverages/beverages.component';
import { MedicinesComponent } from './components/medicines/medicines.component';
import { HomeComponent } from './components/home/home.component';
import { OrdersComponent } from './components/orders/orders.component';
@NgModule({
declarations: [
AppComponent,
AccountComponent,
EditAccountComponent,
SignUpComponent,
LoginComponent,
ProductComponent,
CartComponent,
FilterPipe,
FruitsComponent,
VegetablesComponent,
SnacksComponent,
BeveragesComponent,
MedicinesComponent,
HomeComponent,
OrdersComponent
],
imports: [
BrowserModule,
AppRoutingModule,
ReactiveFormsModule,
HttpClientModule,
FormsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

100
angular_frontend/src/app/auth/login/login.component.css

@ -1,100 +0,0 @@
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
.login-page {
width: 360px;
padding: 8% 0 0;
margin: auto;
}
.form {
position: relative;
z-index: 1;
background: #FFFFFF;
max-width: 360px;
margin: 0 auto 100px;
padding: 45px;
text-align: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
width: 100%;
border: 0;
padding: 15px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,.form button:active,.form button:focus {
background: #43A047;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
body {
background: #76b852; /* fallback for old browsers */
background: -webkit-linear-gradient(right, #76b852, #8DC26F);
background: -moz-linear-gradient(right, #76b852, #8DC26F);
background: -o-linear-gradient(right, #76b852, #8DC26F);
background: linear-gradient(to left, #76b852, #8DC26F);
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

19
angular_frontend/src/app/auth/login/login.component.html

@ -1,19 +0,0 @@
<div class="login-page">
<div class="form">
<p>Please Login</p>
<hr>
{{msg}}
<form class="login-form" [formGroup]='loginForm' (submit)='OnLoginFormSubmit()' style="border:1px solid #ccc">
Username: <input type="text" formControlName="username">
<div *ngIf="loginForm.controls['username'].invalid &&(loginForm.controls['username'].touched ||
loginForm.controls['username'].dirty)">Invalid username</div>
<br><br>
Password: <input type="password" formControlName="password">
<div *ngIf="loginForm.controls['password'].invalid &&(loginForm.controls['password'].touched ||
loginForm.controls['password'].dirty)">Invalid password</div>
<br><br>
<button [disabled]="!loginForm.valid">login</button>
</form>
</div>

25
angular_frontend/src/app/auth/login/login.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LoginComponent } from './login.component';
describe('LoginComponent', () => {
let component: LoginComponent;
let fixture: ComponentFixture<LoginComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoginComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(LoginComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

63
angular_frontend/src/app/auth/login/login.component.ts

@ -1,63 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { Account } from 'src/app/model/account.model';
import { AccountService } from 'src/app/service/account.service';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
loginForm: any;
user : Account = new Account();
msg: string;
constructor(private route: Router, private accountService : AccountService) {
this.msg = '';
}
ngOnInit(): void {
this.loginForm = new FormGroup({
username : new FormControl('',Validators.required),
password : new FormControl('',Validators.required)
});
}
OnLoginFormSubmit(){
// this.accountService.getAccounts().subscribe(res=>{
// const user = res.find((a:any)=>{
// return a.username == this.loginForm.value.username && a.password == this.loginForm.value.password;
// });
// if(user){
// alert("Login Success");
// this.loginForm.reset();
// this.route.navigateByUrl('/home');
// }else{
// alert("user not found");
// }
// },err=>{
// alert("Something went wrong!!");
// })
this.user = {
username :this.loginForm.value.username,
password :this.loginForm.value.password
}
this.accountService.login(this.user).subscribe((data: any)=>{
window.sessionStorage.setItem("username",this.user.username);
window.sessionStorage.setItem("isLoggedIn","true");
this.route.navigateByUrl('/home');
}),
(err: any)=>{
this.msg='Invalid credentials';
window.sessionStorage.removeItem('username');
window.sessionStorage.removeItem('isLoggedIn');
};
}
}

16
angular_frontend/src/app/auth/service/auth-guard.service.spec.ts

@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { AuthGuardService } from './auth-guard.service';
describe('AuthGuardService', () => {
let service: AuthGuardService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AuthGuardService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

21
angular_frontend/src/app/auth/service/auth-guard.service.ts

@ -1,21 +0,0 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
import { AuthService } from './auth.service';
@Injectable({
providedIn: 'root'
})
export class AuthGuardService implements CanActivate {
status : boolean;
constructor(private authService : AuthService,private route : Router) { }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean{
this.status = this.authService.isAuthenticated();
if(this.status == false){
this.route.navigateByUrl('/login');
}
return true;
}
}

16
angular_frontend/src/app/auth/service/auth.service.spec.ts

@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { AuthService } from './auth.service';
describe('AuthService', () => {
let service: AuthService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AuthService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

23
angular_frontend/src/app/auth/service/auth.service.ts

@ -1,23 +0,0 @@
import { Injectable } from '@angular/core';
import { Account } from 'src/app/model/account.model';
@Injectable({
providedIn: 'root'
})
export class AuthService {
user: Account = new Account();
constructor() {
}
isAuthenticated() : boolean {
this.user.username = window.sessionStorage.getItem('username');
let isLoggedIn = window.sessionStorage.getItem('isLoggedIn');
if(isLoggedIn == 'true')
return true;
return false;
}
}

BIN
angular_frontend/src/app/banana.jpg

Before After
Width: 700  |  Height: 467  |  Size: 24 KiB

24
angular_frontend/src/app/components/account/account.component.css

@ -1,24 +0,0 @@
.button {
font: bold 15px Arial;
text-decoration: none;
background-color: #5fe697;
color: #05151f;
border-radius: 4px;
padding: 6px 8px 6px 8px;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #CCCCCC;
cursor: pointer;
}
.form {
display: block;
background: #FFFFFF;
max-width: 300px;
margin: 10px 30px;
margin-bottom: 30px;
padding: 45px;
text-align: left;
align-self: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}

18
angular_frontend/src/app/components/account/account.component.html

@ -1,18 +0,0 @@
<span class="button" (click)='back()'>BACK TO HOME</span>
<h2 style="margin-left: 430px;font-size: 30px;">My Account Details</h2>
<BR>{{msg}}<BR>
<!-- <div *ngFor="let a of accounts" style="margin-left: 400px;" class="form" > -->
<div style="margin-left: 400px;" class="form">
<b style="font-size: 20px;">Representative Details</b><br><br><b>Username:</b> &nbsp;&nbsp;&nbsp; {{accounts.username}} <br> <b>Name:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{accounts.fullname}} <br> <b>Gender:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{accounts.gender}} <br> <b>Phone no.:</b> &nbsp;&nbsp;&nbsp;&nbsp;{{accounts.phone}} <br> <b>Email:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{accounts.email}} <br><br><b style="font-size: 20px;">Building Details</b><br><br> <b>Building Address:</b> &nbsp;&nbsp;&nbsp; {{accounts.address}} <br> <b>City:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{accounts.city}} <br> <b>State:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{accounts.state}} <br> <b>Pincode:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{accounts.pincode}} <br> <b>Apartments:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{accounts.apartments}}
<br><br>
<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href='javascript:void(0)' class="button" (click)='onAccountEdit(accounts.id!)'>UPDATE</a>
<br><br>
<br><br>
</div>

25
angular_frontend/src/app/components/account/account.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AccountComponent } from './account.component';
describe('AccountComponent', () => {
let component: AccountComponent;
let fixture: ComponentFixture<AccountComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AccountComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(AccountComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

45
angular_frontend/src/app/components/account/account.component.ts

@ -1,45 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Account } from 'src/app/model/account.model';
import { AccountService } from 'src/app/service/account.service';
@Component({
selector: 'app-account',
templateUrl: './account.component.html',
styleUrls: ['./account.component.css']
})
export class AccountComponent implements OnInit {
accounts : any;
msg:string;
uid: any ;
username: any;
constructor(private actRoute: ActivatedRoute,private accountService : AccountService, private route: Router){
this.accounts = [];
this.msg ='';
}
ngOnInit(): void {
this.actRoute.paramMap.subscribe(params =>{
this.uid = params.get('uid');
});
this.accountService.getOneAccount(this.uid).subscribe(data =>{
this.accounts = data;
console.log(data)
});
}
onAccountEdit(id: number){
this.route.navigateByUrl('/account-edit/' +id);
}
back(){
this.route.navigateByUrl("/home");
}
}

131
angular_frontend/src/app/components/beverages/beverages.component.css

@ -1,131 +0,0 @@
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
.login-page {
width: 260px;
padding: 8% 0 0;
align-items: left;
margin: 0 20px;
}
.form {
display: inline-block;
background: #FFFFFF;
max-width: 165px;
margin: 50px 30px;
padding: 45px;
text-align: left;
align-self: left;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
margin: 10px 0;
width: 100%;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,.form button:active,.form button:focus {
background: #43A047;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
body {
background: #76b852; /* fallback for old browsers */
background: -webkit-linear-gradient(right, #76b852, #8DC26F);
background: -moz-linear-gradient(right, #76b852, #8DC26F);
background: -o-linear-gradient(right, #76b852, #8DC26F);
background: linear-gradient(to left, #76b852, #8DC26F);
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.form-control{
border-radius: 3px;
width: 600px;
height: 30px;
margin-left: 23px;
}
.search-icon {
position: absolute;
z-index: 10;
right: 50%;
top: 20px;
color: black;
}
button {
font-family: "Roboto", sans-serif;
border-radius: 6px;
text-transform: uppercase;
outline: 0;
background: #62a7c2;
margin: 30px 20px;
width: 100px;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}

8
angular_frontend/src/app/components/beverages/beverages.component.html

@ -1,8 +0,0 @@
<div *ngFor="let p of products" class="form">
<img src={{p.imag}} width="150px" height="100px"><br> <b>Item Name:</b> &nbsp; {{p.name}} <br> <b>Price:</b> &nbsp; {{p.price}} <br><b>Category:</b> &nbsp; {{p.category}}
&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<button (click)=addtocart1(p.id!)>Add to cart</button>
</div>

25
angular_frontend/src/app/components/beverages/beverages.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BeveragesComponent } from './beverages.component';
describe('BeveragesComponent', () => {
let component: BeveragesComponent;
let fixture: ComponentFixture<BeveragesComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ BeveragesComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(BeveragesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

37
angular_frontend/src/app/components/beverages/beverages.component.ts

@ -1,37 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Product } from 'src/app/model/product.model';
import { CartService } from 'src/app/service/cart.service';
import { ProductService } from 'src/app/service/product.service';
@Component({
selector: 'app-beverages',
templateUrl: './beverages.component.html',
styleUrls: ['./beverages.component.css']
})
export class BeveragesComponent implements OnInit {
products:Product[];
name:string;
uid!:any;
constructor(private productService:ProductService, private route:Router,private cartService:CartService) {
this.products=[];
this.name='Beverages';
}
ngOnInit(): void {
this.productService.getProductsByCategory(this.name).subscribe(data=>{
this.products=data;
})
}
addtocart(p:any){
this.cartService.addtoCart(p);
}
addtocart1(pid:any){
this.uid = window.sessionStorage.getItem('userid');
this.cartService.postCart(this.uid, pid).subscribe(data=>{
console.log('added to cart');
})
}
}

50
angular_frontend/src/app/components/cart/cart.component.css

@ -1,50 +0,0 @@
.card{
height: 60vh;
width: 25px;
padding: 25px;
}
.center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
#customers {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #04AA6D;
color: white;
}
.button {
font-family: "Roboto", sans-serif;
border-radius: 6px;
text-transform: uppercase;
outline: 0;
background: #e48ac6;
margin: 10px 20px;
width: 130px;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}

50
angular_frontend/src/app/components/cart/cart.component.html

@ -1,50 +0,0 @@
<ng-container *ngIf="product.length !=0">
<div class="card-table">
<div class="card-product">
<table class="table table-responsive" id="customers">
<thead>
<tr>
<th>Sr.No</th>
<th>Product Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Total</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let p of cartdto; let i = index">
<td>{{i+1}}</td>
<td>{{p.name}}</td>
<td>{{p.price}}</td>
<td><button (click)="dec(p,p.cid!)">-</button>{{p.quantity}}<button (click)="inc(p,p.cid!)">+</button></td>
<!-- <td>{{p.quantity * p.price | number}}</td> -->
<td>{{p.price*p.quantity}}</td>
<td>
<button class="button" (click)="removeItem(p.cid!)">Delete</button>
</td>
</tr>
<tr>
<td colspan="4"></td>
<td><button class="button" (click)="emptycart()">Empty Cart</button></td>
<td><button class="button" routerLink="/product">Buy More</button></td>
<td><button class="button" (click)=onCheckout() routerLink="/order">Checkout</button></td>
<td><strong>Grand Total : Rs.{{grandTotal1}}</strong></td>
</tr>
</tbody>
</table>
</div>
</div>
</ng-container>
<ng-container *ngIf="product.length ==0">
<div class="container">
<div class="card">
</div>
<div class="center">
<img src="" alt="">
<h3>Your cart is empty!</h3>
<button class="button" routerLink="/product">Want to Buy!!</button>
</div>
</div>
</ng-container>

25
angular_frontend/src/app/components/cart/cart.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CartComponent } from './cart.component';
describe('CartComponent', () => {
let component: CartComponent;
let fixture: ComponentFixture<CartComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ CartComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(CartComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

159
angular_frontend/src/app/components/cart/cart.component.ts

@ -1,159 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Cart } from 'src/app/model/cart.model';
import { CartDto } from 'src/app/model/cartDto.model';
import { OrderDto } from 'src/app/model/orderDto.model';
import { Orders } from 'src/app/model/orders.model';
import { CartService } from 'src/app/service/cart.service';
import { OrdersService } from 'src/app/service/orders.service';
@Component({
selector: 'app-cart',
templateUrl: './cart.component.html',
styleUrls: ['./cart.component.css']
})
export class CartComponent implements OnInit {
public product : any=[];
cartItem!:Cart[];
cartdto!: CartDto[];
orderdto!: OrderDto[];
uid!:any;
msg: string='';
public grandTotal : number = 0;
public grandTotal1 : any;
constructor(private cartService : CartService,private orderService:OrdersService) {
}
ngOnInit(): void {
this.cartService.getProducts().subscribe(res=>{
this.product = res;
// this.grandTotal = this.cartService.getTotalPrice();
})
this.uid = window.sessionStorage.getItem('userid');
this.cartService.getCartdto(this.uid).subscribe(res=>{
this.cartdto = res;
})
// this.uid = window.sessionStorage.getItem('userid');
// this.orderService.getOrderdto(this.uid).subscribe(res=>{
// this.orderdto = res;
// })
this.uid = window.sessionStorage.getItem('userid');
this.cartService.CartSum(this.uid).subscribe(res=>{
this.grandTotal1 = res;
})
}
checkout(){
this.orderService.checkout();
}
onCheckout(){
this.uid = window.sessionStorage.getItem('userid');
this.cartService.getCartdto(this.uid).subscribe(res=>{
this.orderdto = res;
console.log(this.orderdto);
})
this.orderService.addOrder(this.uid).subscribe(data=>{
console.log('added to order');
})
}
removeItem(cid: number){
// this.cartService.removeCartItem(item);
this.cartService.deleteCartItem(cid).subscribe(data=>{
this.cartdto.forEach((i,index)=>{
if(i.cid == cid){
this.cartdto.splice(index,1);
}
this.uid = window.sessionStorage.getItem('userid');
this.cartService.CartSum(this.uid).subscribe(res=>{
this.grandTotal1 = res;
console.log("deleted");
})
})
},
(err:any)=>{
this.msg = 'unable to delete record';
}
)
}
removeOrder(oid: number){
this.orderService.deleteOrderItem(oid).subscribe(data=>{
this.orderdto.forEach((i,index)=>{
if(i.cid == oid){
this.orderdto.splice(index,1);
}
})
},
(err:any)=>{
this.msg = 'unable to delete record';
}
)
}
// onCartItemDelete(id: number){
// this.cartService.deleteCartItem(id).subscribe(data=>{
// this.cartdto.forEach((i,index)=>{
// if(i.cid == id){
// this.product.splice(index,1);
// }
// })
// },
// (err:any)=>{
// this.msg = 'unable to delete record';
// }
// )
// }
emptycart(){
this.cartService.removeAllCart();
}
inc(prod:any, cid: number){
if(prod.quantity != 5){
prod.quantity = prod.quantity + 1;
this.cartService.postQuantity(cid, prod.quantity).subscribe(data=>{
console.log('added to cart');
})
this.uid = window.sessionStorage.getItem('userid');
this.cartService.CartSum(this.uid).subscribe(res=>{
this.grandTotal1 = res;
})
}
}
dec(prod:any, cid: number){
if(prod.quantity != 1){
prod.quantity = prod.quantity - 1;
this.cartService.postQuantity(cid, prod.quantity).subscribe(data=>{
console.log('deleted from cart');
})
this.uid = window.sessionStorage.getItem('userid');
this.cartService.CartSum(this.uid).subscribe(res=>{
this.grandTotal1 = res;
})
}
}
// OnCheckout(){
// let orders : Orders = {
// name : this.accountForm.value.username,
// fullname : this.accountForm.value.fullname,
// gender : this.accountForm.value.gender,
// phone : this.accountForm.value.phone,
// email : this.accountForm.value.email,
// address : this.accountForm.value.address,
// city : this.accountForm.value.city,
// state : this.accountForm.value.state,
// pincode : this.accountForm.value.pincode,
// apartments : this.accountForm.value.apartments,
// }
}

100
angular_frontend/src/app/components/edit-account/edit-account.component.css

@ -1,100 +0,0 @@
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
.login-page {
width: 700px;
padding: 8% 0 0;
margin: auto;
}
.form {
position: relative;
z-index: 1;
background: #FFFFFF;
max-width: 700px;
margin: 0 auto 100px;
padding: 45px;
text-align: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 50%;
border: 0;
margin: 0 0 15px;
padding: 10px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
width: 100%;
border: 0;
padding: 15px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,.form button:active,.form button:focus {
background: #43A047;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
body {
background: #76b852; /* fallback for old browsers */
background: -webkit-linear-gradient(right, #76b852, #8DC26F);
background: -moz-linear-gradient(right, #76b852, #8DC26F);
background: -o-linear-gradient(right, #76b852, #8DC26F);
background: linear-gradient(to left, #76b852, #8DC26F);
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

51
angular_frontend/src/app/components/edit-account/edit-account.component.html

@ -1,51 +0,0 @@
<div class="login-page">
<div class="form">
<h2>Update Account</h2>
<br><br>
<form [formGroup]='accountForm' (submit)='OnAccountFormSubmit()'>
Username: <input type="text" formControlName="username">
<div *ngIf="accountForm.controls['username'].invalid &&(accountForm.controls['username'].touched ||
accountForm.controls['username'].dirty)">Invalid username</div>
<br><br>
Name: <input type="text" formControlName="fullname">
<div *ngIf="accountForm.controls['fullname'].invalid &&(accountForm.controls['fullname'].touched ||
accountForm.controls['fullname'].dirty)">Invalid full name</div>
<br><br>
Gender: <input type="text" formControlName="gender">
<div *ngIf="accountForm.controls['gender'].invalid &&(accountForm.controls['gender'].touched ||
accountForm.controls['gender'].dirty)">Invalid gender</div>
<br><br>
Phone no: <input type="number" formControlName="phone">
<div *ngIf="accountForm.controls['phone'].invalid &&(accountForm.controls['phone'].touched ||
accountForm.controls['phone'].dirty)">Invalid phone number</div>
<br><br>
Email: <input type="text" formControlName="email">
<div *ngIf="accountForm.controls['email'].invalid &&(accountForm.controls['email'].touched ||
accountForm.controls['email'].dirty)">Invalid email</div>
<br><br>
Building Address: <input type="text" formControlName="address">
<div *ngIf="accountForm.controls['address'].invalid &&(accountForm.controls['address'].touched ||
accountForm.controls['address'].dirty)">Invalid building address</div>
<br><br>
City: <input type="text" formControlName="city">
<div *ngIf="accountForm.controls['city'].invalid &&(accountForm.controls['city'].touched ||
accountForm.controls['city'].dirty)">Invalid city</div>
<br><br>
State: <input type="text" formControlName="state">
<div *ngIf="accountForm.controls['state'].invalid &&(accountForm.controls['state'].touched ||
accountForm.controls['state'].dirty)">Invalid state</div>
<br><br>
Pincode: <input type="text" formControlName="pincode">
<div *ngIf="accountForm.controls['pincode'].invalid &&(accountForm.controls['pincode'].touched ||
accountForm.controls['pincode'].dirty)">Invalid pincode</div>
<br><br>
Apartments: <input type="text" formControlName="apartments">
<div *ngIf="accountForm.controls['apartments'].invalid &&(accountForm.controls['apartments'].touched ||
accountForm.controls['apartments'].dirty)">Invalid no. of apartments</div>
<br><br>
<button [disabled]="!accountForm.valid">Update</button>
</form>
</div>
</div>

25
angular_frontend/src/app/components/edit-account/edit-account.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { EditAccountComponent } from './edit-account.component';
describe('EditAccountComponent', () => {
let component: EditAccountComponent;
let fixture: ComponentFixture<EditAccountComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ EditAccountComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(EditAccountComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

79
angular_frontend/src/app/components/edit-account/edit-account.component.ts

@ -1,79 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { Account } from 'src/app/model/account.model';
import { AccountService } from 'src/app/service/account.service';
@Component({
selector: 'app-edit-account',
templateUrl: './edit-account.component.html',
styleUrls: ['./edit-account.component.css']
})
export class EditAccountComponent implements OnInit {
aid: any ;
account: any;
accountForm: FormGroup;
constructor(private actRoute: ActivatedRoute,private route : Router, private accountService : AccountService) {
this.accountForm = new FormGroup({
username : new FormControl(''),
fullname: new FormControl(''),
gender: new FormControl(''),
phone: new FormControl(''),
email: new FormControl(''),
address: new FormControl(''),
city: new FormControl(''),
state: new FormControl(''),
pincode: new FormControl(''),
apartments: new FormControl('')
});
}
ngOnInit(): void {
this.actRoute.paramMap.subscribe(params =>{
this.aid = params.get('aid');
});
this.accountService.getOneAccount(this.aid).subscribe(data=>{
this.account = data;
this.accountForm = new FormGroup({
username : new FormControl(this.account.username,Validators.required),
fullname: new FormControl(this.account.fullname,Validators.required),
gender: new FormControl(this.account.gender,Validators.required),
phone: new FormControl(this.account.phone,Validators.required),
email: new FormControl(this.account.email,Validators.required),
address: new FormControl(this.account.address,Validators.required),
city: new FormControl(this.account.city,Validators.required),
state: new FormControl(this.account.state,Validators.required),
pincode: new FormControl(this.account.pincode,Validators.required),
apartments: new FormControl(this.account.apartments,Validators.required)
});
});
}
OnAccountFormSubmit(){
let acc : Account = {
id : +this.aid,
username : this.accountForm.value.username,
fullname : this.accountForm.value.fullname,
gender : this.accountForm.value.gender,
phone : this.accountForm.value.phone,
email : this.accountForm.value.email,
address : this.accountForm.value.address,
city : this.accountForm.value.city,
state : this.accountForm.value.state,
pincode : this.accountForm.value.pincode,
apartments : this.accountForm.value.apartments,
}
this.accountService.editAccount(this.aid,acc).subscribe(data=>{
this.route.navigateByUrl("/account/"+this.aid);
},
(err: any) =>{
console.log(err);
});
}
}

131
angular_frontend/src/app/components/fruits/fruits.component.css

@ -1,131 +0,0 @@
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
.login-page {
width: 260px;
padding: 8% 0 0;
align-items: left;
margin: 0 20px;
}
.form {
display: inline-block;
background: #FFFFFF;
max-width: 165px;
margin: 50px 30px;
padding: 45px;
text-align: left;
align-self: left;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
margin: 10px 0;
width: 100%;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,.form button:active,.form button:focus {
background: #43A047;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
body {
background: #76b852; /* fallback for old browsers */
background: -webkit-linear-gradient(right, #76b852, #8DC26F);
background: -moz-linear-gradient(right, #76b852, #8DC26F);
background: -o-linear-gradient(right, #76b852, #8DC26F);
background: linear-gradient(to left, #76b852, #8DC26F);
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.form-control{
border-radius: 3px;
width: 600px;
height: 30px;
margin-left: 23px;
}
.search-icon {
position: absolute;
z-index: 10;
right: 50%;
top: 20px;
color: black;
}
button {
font-family: "Roboto", sans-serif;
border-radius: 6px;
text-transform: uppercase;
outline: 0;
background: #62a7c2;
margin: 30px 20px;
width: 100px;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}

9
angular_frontend/src/app/components/fruits/fruits.component.html

@ -1,9 +0,0 @@
<div *ngFor="let p of products" class="form">
<img src={{p.imag}} width="150px" height="100px"><br> <b>Item Name:</b> &nbsp; {{p.name}} <br> <b>Price:</b> &nbsp; {{p.price}} <br><b>Category:</b> &nbsp; {{p.category}}
&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<button (click)=addtocart1(p.id!)>Add to cart</button>
</div>

25
angular_frontend/src/app/components/fruits/fruits.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FruitsComponent } from './fruits.component';
describe('FruitsComponent', () => {
let component: FruitsComponent;
let fixture: ComponentFixture<FruitsComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ FruitsComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(FruitsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

39
angular_frontend/src/app/components/fruits/fruits.component.ts

@ -1,39 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Product } from 'src/app/model/product.model';
import { ProductService } from 'src/app/service/product.service';
import { CartService } from 'src/app/service/cart.service';
@Component({
selector: 'app-fruits',
templateUrl: './fruits.component.html',
styleUrls: ['./fruits.component.css']
})
export class FruitsComponent implements OnInit {
products:Product[];
name:string;
uid!:any;
constructor(private productService:ProductService, private route:Router,private cartService:CartService) {
this.products=[];
this.name='Fruits';
}
ngOnInit(): void {
this.productService.getProductsByCategory(this.name).subscribe(data=>{
this.products=data;
})
}
addtocart(p:any){
this.cartService.addtoCart(p);
}
addtocart1(pid:any){
this.uid = window.sessionStorage.getItem('userid');
this.cartService.postCart(this.uid, pid).subscribe(data=>{
console.log('added to cart');
})
}
}

BIN
angular_frontend/src/app/components/home/g1.jpg

Before After
Width: 343  |  Height: 147  |  Size: 6.3 KiB

26
angular_frontend/src/app/components/home/home.component.css

@ -1,26 +0,0 @@
.button {
font: bold 15px Arial;
text-decoration: none;
background-color: #5fe697;
color: #05151f;
border-radius: 4px;
padding: 6px 8px 6px 8px;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #CCCCCC;
cursor: pointer;
}
.bg {
/* The image used */
background-image: url("g1.jpg");
/* Full height */
height: 100%;
width: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
opacity: 0.9;
}

11
angular_frontend/src/app/components/home/home.component.html

@ -1,11 +0,0 @@
<!-- <div class="bg"> -->
<a (click)="onAccount()" class="button">My Account</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a routerLink="/product" class="button">Items Available</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a routerLink="/cart" class="button">My Cart</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a routerLink="/order" class="button">My Order</a>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<router-outlet></router-outlet>
<!-- </div> -->

25
angular_frontend/src/app/components/home/home.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ HomeComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

27
angular_frontend/src/app/components/home/home.component.ts

@ -1,27 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AccountService } from 'src/app/service/account.service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
uid!:any;
constructor(private accountService : AccountService, private route: Router) { }
ngOnInit(): void {
this.accountService.getDetails(window.sessionStorage.getItem("username")).subscribe(data =>{
window.sessionStorage.setItem('userid',String(data.id));
console.log("home")
});
}
onAccount(){
this.uid = window.sessionStorage.getItem('userid');
this.route.navigateByUrl('/account/'+this.uid);
console.log("get by id")
}
}

131
angular_frontend/src/app/components/medicines/medicines.component.css

@ -1,131 +0,0 @@
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
.login-page {
width: 260px;
padding: 8% 0 0;
align-items: left;
margin: 0 20px;
}
.form {
display: inline-block;
background: #FFFFFF;
max-width: 165px;
margin: 50px 30px;
padding: 45px;
text-align: left;
align-self: left;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
margin: 10px 0;
width: 100%;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,.form button:active,.form button:focus {
background: #43A047;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
body {
background: #76b852; /* fallback for old browsers */
background: -webkit-linear-gradient(right, #76b852, #8DC26F);
background: -moz-linear-gradient(right, #76b852, #8DC26F);
background: -o-linear-gradient(right, #76b852, #8DC26F);
background: linear-gradient(to left, #76b852, #8DC26F);
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.form-control{
border-radius: 3px;
width: 600px;
height: 30px;
margin-left: 23px;
}
.search-icon {
position: absolute;
z-index: 10;
right: 50%;
top: 20px;
color: black;
}
button {
font-family: "Roboto", sans-serif;
border-radius: 6px;
text-transform: uppercase;
outline: 0;
background: #62a7c2;
margin: 30px 20px;
width: 100px;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}

9
angular_frontend/src/app/components/medicines/medicines.component.html

@ -1,9 +0,0 @@
<div *ngFor="let p of products" class="form">
<img src={{p.imag}} width="150px" height="100px"><br> <b>Item Name:</b> &nbsp; {{p.name}} <br> <b>Price:</b> &nbsp; {{p.price}} <br><b>Category:</b> &nbsp; {{p.category}}
&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<button (click)=addtocart1(p.id!)>Add to cart</button>
</div>

25
angular_frontend/src/app/components/medicines/medicines.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MedicinesComponent } from './medicines.component';
describe('MedicinesComponent', () => {
let component: MedicinesComponent;
let fixture: ComponentFixture<MedicinesComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ MedicinesComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(MedicinesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

37
angular_frontend/src/app/components/medicines/medicines.component.ts

@ -1,37 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Product } from 'src/app/model/product.model';
import { CartService } from 'src/app/service/cart.service';
import { ProductService } from 'src/app/service/product.service';
@Component({
selector: 'app-medicines',
templateUrl: './medicines.component.html',
styleUrls: ['./medicines.component.css']
})
export class MedicinesComponent implements OnInit {
products:Product[];
name:string;
uid!:any;
constructor(private productService:ProductService, private route:Router,private cartService:CartService) {
this.products=[];
this.name='Medicines';
}
ngOnInit(): void {
this.productService.getProductsByCategory(this.name).subscribe(data=>{
this.products=data;
})
}
addtocart(p:any){
this.cartService.addtoCart(p);
}
addtocart1(pid:any){
this.uid = window.sessionStorage.getItem('userid');
this.cartService.postCart(this.uid, pid).subscribe(data=>{
console.log('added to cart');
})
}
}

51
angular_frontend/src/app/components/orders/orders.component.css

@ -1,51 +0,0 @@
.card{
height: 60vh;
width: 25px;
padding: 25px;
}
.center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
#customers {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 60%;
align-self: center;
}
#customers td, #customers th {
border: 3px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #04AA6D;
color: white;
}
button {
font-family: "Roboto", sans-serif;
border-radius: 6px;
text-transform: uppercase;
outline: 0;
background: #e48ac6;
margin: 10px 20px;
width: 130px;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}

30
angular_frontend/src/app/components/orders/orders.component.html

@ -1,30 +0,0 @@
<div class="card-table">
<div class="card-product">
<table class="table table-responsive" id="customers" class="center">
<thead>
<tr>
<th>Order.No</th>
<th>Product Details</th>
<th>Final Price</th>
<th>Delivery Status</th>
</tr>
</thead>
<tbody>
<tr>
<!-- <tr *ngFor="let p of product; let i = index"> -->
<td>OODR1</td>
<tbody>
<tr *ngFor="let p of orderdto; let i = index">
<td>{{p.name}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rs.{{p.totalPrice}}</td>
</tr>
</tbody>
<td> Rs.{{grandTotal1}}</td>
<td>To be delivered by tomorrow 8:30 A.M</td>
</tr>
</tbody>
</table>
</div>
</div>

25
angular_frontend/src/app/components/orders/orders.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { OrdersComponent } from './orders.component';
describe('OrdersComponent', () => {
let component: OrdersComponent;
let fixture: ComponentFixture<OrdersComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ OrdersComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(OrdersComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

38
angular_frontend/src/app/components/orders/orders.component.ts

@ -1,38 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { OrderDto } from 'src/app/model/orderDto.model';
import { Orders } from 'src/app/model/orders.model';
import { CartService } from 'src/app/service/cart.service';
import { OrdersService } from 'src/app/service/orders.service';
@Component({
selector: 'app-orders',
templateUrl: './orders.component.html',
styleUrls: ['./orders.component.css']
})
export class OrdersComponent implements OnInit {
public product : any=[];
cartItem!:Orders[];
orderdto!: OrderDto[];
public grandTotal1 : any;
uid!:any;
public grandTotal : number = 0;
constructor(private cartService : CartService, private orderService:OrdersService) { }
ngOnInit(): void {
// this.cartService.getProducts().subscribe(res=>{
// this.product = res;
// // this.grandTotal = this.cartService.getTotalPrice();
// })
this.uid = window.sessionStorage.getItem('userid');
this.cartService.getCartdto(this.uid).subscribe(res=>{
this.orderdto = res;
console.log(this.orderdto);
})
this.uid = window.sessionStorage.getItem('userid');
this.cartService.CartSum(this.uid).subscribe(res=>{
this.grandTotal1 = res;
})
}
}

146
angular_frontend/src/app/components/product/product.component.css

@ -1,146 +0,0 @@
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
.login-page {
width: 260px;
padding: 8% 0 0;
align-items: left;
margin: 0 20px;
}
.form {
display: inline-block;
background: #FFFFFF;
max-width: 165px;
margin: 50px 30px;
padding: 45px;
text-align: left;
align-self: left;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
margin: 10px 0;
width: 100%;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,.form button:active,.form button:focus {
background: #43A047;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
body {
background: #76b852; /* fallback for old browsers */
background: -webkit-linear-gradient(right, #76b852, #8DC26F);
background: -moz-linear-gradient(right, #76b852, #8DC26F);
background: -o-linear-gradient(right, #76b852, #8DC26F);
background: linear-gradient(to left, #76b852, #8DC26F);
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.form-control{
border-radius: 3px;
width: 600px;
height: 30px;
margin-left: 23px;
}
.search-icon {
position: absolute;
z-index: 10;
right: 50%;
top: 20px;
color: black;
}
.button {
font-family: "Roboto", sans-serif;
border-radius: 6px;
text-transform: uppercase;
outline: 0;
text-decoration: none;
background: #62a7c2;
/* /* margin-top: 70px; */
margin: 0 20px;
width: 100px;
border: 0;
padding: 10px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
#button {
font: bold 15px Arial;
text-decoration: none;
background-color: #5fe697;
color: #05151f;
border-radius: 4px;
padding: 6px 8px 6px 8px;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #CCCCCC;
cursor: pointer;
}

27
angular_frontend/src/app/components/product/product.component.html

@ -1,27 +0,0 @@
<br><br>
<div class="form-group">
<input type="text" class="form-control" [(ngModel)]="searchTerm" (keyup)="search($event)" placeholder="search products">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span id="button" (click)='back()'>GO TO CART</span>
</div>
<br><br>
<br><br>
<!-- <button (click)="filter('')">All Items</button> -->
<!-- &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; -->
<a routerLink="/fruits" class="button">Fruits</a>
<a routerLink="/vegetables" class="button">Vegetables</a>
<a routerLink="/snacks" class="button">Snacks</a>
<a routerLink="/medicines" class="button">Medicines</a>
<a routerLink="/beverages" class="button">Beverages</a>
<br><br>
<div *ngFor="let p of products | filter:searchKey:'name'" class="form">
<span class="fas fa-search search-icon"></span>
<img src={{p.imag}} width="150px" height="100px"><br> <b>Item Name:</b> &nbsp; {{p.name}} <br> <b>Price:</b> &nbsp; {{p.price}} <br><b>Category:</b> &nbsp; {{p.category}}
&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<button (click)=addtocart1(p.id!) (click)=addtocart(p) >Add to cart</button>
</div>
<!-- (click)=onCheckout(p.id!) -->

25
angular_frontend/src/app/components/product/product.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ProductComponent } from './product.component';
describe('ProductComponent', () => {
let component: ProductComponent;
let fixture: ComponentFixture<ProductComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ProductComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ProductComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

74
angular_frontend/src/app/components/product/product.component.ts

@ -1,74 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Product } from 'src/app/model/product.model';
import { CartService } from 'src/app/service/cart.service';
import { OrdersService } from 'src/app/service/orders.service';
import { ProductService } from 'src/app/service/product.service';
@Component({
selector: 'app-product',
templateUrl: './product.component.html',
styleUrls: ['./product.component.css']
})
export class ProductComponent implements OnInit {
products : Product[];
uid! : any;
public filterCategory : any;
searchKey:string="";
public searchTerm !:string;
msg:string;
constructor(private productService : ProductService, private route: Router,private cartService:CartService, private orderService:OrdersService){
this.products = [];
this.msg ='';
}
ngOnInit(): void {
this.productService.getProducts().subscribe(data =>{
this.products = data;
this.filterCategory = data;
this.products.forEach((a:any)=>{
Object.assign(a,{quantity:1,total:a.price});
});
});
this.cartService.search.subscribe((val:any)=>{
this.searchKey = val;
})
}
addtocart(p:any){
this.cartService.addtoCart(p);
}
addtocart1(pid:any){
this.uid = window.sessionStorage.getItem('userid');
this.cartService.postCart(this.uid, pid).subscribe(data=>{
console.log('added to cart');
})
}
// onCheckout(pid:any){
// this.uid = window.sessionStorage.getItem('userid');
// this.orderService.postOrder(this.uid, pid).subscribe(data=>{
// console.log('added to order');
// })
// }
filter(category:string){
this.filterCategory = this.products.filter((a:any)=>{
if(a.category == category || category==''){
return a;
}
})
}
search(event:any){
this.searchTerm = (event.target as HTMLInputElement).value;
console.log(this.searchTerm);
this.cartService.search.next(this.searchTerm);
}
back(){
this.route.navigateByUrl("/cart");
}
}

171
angular_frontend/src/app/components/sign-up/sign-up.component.css

@ -1,171 +0,0 @@
/* * {box-sizing: border-box}
/* Full-width input fields */
/* input[type=text], input[type=password], input[type=number] {
width: 70%;
padding: 10px;
margin: 2px 0 22px 0;
display: inline-block;
border: none;
background: #f1f1f1; */
/* }
input[type=text]:focus, input[type=password]:focus {
background-color: #ddd;
outline: none;
}
hr {
border: 1px solid #f1f1f1;
margin-bottom: 25px;
}
/* Set a style for all buttons */
/* button {
background-color: #04AA6D;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
opacity: 0.9;
}
button:hover {
opacity:1;
} */
/* Extra styles for the cancel button */
/* .cancelbtn {
padding: 14px 20px;
background-color: #f44336;
} */
/* Float cancel and signup buttons and add an equal width */
/* .cancelbtn, .signupbtn {
float: left;
width: 50%;
} */
/* Add padding to container elements */
/* .container {
padding: 50px;
width: 500px;
align-self: center;
margin-left: 400px;
} */
/* Clear floats */
/* .clearfix::after {
content: "";
clear: both;
display: table;
} */
/* Change styles for cancel button and signup button on extra small screens */
/* @media screen and (max-width: 300px) {
.cancelbtn, .signupbtn {
width: 100%;
}
} */
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
.login-page {
width: 700px;
padding: 8% 0 0;
margin: auto;
}
.form {
position: relative;
z-index: 1;
background: #FFFFFF;
max-width: 700px;
margin: 0 auto 100px;
padding: 45px;
text-align: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 50%;
border: 0;
margin: 0 0 15px;
padding: 10px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
width: 100%;
border: 0;
padding: 15px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,.form button:active,.form button:focus {
background: #43A047;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
body {
background: #76b852; /* fallback for old browsers */
background: -webkit-linear-gradient(right, #76b852, #8DC26F);
background: -moz-linear-gradient(right, #76b852, #8DC26F);
background: -o-linear-gradient(right, #76b852, #8DC26F);
background: linear-gradient(to left, #76b852, #8DC26F);
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

65
angular_frontend/src/app/components/sign-up/sign-up.component.html

@ -1,65 +0,0 @@
<div class="login-page">
<div class="form">
<!-- <div class="container"> -->
<h1>Register Yourself</h1>
<p>Please fill in this form to create an account.</p>
<hr>
<form [formGroup]='accountForm' (submit)='OnAccountFormSubmit()'>
Username: <input type="text" formControlName="username">
<div *ngIf="accountForm.controls['username'].invalid &&(accountForm.controls['username'].touched ||
accountForm.controls['username'].dirty)">Invalid username</div>
<br><br>
Password: <input type="password" formControlName="password">
<div *ngIf="accountForm.controls['password'].invalid &&(accountForm.controls['password'].touched ||
accountForm.controls['password'].dirty)">Invalid password</div>
<br><br>
Name: <input type="text" formControlName="fullname">
<div *ngIf="accountForm.controls['fullname'].invalid &&(accountForm.controls['fullname'].touched ||
accountForm.controls['fullname'].dirty)">Invalid full name</div>
<br><br>
Gender: <input type="text" formControlName="gender">
<div *ngIf="accountForm.controls['gender'].invalid &&(accountForm.controls['gender'].touched ||
accountForm.controls['gender'].dirty)">Invalid gender</div>
<br><br>
Phone no: <input type="number" formControlName="phone">
<div *ngIf="accountForm.controls['phone'].invalid &&(accountForm.controls['phone'].touched ||
accountForm.controls['phone'].dirty)">Invalid phone number</div>
<br><br>
Email: <input type="text" formControlName="email">
<div *ngIf="accountForm.controls['email'].invalid &&(accountForm.controls['email'].touched ||
accountForm.controls['email'].dirty)">Invalid email</div>
<br><br>
Building Address: <input type="text" formControlName="address">
<div *ngIf="accountForm.controls['address'].invalid &&(accountForm.controls['address'].touched ||
accountForm.controls['address'].dirty)">Invalid building address</div>
<br><br>
City: <input type="text" formControlName="city">
<div *ngIf="accountForm.controls['city'].invalid &&(accountForm.controls['city'].touched ||
accountForm.controls['city'].dirty)">Invalid city</div>
<br><br>
State: <input type="text" formControlName="state">
<div *ngIf="accountForm.controls['state'].invalid &&(accountForm.controls['state'].touched ||
accountForm.controls['state'].dirty)">Invalid state</div>
<br><br>
Pincode: <input type="text" formControlName="pincode">
<div *ngIf="accountForm.controls['pincode'].invalid &&(accountForm.controls['pincode'].touched ||
accountForm.controls['pincode'].dirty)">Invalid pincode</div>
<br><br>
Apartments: <input type="text" formControlName="apartments">
<div *ngIf="accountForm.controls['apartments'].invalid &&(accountForm.controls['apartments'].touched ||
accountForm.controls['apartments'].dirty)">Invalid no. of apartments</div>
<br><br>
<div class="clearfix">
<button [disabled]="!accountForm.valid">Register</button>
</div>
</form>
<p>By creating an account you agree to our <a href="#" style="color:dodgerblue">Terms & Privacy</a>.</p>
<!-- </div> -->
</div>
</div>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save