Browse Source

add

dailycart_po
Pranathi Bhogaraju 4 years ago
parent
commit
9c8adb9269
142 changed files with 17469 additions and 0 deletions
  1. 49
      BackEnd/DailyCart_CM/.classpath
  2. 28
      BackEnd/DailyCart_CM/.project
  3. 25
      BackEnd/DailyCart_CM/HELP.md
  4. 6
      BackEnd/DailyCart_CM/target/classes/META-INF/MANIFEST.MF
  5. 7
      BackEnd/DailyCart_CM/target/classes/META-INF/maven/com.example/DailyCart_DD/pom.properties
  6. 95
      BackEnd/DailyCart_CM/target/classes/META-INF/maven/com.example/DailyCart_DD/pom.xml
  7. 16
      BackEnd/DailyCart_CM/target/classes/application.properties
  8. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/CorsConfig.class
  9. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/DailyCartDdApplication.class
  10. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/SecurityConfig.class
  11. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/config/MessagingConfig.class
  12. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/CartController.class
  13. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/CategoryController.class
  14. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/OrderController.class
  15. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/ProductController.class
  16. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/UserController.class
  17. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/dto/Cartdto.class
  18. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/dto/Orderdto.class
  19. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/Cart.class
  20. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/Category.class
  21. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/Order.class
  22. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/OrderStatus.class
  23. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/Product.class
  24. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/User.class
  25. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/publisher/OrderPublisher.class
  26. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/CartRepository.class
  27. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/CategoryRepository.class
  28. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/OrderRepository.class
  29. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/ProductRepository.class
  30. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/UserRepository.class
  31. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/service/CartService.class
  32. BIN
      BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/service/MyUserDetailsService.class
  33. BIN
      BackEnd/DailyCart_CM/target/test-classes/com/myrestapp/demo/DailyCartDdApplicationTests.class
  34. 17
      FrontEnd/.browserslistrc
  35. 16
      FrontEnd/.editorconfig
  36. 45
      FrontEnd/.gitignore
  37. 27
      FrontEnd/README.md
  38. 109
      FrontEnd/angular.json
  39. 44
      FrontEnd/karma.conf.js
  40. 12104
      FrontEnd/package-lock.json
  41. 40
      FrontEnd/package.json
  42. 6
      FrontEnd/proxy.config.json
  43. BIN
      FrontEnd/src/1.jpg
  44. 754
      FrontEnd/src/10.htm
  45. BIN
      FrontEnd/src/11.png
  46. BIN
      FrontEnd/src/2.jpg
  47. BIN
      FrontEnd/src/3.jpg
  48. BIN
      FrontEnd/src/4.png
  49. BIN
      FrontEnd/src/5.png
  50. BIN
      FrontEnd/src/6.png
  51. BIN
      FrontEnd/src/7.jpg
  52. BIN
      FrontEnd/src/8.png
  53. BIN
      FrontEnd/src/9.png
  54. 38
      FrontEnd/src/app/app-routing.module.ts
  55. 0
      FrontEnd/src/app/app.component.css
  56. 32
      FrontEnd/src/app/app.component.html
  57. 35
      FrontEnd/src/app/app.component.spec.ts
  58. 30
      FrontEnd/src/app/app.component.ts
  59. 52
      FrontEnd/src/app/app.module.ts
  60. 0
      FrontEnd/src/app/auth/login/login.component.css
  61. 108
      FrontEnd/src/app/auth/login/login.component.html
  62. 25
      FrontEnd/src/app/auth/login/login.component.spec.ts
  63. 53
      FrontEnd/src/app/auth/login/login.component.ts
  64. 16
      FrontEnd/src/app/auth/service/auth-guard.service.spec.ts
  65. 21
      FrontEnd/src/app/auth/service/auth-guard.service.ts
  66. 16
      FrontEnd/src/app/auth/service/auth.service.spec.ts
  67. 22
      FrontEnd/src/app/auth/service/auth.service.ts
  68. 41
      FrontEnd/src/app/auth/service/user.service.ts
  69. 0
      FrontEnd/src/app/auth/signup/signup.component.css
  70. 125
      FrontEnd/src/app/auth/signup/signup.component.html
  71. 25
      FrontEnd/src/app/auth/signup/signup.component.spec.ts
  72. 45
      FrontEnd/src/app/auth/signup/signup.component.ts
  73. 0
      FrontEnd/src/app/components/banner/banner.component.css
  74. 19
      FrontEnd/src/app/components/banner/banner.component.html
  75. 25
      FrontEnd/src/app/components/banner/banner.component.spec.ts
  76. 29
      FrontEnd/src/app/components/banner/banner.component.ts
  77. 16
      FrontEnd/src/app/components/cart/cart.component.css
  78. 278
      FrontEnd/src/app/components/cart/cart.component.html
  79. 25
      FrontEnd/src/app/components/cart/cart.component.spec.ts
  80. 139
      FrontEnd/src/app/components/cart/cart.component.ts
  81. 0
      FrontEnd/src/app/components/category/category.component.css
  82. 1
      FrontEnd/src/app/components/category/category.component.html
  83. 25
      FrontEnd/src/app/components/category/category.component.spec.ts
  84. 15
      FrontEnd/src/app/components/category/category.component.ts
  85. 0
      FrontEnd/src/app/components/dairy/dairy.component.css
  86. 170
      FrontEnd/src/app/components/dairy/dairy.component.html
  87. 25
      FrontEnd/src/app/components/dairy/dairy.component.spec.ts
  88. 27
      FrontEnd/src/app/components/dairy/dairy.component.ts
  89. 0
      FrontEnd/src/app/components/fruits/fruits.component.css
  90. 171
      FrontEnd/src/app/components/fruits/fruits.component.html
  91. 25
      FrontEnd/src/app/components/fruits/fruits.component.spec.ts
  92. 27
      FrontEnd/src/app/components/fruits/fruits.component.ts
  93. 0
      FrontEnd/src/app/components/household/household.component.css
  94. 170
      FrontEnd/src/app/components/household/household.component.html
  95. 25
      FrontEnd/src/app/components/household/household.component.spec.ts
  96. 26
      FrontEnd/src/app/components/household/household.component.ts
  97. 0
      FrontEnd/src/app/components/order/order.component.css
  98. 273
      FrontEnd/src/app/components/order/order.component.html
  99. 25
      FrontEnd/src/app/components/order/order.component.spec.ts
  100. 31
      FrontEnd/src/app/components/order/order.component.ts

49
BackEnd/DailyCart_CM/.classpath

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

28
BackEnd/DailyCart_CM/.project

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DailyCart_DD</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

25
BackEnd/DailyCart_CM/HELP.md

@ -0,0 +1,25 @@
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.5.4/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.5.4/maven-plugin/reference/html/#build-image)
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.5.4/reference/htmlsingle/#using-boot-devtools)
* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.5.4/reference/htmlsingle/#boot-features-jpa-and-spring-data)
* [Spring Security](https://docs.spring.io/spring-boot/docs/2.5.4/reference/htmlsingle/#boot-features-security)
* [Spring Web](https://docs.spring.io/spring-boot/docs/2.5.4/reference/htmlsingle/#boot-features-developing-web-applications)
### Guides
The following guides illustrate how to use some features concretely:
* [Accessing data with MySQL](https://spring.io/guides/gs/accessing-data-mysql/)
* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
* [Securing a Web Application](https://spring.io/guides/gs/securing-web/)
* [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/)
* [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/)
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/)

6
BackEnd/DailyCart_CM/target/classes/META-INF/MANIFEST.MF

@ -0,0 +1,6 @@
Manifest-Version: 1.0
Implementation-Title: DailyCart_DD
Implementation-Version: 0.0.1-SNAPSHOT
Build-Jdk-Spec: 1.8
Created-By: Maven Integration for Eclipse

7
BackEnd/DailyCart_CM/target/classes/META-INF/maven/com.example/DailyCart_DD/pom.properties

@ -0,0 +1,7 @@
#Generated by Maven Integration for Eclipse
#Thu Sep 30 13:21:26 IST 2021
version=0.0.1-SNAPSHOT
groupId=com.example
m2e.projectName=DailyCart_DD
m2e.projectLocation=C\:\\Users\\KIIT\\Documents\\workspace-spring-tool-suite-4-4.5.1.RELEASE\\DailyCart_DD
artifactId=DailyCart_DD

95
BackEnd/DailyCart_CM/target/classes/META-INF/maven/com.example/DailyCart_DD/pom.xml

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>DailyCart_DD</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>DailyCart_DD</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

16
BackEnd/DailyCart_CM/target/classes/application.properties

@ -0,0 +1,16 @@
server.port=1005
spring.datasource.url=jdbc:mysql://localhost:3306/DailyCart?createDatabaseIfNotExist=true
spring.datasource.username=root
spring.datasource.password=Password123
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.ddl-auto=update
spring.jackson.serialization.fail-on-empty-beans=false
server.servlet.context-path=/api1
spring.rabbitmq.host=labs4.koteshwar.com
spring.rabbitmq.password=guest
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/CorsConfig.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/DailyCartDdApplication.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/SecurityConfig.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/config/MessagingConfig.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/CartController.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/CategoryController.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/OrderController.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/ProductController.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/controller/UserController.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/dto/Cartdto.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/dto/Orderdto.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/Cart.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/Category.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/Order.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/OrderStatus.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/Product.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/model/User.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/publisher/OrderPublisher.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/CartRepository.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/CategoryRepository.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/OrderRepository.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/ProductRepository.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/repository/UserRepository.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/service/CartService.class

BIN
BackEnd/DailyCart_CM/target/classes/com/myrestapp/demo/service/MyUserDetailsService.class

BIN
BackEnd/DailyCart_CM/target/test-classes/com/myrestapp/demo/DailyCartDdApplicationTests.class

17
FrontEnd/.browserslistrc

@ -0,0 +1,17 @@
# 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
FrontEnd/.editorconfig

@ -0,0 +1,16 @@
# 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
FrontEnd/.gitignore

@ -0,0 +1,45 @@
# 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
FrontEnd/README.md

@ -0,0 +1,27 @@
# DailyCart
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.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.

109
FrontEnd/angular.json

@ -0,0 +1,109 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"DailyCart": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/DailyCart",
"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": [
"node_modules/jquery/dist/jquery.min.js",
"src/assets/js/main.js"
]
},
"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": "DailyCart:build:production"
},
"development": {
"browserTarget": "DailyCart:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "DailyCart: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": "DailyCart"
}

44
FrontEnd/karma.conf.js

@ -0,0 +1,44 @@
// 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/DailyCart'),
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
});
};

12104
FrontEnd/package-lock.json
File diff suppressed because it is too large
View File

40
FrontEnd/package.json

@ -0,0 +1,40 @@
{
"name": "daily-cart",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --port 8001 --proxy-config proxy.config.json",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.2.0",
"@angular/common": "~12.2.0",
"@angular/compiler": "~12.2.0",
"@angular/core": "~12.2.0",
"@angular/forms": "~12.2.0",
"@angular/platform-browser": "~12.2.0",
"@angular/platform-browser-dynamic": "~12.2.0",
"@angular/router": "~12.2.0",
"jquery": "^3.6.0",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.1",
"@angular/cli": "~12.2.1",
"@angular/compiler-cli": "~12.2.0",
"@types/jasmine": "~3.8.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.8.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.7.0",
"typescript": "~4.3.5"
}
}

6
FrontEnd/proxy.config.json

@ -0,0 +1,6 @@
{
"/api1/*" :{
"target" : "http://localhost:1005",
"secure" : false
}
}

BIN
FrontEnd/src/1.jpg

Before After
Width: 1200  |  Height: 800  |  Size: 88 KiB

754
FrontEnd/src/10.htm
File diff suppressed because it is too large
View File

BIN
FrontEnd/src/11.png

Before After
Width: 840  |  Height: 650  |  Size: 253 KiB

BIN
FrontEnd/src/2.jpg

Before After
Width: 626  |  Height: 417  |  Size: 13 KiB

BIN
FrontEnd/src/3.jpg

Before After
Width: 616  |  Height: 280  |  Size: 56 KiB

BIN
FrontEnd/src/4.png

Before After
Width: 241  |  Height: 209  |  Size: 143 B

BIN
FrontEnd/src/5.png

Before After
Width: 275  |  Height: 183  |  Size: 143 B

BIN
FrontEnd/src/6.png

Before After
Width: 500  |  Height: 500  |  Size: 153 KiB

BIN
FrontEnd/src/7.jpg

Before After
Width: 238  |  Height: 250  |  Size: 7.0 KiB

BIN
FrontEnd/src/8.png

Before After
Width: 860  |  Height: 887  |  Size: 30 KiB

BIN
FrontEnd/src/9.png

Before After
Width: 820  |  Height: 431  |  Size: 13 KiB

38
FrontEnd/src/app/app-routing.module.ts

@ -0,0 +1,38 @@
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 { SignupComponent } from './auth/signup/signup.component';
import { BannerComponent } from './components/banner/banner.component';
import { CartComponent } from './components/cart/cart.component';
import { DairyComponent } from './components/dairy/dairy.component';
import { FruitsComponent } from './components/fruits/fruits.component';
import { HouseholdComponent } from './components/household/household.component';
import { OrderComponent } from './components/order/order.component';
import { PaymentComponent } from './components/payment/payment.component';
import { ProductsComponent } from './components/products/products.component';
import { ProfileComponent } from './components/profile/profile.component';
import { SnacksComponent } from './components/snacks/snacks.component';
import { WholegrainComponent } from './components/wholegrain/wholegrain.component';
const routes: Routes = [
{path:'products', component:ProductsComponent, canActivate : [AuthGuardService] },
{path:'cart', component:CartComponent, canActivate : [AuthGuardService] },
{path:'profile/:uid', component:ProfileComponent, canActivate : [AuthGuardService] },
{path:'products/fruits', component:FruitsComponent},
{path:'products/dairy', component:DairyComponent},
{path:'products/household', component:HouseholdComponent},
{path:'products/wholegrain', component:WholegrainComponent},
{path:'products/snacks', component:SnacksComponent},
{path:'login', component:LoginComponent},
{path:'signup', component:SignupComponent},
{path:'banner', component:BannerComponent},
{path:'order', component:OrderComponent, canActivate : [AuthGuardService]},
{path:'payment', component:PaymentComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

0
FrontEnd/src/app/app.component.css

32
FrontEnd/src/app/app.component.html

@ -0,0 +1,32 @@
<style>
body {
background-image: url('1.jpg');
background-position: center;
background-size: cover;
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<title>DailyCart</title>
</head>
<body>
<h2 class="logo">DailyCart</h2>
<div class="menu">
<ul>
<li><a routerLink="banner">HOME</a></li>
<li><a routerLink="products">PRODUCTS</a></li>
<li><a routerLink="cart">CART</a></li>
<li><a routerLink="order">ORDERS</a></li>
<li><a (click)="onProfile()">PROFILE</a></li>
</ul>
</div>
<div class="search">
<input class="srch" type="search" name="" placeholder="Search here...">
<a routerLink="products"> <button class="btn">Search</button></a>
</div>
</body>
</html>
<router-outlet></router-outlet>

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

@ -0,0 +1,35 @@
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 'DailyCart'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('DailyCart');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('DailyCart app is running!');
});
});

30
FrontEnd/src/app/app.component.ts

@ -0,0 +1,30 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { UserService } from './auth/service/user.service';
import { ProductsService } from './service/products.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{
title = 'DailyCart';
username:any;
uid!:any;
constructor(private route : Router,private productService : ProductsService,private userService : UserService)
{
}
ngOnInit(): void {
}
onProfile(){
this.uid = window.sessionStorage.getItem('userid');
this.route.navigateByUrl('/profile/'+this.uid);
}
}

52
FrontEnd/src/app/app.module.ts

@ -0,0 +1,52 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { ProductsComponent } from './components/products/products.component';
import { ReactiveFormsModule } from '@angular/forms';
import {HttpClientModule} from '@angular/common/http';
import { CategoryComponent } from './components/category/category.component';
import { CartComponent } from './components/cart/cart.component';
import { FruitsComponent } from './components/fruits/fruits.component';
import { DairyComponent } from './components/dairy/dairy.component';
import { WholegrainComponent } from './components/wholegrain/wholegrain.component';
import { HouseholdComponent } from './components/household/household.component';
import { SnacksComponent } from './components/snacks/snacks.component';
import { LoginComponent } from './auth/login/login.component';
import { BannerComponent } from './components/banner/banner.component';
import { ProfileComponent } from './components/profile/profile.component';
import { SignupComponent } from './auth/signup/signup.component';
import { OrderComponent } from './components/order/order.component';
import { PaymentComponent } from './components/payment/payment.component';
@NgModule({
declarations: [
AppComponent,
ProductsComponent,
CategoryComponent,
CartComponent,
FruitsComponent,
DairyComponent,
WholegrainComponent,
HouseholdComponent,
SnacksComponent,
LoginComponent,
BannerComponent,
ProfileComponent,
SignupComponent,
OrderComponent,
PaymentComponent
],
imports: [
BrowserModule,
AppRoutingModule,
ReactiveFormsModule,
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

0
FrontEnd/src/app/auth/login/login.component.css

108
FrontEnd/src/app/auth/login/login.component.html

@ -0,0 +1,108 @@
<Style>
a {
text-decoration: none;
font-size: 17px;
color: black;
}
body
{
margin: 0;
padding: 0;
font-family: 'Arial';
}
.login{
width: 382px;
overflow: hidden;
margin: auto;
margin: 20 0 0 450px;
padding: 40px;
background: #6abadeba;
border-radius: 15px ;
}
h2{
color: #ff7200;
padding: 20px;
}
label{
color: black;
font-size: 17px;
}
#Uname{
width: 300px;
height: 30px;
border: none;
border-radius: 3px;
padding-left: 8px;
}
#Pass{
width: 300px;
height: 30px;
border: none;
border-radius: 3px;
padding-left: 8px;
}
#log{
width: 300px;
height: 30px;
border: none;
border-radius: 17px;
padding-left: 7px;
color: #ff7200;
}
span{
color: white;
font-size: 17px;
}
a{
float: right;
background-color: grey;
}
.banner {
/* The image used */
background-image:
url(1.jpg);
background-position: center;
background-size: cover;
}
</Style>
<!DOCTYPE html>
<html>
<head>
<title>Login Form</title>
</head>
<body>
<div class="banner">
<br><br><br><br><br><br>
<div class="login">
<form id="login" method="get" action="login.php" [formGroup]='loginForm' (submit)='OnLoginFormSubmit()'>
<h2 class="logo">Login to DailyCart</h2><br><br><br><br><br>
<label><b>Username <br>
</b>
</label>
<input type="text" id="Uname" formControlName="username">
<br><br>
<label><b>Password
</b>
</label>
<input type="password" id="Pass" formControlName="password">
<br><br><br>
<button [disabled]="!loginForm.valid" id="log"> LOGIN </button>
<br><br>
<p>New User?<a href="signup"><img border="0" src="https://previews.123rf.com/images/faysalfarhan/faysalfarhan1711/faysalfarhan171137973/89544623-sign-up-member-icon-isolated-on-elegant-yellow-round-button-abstract-illustration.jpg" width="70" height="70"></a></p>
</form>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br>
</div>
</body>
</html>
<router-outlet></router-outlet>

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

@ -0,0 +1,25 @@
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();
});
});

53
FrontEnd/src/app/auth/login/login.component.ts

@ -0,0 +1,53 @@
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { User } from 'src/app/model/User';
import { ProductsService } from 'src/app/service/products.service';
import { UserService } from '../service/user.service';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
loginForm! : FormGroup;
user! : User
msg: string;
uid!:any;
constructor(private route: Router,private userService:UserService, private productService:ProductsService)
{
this.msg='';
}
ngOnInit(): void {
this.loginForm = new FormGroup({
username : new FormControl('', Validators.required),
password : new FormControl('', Validators.required)
});
}
OnLoginFormSubmit()
{
this.user = {
username : this.loginForm.value.username,
role : this.loginForm.value.role,
password : this.loginForm.value.password
}
this.userService.login(this.user).subscribe((data: any)=>{
//save the username and password in local storage
window.sessionStorage.setItem("username",this.user.username);
window.sessionStorage.setItem("isLoggedIn","true");
this.route.navigateByUrl('/banner');
}),
(err: any)=>{
this.msg='Invalid credentials...Check your Login and Password!!!';
window.sessionStorage.removeItem("username");
window.sessionStorage.removeItem("isLoggedIn");
};
}
}

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

@ -0,0 +1,16 @@
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
FrontEnd/src/app/auth/service/auth-guard.service.ts

@ -0,0 +1,21 @@
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
FrontEnd/src/app/auth/service/auth.service.spec.ts

@ -0,0 +1,16 @@
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();
});
});

22
FrontEnd/src/app/auth/service/auth.service.ts

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

41
FrontEnd/src/app/auth/service/user.service.ts

@ -0,0 +1,41 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { User } from 'src/app/model/User';
@Injectable({
providedIn: 'root'
})
export class UserService {
path:string='http://localhost:8001/api1';
constructor(private httpClient:HttpClient){
}
postUser(user : User):Observable<User[]>{
let authCode = btoa(user.username+':'+user.password);
user.username = authCode;
user.password = '';
return this.httpClient.post<User[]>(this.path+'/signup/',user);
}
login(user : any):Observable<User[]>{
let httpOptions={
headers : new HttpHeaders({
'Content-Type':'application/json',
'Authorization':'Basic ' + btoa(user.username+':'+user.password)
})
}
window.sessionStorage.setItem("code",btoa(user.username+':'+user.password));
let login_api = this.path + '/login';
return this.httpClient.get<User[]>(login_api,httpOptions);
}
public getDetails(user:any):Observable<User>{
console.log("j",user)
let user_api=this.path+'/username/'+user;
return this.httpClient.get<any>(user_api);
}
}

0
FrontEnd/src/app/auth/signup/signup.component.css

125
FrontEnd/src/app/auth/signup/signup.component.html

@ -0,0 +1,125 @@
<Style>
body
{
margin: 0;
padding: 0;
font-family: 'Arial';
}
.login{
width: 382px;
overflow: hidden;
margin: auto;
margin: 20 0 0 450px;
padding: 32px;
background: #6abadeba;
border-radius: 15px ;
}
h2{
color: #ff7200;
padding: 20px;
}
label{
color: black;
font-size: 17px;
}
#Uname{
width: 300px;
height: 30px;
border: none;
border-radius: 3px;
padding-left: 8px;
}
#Pass{
width: 300px;
height: 30px;
border: none;
border-radius: 3px;
padding-left: 8px;
}
#log{
width: 300px;
height: 30px;
border: none;
border-radius: 17px;
padding-left: 7px;
color: #ff7200;
}
span{
color: white;
font-size: 17px;
}
a{
float: right;
background-color: grey;
}
.banner {
/* The image used */
background-image:
url(1.jpg);
background-position: center;
background-size: cover;
}
</Style>
<!DOCTYPE html>
<html>
<head>
<title>Login Form</title>
</head>
<body>
<div class="banner">
<br><br><br><br><br><br>
<div class="login">
<form id="login" method="get" action="login.php" [formGroup]='signUpForm' (submit)='onSignUpFormSubmit()'>
<h2 class="logo">Sign Up to DailyCart</h2><br><br><br><br><br>
<label><b>Name <br>
</b>
</label>
<input type="text" id="Uname" formControlName="name">
<br><br>
<label><b>Username <br>
</b>
</label>
<input type="text" id="Uname" formControlName="username">
<br><br>
<label><b>Role <br>
</b>
</label>
<select name="role" id="Uname" formControlName="role">
<option value="Admin">Admin</option>
<option value="User">User</option>
</select>
<br><br>
<label><b>Apartment <br>
</b>
</label>
<select name="apartment" id="Uname" formControlName="apartment">
<option value="Apartment 1">Apartment 1</option>
<option value="Apartment 2">Apartment 2</option>
<option value="Apartment 3">Apartment 3</option>
<option value="Apartment 4">Apartment 4</option>
</select>
<br><br>
<label><b>Password <br>
</b>
</label>
<input type="password" id="Pass" formControlName="password">
<br><br> <br>
<button [disabled]="!signUpForm.valid" id="log"> SIGN IN </button>
<br><br>
</form>
</div>
<br><br><br><br> <br><br> <br><br> <br><br>
</div>
</body>
</html>

25
FrontEnd/src/app/auth/signup/signup.component.spec.ts

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

45
FrontEnd/src/app/auth/signup/signup.component.ts

@ -0,0 +1,45 @@
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { User } from 'src/app/model/User';
import { UserService } from '../service/user.service';
@Component({
selector: 'app-signup',
templateUrl: './signup.component.html',
styleUrls: ['./signup.component.css']
})
export class SignupComponent implements OnInit {
signUpForm! : FormGroup;
constructor(private route: Router, private userService:UserService)
{
}
ngOnInit(): void {
this.signUpForm = new FormGroup({
name : new FormControl('',[Validators.required]),
username : new FormControl('',[Validators.required]),
password : new FormControl('',[Validators.required]),
role : new FormControl('',[Validators.required]),
apartment : new FormControl('',[Validators.required])
});
}
onSignUpFormSubmit() : void{
let user : User={
name : this.signUpForm.value.name,
username : this.signUpForm.value.username,
password : this.signUpForm.value.password,
role : this.signUpForm.value.role,
apartment : this.signUpForm.value.apartment
};
this.userService.postUser(user).subscribe(
(data: any)=>{this.route.navigateByUrl('/login');},
(err: any)=>{console.log(err)}
);
}
}

0
FrontEnd/src/app/components/banner/banner.component.css

19
FrontEnd/src/app/components/banner/banner.component.html

@ -0,0 +1,19 @@
<style>
.banner {
/* The image used */
background-image:
url(1.jpg);
background-position: center;
background-size: cover;
}
</style>
<div class="banner">
<br><br><br>
<div class="content">
<h1><span>Welcome to DailyCart</span><br>-Team Seattle<br> </h1>
<img src="https://www.pngall.com/wp-content/uploads/4/Grocery-PNG-Picture.png" style="width:40%">
</div>
<br><br><br><br>
</div>

25
FrontEnd/src/app/components/banner/banner.component.spec.ts

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

29
FrontEnd/src/app/components/banner/banner.component.ts

@ -0,0 +1,29 @@
import { Component, OnInit } from '@angular/core';
import { UserService } from 'src/app/auth/service/user.service';
@Component({
selector: 'app-banner',
templateUrl: './banner.component.html',
styleUrls: ['./banner.component.css']
})
export class BannerComponent implements OnInit {
constructor(private userService:UserService) { }
ngOnInit(): void {
console.log(window.location.pathname)
this.userService.getDetails(window.sessionStorage.getItem("username")).subscribe(data => {
window.sessionStorage.setItem('userid', String(data.id));
console.log("j",data.id)
});
this.userService.getDetails(window.sessionStorage.getItem("username")).subscribe(data => {
window.sessionStorage.setItem('apartment', String(data.apartment));
console.log("j",data.apartment)
});
this.userService.getDetails(window.sessionStorage.getItem("username")).subscribe(data => {
window.sessionStorage.setItem('role', String(data.role));
console.log("j",data.role)
});
}
}

16
FrontEnd/src/app/components/cart/cart.component.css

@ -0,0 +1,16 @@
.item {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.btn-pay {
background-color: #C800Da;
border: 0;
color: #fff;
font-weight: 600;
}
.fa-ticket {
color: #0e1fa1;
}

278
FrontEnd/src/app/components/cart/cart.component.html

@ -0,0 +1,278 @@
<style>
*{
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
body{
font-family: Helvetica;
-webkit-font-smoothing: antialiased;
background: rgba( 71, 147, 227, 1);
}
h2{
text-align: center;
font-size: 18px;
text-transform: uppercase;
letter-spacing: 1px;
color: white;
padding: 30px 0;
}
/* Table Styles */
.table-wrapper{
margin: 10px 70px 70px;
box-shadow: 0px 35px 50px rgba( 0, 0, 0, 0.2 );
}
.fl-table {
border-radius: 5px;
font-size: 16px;
font-weight: normal;
border: none;
border-collapse: collapse;
width: 100%;
max-width: 100%;
white-space: nowrap;
background-color: white;
}
.fl-table td, .fl-table th {
text-align: center;
padding: 8px;
}
.fl-table td {
border-right: 1px solid #f8f8f8;
font-size: 12px;
}
.fl-table thead th {
color: #ffffff;
background: #4FC3A1;
}
.fl-table thead th:nth-child(odd) {
color: #ffffff;
background: #324960;
}
.fl-table tr:nth-child(even) {
background: #F8F8F8;
}
/* Responsive */
@media (max-width: 767px) {
.fl-table {
display: block;
width: 100%;
}
.table-wrapper:before{
content: "Scroll horizontally >";
display: block;
text-align: right;
font-size: 11px;
color: white;
padding: 0 0 10px;
}
.fl-table thead, .fl-table tbody, .fl-table thead th {
display: block;
}
.fl-table thead th:last-child{
border-bottom: none;
}
.fl-table thead {
float: left;
}
.fl-table tbody {
position: relative;
overflow-x: auto;
}
.fl-table td, .fl-table th {
padding: 20px .625em .625em .625em;
height: 60px;
vertical-align: middle;
box-sizing: border-box;
overflow-x: hidden;
overflow-y: auto;
width: 120px;
font-size: 16px;
text-overflow: ellipsis;
}
.fl-table thead th {
text-align: left;
border-bottom: 1px solid #f7f7f9;
}
.fl-table tbody tr {
display: table-cell;
}
.fl-table tbody tr:nth-child(odd) {
background: none;
}
.fl-table tr:nth-child(even) {
background: transparent;
}
.fl-table tr td:nth-child(odd) {
background: #F8F8F8;
border-right: 1px solid #E6E4E4;
}
.fl-table tr td:nth-child(even) {
border-right: 1px solid #E6E4E4;
}
.fl-table tbody td {
display: block;
text-align: center;
}
}
.banner {
/* The image used */
background-image:
url(1.jpg);
background-position: center;
background-size: cover;
}
.banner1 {
/* The image used */
background-image:
url(9.png);
background-position: center;
background-size: cover;
}
.quantity {
display: flex;
justify-content: center;
}
.quantity button {
width: 35px;
height: 35px;
border: 1px solid #000;
color: #000;
border-radius: 0;
background: #fff
}
.quantity input {
border: none;
border-top: 1px solid #000;
border-bottom: 1px solid #000;
text-align: center;
width: 100px;
font-size: 20px;
color: #000;
font-weight: 300;
}
.total-price {
text-align: center;
font-size: 30px;
color: black;
}
.total-price .fa-rupee {
display: inline-block;
font-size: 90%;
margin-right: 5px;
}
@import url('https://fonts.googleapis.com/css?family=Lato:400,700,900|Open+Sans:300,400|Oswald:400,700');
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: 'Lato', sans-serif;
font-weight: normal;
}
.item {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.btn-pay {
background-color: #C800Da;
border: 0;
color: #fff;
font-weight: 600;
}
.fa-ticket {
color: #0e1fa1;
}
</style>
<!doctype html>
<html lang="en">
<div class="banner">
<br><br><br><br><br>
<ng-container *ngIf="role=='User'">
</ng-container>
<ng-container *ngIf="cartdto.length!=0">
<div class="table-wrapper">
<table class="fl-table">
<thead>
<tr>
<th>S NO.</th>
<th>IMAGE</th>
<th>PRODUCT NAME</th>
<th>PRICE</th>
<th>QUANTITY</th>
<th>TOTAL</th>
<th>REMOVE</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let i of cartdto; let in=index;">
<td>{{in+1}}</td>
<td><img src="{{i.image}}" style="width:80px"></td>
<td>{{i.pname}}</td>
<td><span id="price">{{i.price}}</span></td>
<td><button (click)="dec(i,i.cid)">-</button>{{i.quantity}}<button (click)="inc(i,i.cid)">+</button></td>
<td><b>₹ {{i.quantity*i.price}}</b></td>
<td><button (click)=removeItem(i.cid)>REMOVE</button></td>
</tr>
<tr>
<td colspan="4"></td>
<td><button routerLink="/products">SHOP MORE</button></td>
<td><button routerLink="/payment">PROCEED TO PAYMENT</button></td>
<td><strong>Grand Total : ₹ {{grandTotal1}}</strong></td>
</tr>
<tbody>
</table>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</ng-container>
<ng-container *ngIf="cartdto.length==0">
<div class="banner1">
<br>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img src="http://www.shitalexports.com/img/empty-cart.jpg" style="width:40%">
</div>
<br><br><br><br><br><br><br><br><br>
</ng-container>
</div>
</html>

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

@ -0,0 +1,25 @@
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();
});
});

139
FrontEnd/src/app/components/cart/cart.component.ts

@ -0,0 +1,139 @@
import { Component, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { Cartdto } from 'src/app/model/Cartdto';
import { CartItem } from 'src/app/model/CartItem';
import { Orderdto } from 'src/app/model/Orderdto';
import { CartService } from 'src/app/service/cart.service';
declare const calc:any
@Component({
selector: 'app-cart',
templateUrl: './cart.component.html',
styleUrls: ['./cart.component.css']
})
export class CartComponent implements OnInit {
public products : any = [];
cartItem!:CartItem[];
cartdto!:Cartdto[];
orderdto!:Orderdto[];
cartdto2!:Cartdto[];
uid!:any;
pid!:any;
cid!:any;
oid!:any;
role!:any;
public grandTotal : number = 0;
public grandTotal1 : any;
qty!:any;
qty1!:any;
cartForm!:FormGroup
constructor(private cartService:CartService) {
}
ngOnInit(): void {
this.cartService.getProducts().subscribe(res=>{
this.products = res;
this.grandTotal = this.cartService.getTotalPrice();
})
this.role = window.sessionStorage.getItem('role');
console.log(this.role);
this.uid = window.sessionStorage.getItem('userid');
this.cartService.getCartdto(this.uid).subscribe(res=>{
this.cartdto=res;
})
this.uid = window.sessionStorage.getItem('userid');
this.cartService.getCartsum(this.uid).subscribe(res=>{
this.grandTotal1=res;
})
}
removeItem(cid:number)
{
this.cartService.deleteCartItem(cid).subscribe(data => {
this.cartdto.forEach((i, index) => {
if (i.cid == cid) {
this.cartdto.splice(index, 1);
this.cartService.getCartsum(this.uid).subscribe(res=>{
this.grandTotal1=res;
})
}
})
}, (err: any) => {
console.log(err);
})
this.cartService.deleteOrderItem(cid).subscribe(data => {
this.cartdto.forEach((i, index) => {
if (i.cid == cid) {
this.cartdto.splice(index, 1);
}
})
}, (err: any) => {
console.log(err);
})
}
inc(prod:any,ccid:number){
prod.quantity = prod.quantity + 1;
this.qty = prod.quantity
this.cid=ccid;
console.log(this.qty,this.cid);
this.cartService.addquantity(this.cid,this.qty).subscribe(data=>{
this.qty1=data;
console.log(this.qty1);
this.uid = window.sessionStorage.getItem('userid');
this.cartService.getCartsum(this.uid).subscribe(res=>{
this.grandTotal1=res;
})
})
}
dec(prod:any,ccid:number){
if(prod.quantity != 1)
{
prod.quantity = prod.quantity - 1;
this.qty = prod.quantity
this.cid=ccid;
console.log(this.qty,this.cid);
this.cartService.addquantity(this.cid,this.qty).subscribe(data=>{
this.qty1=data;
console.log(this.qty1);
this.uid = window.sessionStorage.getItem('userid');
this.cartService.getCartsum(this.uid).subscribe(res=>{
this.grandTotal1=res;
})
})
}
}
addquantity(id:number,quantity:number)
{
this.qty = quantity
this.cid=id;
console.log(this.qty,this.cid);
this.cartService.addquantity(this.cid,this.qty).subscribe(data=>{
this.qty=data;
console.log(this.qty);
})
}
getMultiply(price:number, quantity:number)
{
return price * quantity;
}
}

0
FrontEnd/src/app/components/category/category.component.css

1
FrontEnd/src/app/components/category/category.component.html

@ -0,0 +1 @@
<p>category works!</p>

25
FrontEnd/src/app/components/category/category.component.spec.ts

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

15
FrontEnd/src/app/components/category/category.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-category',
templateUrl: './category.component.html',
styleUrls: ['./category.component.css']
})
export class CategoryComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

0
FrontEnd/src/app/components/dairy/dairy.component.css

170
FrontEnd/src/app/components/dairy/dairy.component.html

@ -0,0 +1,170 @@
<style>
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
width: 250px;
margin: auto;
text-align: center;
font-family: arial;
}
.price {
color: grey;
font-size: 22px;
}
.card button {
border: none;
outline: 0;
padding: 12px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
font-size: 18px;
}
.card button:hover {
opacity: 0.7;
}
*{
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
/* Float four columns side by side */
.column {
float: left;
width: 25%;
padding: 0 10px;
}
/* Remove extra left and right margins, due to padding in columns */
.row {margin: 0 -5px;}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Style the counter cards */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); /* this adds the "card" effect */
padding: 16px;
text-align: center;
background-color: #f1f1f1;
}
/* Responsive columns - one column layout (vertical) on small screens */
@media screen and (max-width: 600px) {
.column {
width: 100%;
display: block;
margin-bottom: 20px;
}
}
.grid-container {
display: grid;
grid-template-columns: auto auto auto;
width: 100%;
}
.grid-item{
display: table-cell;
padding: 15px;
}
.topnav {
background-color: #333;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: center;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
background-color: #04AA6D;
color: white;
}
.banner {
/* The image used */
background-image:
url(1.jpg);
background-position: center;
background-size: cover;
}
</style>
<!DOCTYPE html>
<html lang="en">
<body>
<div class="banner">
<div class="menu1" >
<ul>
<li><a href="products/fruits">FRUITS</a></li>
<li><a href="products/household">HOUSEHOLD</a></li>
<li><a href="products/dairy">DAIRY</a></li>
<li><a href="products/wholegrain">WHOLEGRAIN</a></li>
<li><a href="products/snacks">SNACKS</a></li>
</ul>
</div>
<div class="grid-container" >
<div class="grid-item"*ngFor="let i of products">
<div class="card">
<img src={{i.image}} style="width:80%">
<h2 style="color:black">{{ i.name }}</h2>
<p class="price">Rs. {{ i.price }}</p>
<p><button>Add to Cart</button></p>
</div>
</div>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>
</body>
</html>

25
FrontEnd/src/app/components/dairy/dairy.component.spec.ts

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

27
FrontEnd/src/app/components/dairy/dairy.component.ts

@ -0,0 +1,27 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Products } from 'src/app/model/Products';
import { ProductsService } from 'src/app/service/products.service';
@Component({
selector: 'app-dairy',
templateUrl: './dairy.component.html',
styleUrls: ['./dairy.component.css']
})
export class DairyComponent implements OnInit {
products:Products[];
name:string;
constructor(private productsService:ProductsService, private route:Router) {
this.products=[];
this.name='Dairy';
}
ngOnInit(): void {
this.productsService.getProductsByCategory(this.name).subscribe(data=>{
this.products=data;
})
}
}

0
FrontEnd/src/app/components/fruits/fruits.component.css

171
FrontEnd/src/app/components/fruits/fruits.component.html

@ -0,0 +1,171 @@
<style>
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
width: 250px;
margin: auto;
text-align: center;
font-family: arial;
}
.price {
color: grey;
font-size: 22px;
}
.card button {
border: none;
outline: 0;
padding: 12px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
font-size: 18px;
}
.card button:hover {
opacity: 0.7;
}
*{
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
/* Float four columns side by side */
.column {
float: left;
width: 25%;
padding: 0 10px;
}
/* Remove extra left and right margins, due to padding in columns */
.row {margin: 0 -5px;}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Style the counter cards */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); /* this adds the "card" effect */
padding: 16px;
text-align: center;
background-color: #f1f1f1;
}
/* Responsive columns - one column layout (vertical) on small screens */
@media screen and (max-width: 600px) {
.column {
width: 100%;
display: block;
margin-bottom: 20px;
}
}
.grid-container {
display: grid;
grid-template-columns: auto auto auto;
width: 100%;
}
.grid-item{
display: table-cell;
padding: 15px;
}
.topnav {
background-color: #333;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: center;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
background-color: #04AA6D;
color: white;
}
.banner {
/* The image used */
background-image:
url(1.jpg);
background-position: center;
background-size: cover;
}
</style>
<!DOCTYPE html>
<html lang="en">
<body>
<div class="banner">
<div class="menu1" >
<ul>
<li><a href="products/fruits">FRUITS</a></li>
<li><a href="products/household">HOUSEHOLD</a></li>
<li><a href="products/dairy">DAIRY</a></li>
<li><a href="products/wholegrain">WHOLEGRAIN</a></li>
<li><a href="products/snacks">SNACKS</a></li>
</ul>
</div>
<div class="grid-container" >
<div class="grid-item"*ngFor="let i of products">
<div class="card">
<img src={{i.image}} style="width:80%">
<h2 style="color:black">{{ i.name }}</h2>
<p class="price">Rs. {{ i.price }}</p>
<p><button>Add to Cart</button></p>
</div>
</div>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>
</body>
</html>

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

@ -0,0 +1,25 @@
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();
});
});

27
FrontEnd/src/app/components/fruits/fruits.component.ts

@ -0,0 +1,27 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Products } from 'src/app/model/Products';
import { ProductsService } from 'src/app/service/products.service';
@Component({
selector: 'app-fruits',
templateUrl: './fruits.component.html',
styleUrls: ['./fruits.component.css']
})
export class FruitsComponent implements OnInit {
products:Products[];
name:string;
constructor(private productsService:ProductsService, private route:Router) {
this.products=[];
this.name='Fruits & Veggies';
}
ngOnInit(): void {
this.productsService.getProductsByCategory(this.name).subscribe(data=>{
this.products=data;
})
}
}

0
FrontEnd/src/app/components/household/household.component.css

170
FrontEnd/src/app/components/household/household.component.html

@ -0,0 +1,170 @@
<style>
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
width: 250px;
margin: auto;
text-align: center;
font-family: arial;
}
.price {
color: grey;
font-size: 22px;
}
.card button {
border: none;
outline: 0;
padding: 12px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
font-size: 18px;
}
.card button:hover {
opacity: 0.7;
}
*{
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
/* Float four columns side by side */
.column {
float: left;
width: 25%;
padding: 0 10px;
}
/* Remove extra left and right margins, due to padding in columns */
.row {margin: 0 -5px;}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Style the counter cards */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); /* this adds the "card" effect */
padding: 16px;
text-align: center;
background-color: #f1f1f1;
}
/* Responsive columns - one column layout (vertical) on small screens */
@media screen and (max-width: 600px) {
.column {
width: 100%;
display: block;
margin-bottom: 20px;
}
}
.grid-container {
display: grid;
grid-template-columns: auto auto auto;
width: 100%;
}
.grid-item{
display: table-cell;
padding: 15px;
}
.topnav {
background-color: #333;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: center;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
background-color: #04AA6D;
color: white;
}
.banner {
/* The image used */
background-image:
url(1.jpg);
background-position: center;
background-size: cover;
}
</style>
<!DOCTYPE html>
<html lang="en">
<body>
<div class="banner">
<div class="menu1" >
<ul>
<li><a href="products/fruits">FRUITS</a></li>
<li><a href="products/household">HOUSEHOLD</a></li>
<li><a href="products/dairy">DAIRY</a></li>
<li><a href="products/wholegrain">WHOLEGRAIN</a></li>
<li><a href="products/snacks">SNACKS</a></li>
</ul>
</div>
<div class="grid-container" >
<div class="grid-item"*ngFor="let i of products">
<div class="card">
<img src={{i.image}} style="width:80%">
<h2 style="color:black">{{ i.name }}</h2>
<p class="price">Rs. {{ i.price }}</p>
<p><button>Add to Cart</button></p>
</div>
</div>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>
</body>
</html>

25
FrontEnd/src/app/components/household/household.component.spec.ts

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

26
FrontEnd/src/app/components/household/household.component.ts

@ -0,0 +1,26 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Products } from 'src/app/model/Products';
import { ProductsService } from 'src/app/service/products.service';
@Component({
selector: 'app-household',
templateUrl: './household.component.html',
styleUrls: ['./household.component.css']
})
export class HouseholdComponent implements OnInit {
products:Products[];
name:string;
constructor(private productsService:ProductsService, private route:Router) {
this.products=[];
this.name='Household';
}
ngOnInit(): void {
this.productsService.getProductsByCategory(this.name).subscribe(data=>{
this.products=data;
})
}
}

0
FrontEnd/src/app/components/order/order.component.css

273
FrontEnd/src/app/components/order/order.component.html

@ -0,0 +1,273 @@
<style>
*{
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
body{
font-family: Helvetica;
-webkit-font-smoothing: antialiased;
background: rgba( 71, 147, 227, 1);
}
h2{
text-align: center;
font-size: 18px;
text-transform: uppercase;
letter-spacing: 1px;
color: white;
padding: 30px 0;
}
/* Table Styles */
.table-wrapper{
margin: 20px 200px 70px;
box-shadow: 0px 35px 50px rgba( 0, 0, 0, 0.2 );
}
.fl-table {
border-radius: 5px;
font-size: 16px;
font-weight: normal;
border: none;
border-collapse: collapse;
width: 100%;
max-width: 100%;
white-space: nowrap;
background-color: white;
}
.fl-table td, .fl-table th {
text-align: center;
padding: 8px;
}
.fl-table td {
border-right: 1px solid #f8f8f8;
font-size: 12px;
}
.fl-table thead th {
color: #ffffff;
background: #4FC3A1;
}
.fl-table thead th:nth-child(odd) {
color: #ffffff;
background: #324960;
}
.fl-table tr:nth-child(even) {
background: #F8F8F8;
}
/* Responsive */
@media (max-width: 767px) {
.fl-table {
display: block;
width: 100%;
}
.table-wrapper:before{
content: "Scroll horizontally >";
display: block;
text-align: right;
font-size: 11px;
color: white;
padding: 0 0 10px;
}
.fl-table thead, .fl-table tbody, .fl-table thead th {
display: block;
}
.fl-table thead th:last-child{
border-bottom: none;
}
.fl-table thead {
float: left;
}
.fl-table tbody {
position: relative;
overflow-x: auto;
}
.fl-table td, .fl-table th {
padding: 20px .625em .625em .625em;
height: 60px;
vertical-align: middle;
box-sizing: border-box;
overflow-x: hidden;
overflow-y: auto;
width: 120px;
font-size: 16px;
text-overflow: ellipsis;
}
.fl-table thead th {
text-align: left;
border-bottom: 1px solid #f7f7f9;
}
.fl-table tbody tr {
display: table-cell;
}
.fl-table tbody tr:nth-child(odd) {
background: none;
}
.fl-table tr:nth-child(even) {
background: transparent;
}
.fl-table tr td:nth-child(odd) {
background: #F8F8F8;
border-right: 1px solid #E6E4E4;
}
.fl-table tr td:nth-child(even) {
border-right: 1px solid #E6E4E4;
}
.fl-table tbody td {
display: block;
text-align: center;
}
}
.banner {
/* The image used */
background-image:
url(1.jpg);
background-position: center;
background-size: cover;
}
.banner1 {
/* The image used */
background-image:
url(9.png);
background-position: center;
background-size: cover;
}
.quantity {
display: flex;
justify-content: center;
}
.quantity button {
width: 35px;
height: 35px;
border: 1px solid #000;
color: #000;
border-radius: 0;
background: #fff
}
.quantity input {
border: none;
border-top: 1px solid #000;
border-bottom: 1px solid #000;
text-align: center;
width: 100px;
font-size: 20px;
color: #000;
font-weight: 300;
}
.total-price {
text-align: center;
font-size: 30px;
color: black;
}
.total-price .fa-rupee {
display: inline-block;
font-size: 90%;
margin-right: 5px;
}
@import url('https://fonts.googleapis.com/css?family=Lato:400,700,900|Open+Sans:300,400|Oswald:400,700');
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: 'Lato', sans-serif;
font-weight: normal;
}
.item {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.btn-pay {
background-color: #C800Da;
border: 0;
color: #fff;
font-weight: 600;
}
.fa-ticket {
color: #0e1fa1;
}
h1 {
text-align: center;
}
</style>
<div class="banner">
<br><br><br><br><br><br><br>
<ng-container *ngIf="orderdto.length!=0">
<h1>Congratulations your Order is Placed!</h1>
<div class="table-wrapper">
<table class="fl-table">
<tr *ngFor="let i of orderdto; let in=index">
<th>ORDER NO : {{i.orderNumber}}</th>
<th></th>
<th><img src="{{i.image}}" style="width:80px"><br>{{i.pname}} @ ₹ {{i.price}}<br></th>
<th>X</th>
<th>{{i.quantity}} QTY</th>
<th>₹ {{i.totalPrice}}</th>
<th></th>
</tr>
<tr>
<th></th>
</tr>
<tr>
<th></th>
<th>{{orderdto.length}} ITEMS</th>
<th></th>
<th></th>
<th></th>
<th><strong text-align="right">PAYABLE AMOUNT : ₹ {{grandTotal}} <br><br> MODE : CASH ON DELIVERY <br><br>STATUS : DELIVERY BY TOMORROW</strong></th>
<th></th>
</tr>
<tr>
<th></th>
</tr>
</table>
</div>
<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>
</ng-container>
<ng-container *ngIf="orderdto.length==0">
<div class="banner1">
<br>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img src="https://i.pinimg.com/originals/ff/3d/66/ff3d66d438ddff2c520db4d26fce8760.jpg" style="width:40%">
</div>
<br><br><br><br><br><br><br><br><br>
</ng-container>
</div>

25
FrontEnd/src/app/components/order/order.component.spec.ts

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

31
FrontEnd/src/app/components/order/order.component.ts

@ -0,0 +1,31 @@
import { Component, OnInit } from '@angular/core';
import { Orderdto } from 'src/app/model/Orderdto';
import { CartService } from 'src/app/service/cart.service';
declare const calc:any
@Component({
selector: 'app-order',
templateUrl: './order.component.html',
styleUrls: ['./order.component.css']
})
export class OrderComponent implements OnInit {
public products : any = [];
orderdto!:Orderdto[];
public grandTotal : any;
uid!:any;
constructor(private cartService:CartService) { }
ngOnInit(): void {
this.uid = window.sessionStorage.getItem('userid');
this.cartService.getOrder(this.uid).subscribe(res=>{
this.orderdto = res;
})
this.cartService.getordersumByUid(this.uid).subscribe(data=>{
this.grandTotal=data;
})
}
}

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

Loading…
Cancel
Save