Compare commits

...

No commits in common. 'master' and 'gauravMain' have entirely different histories.

100 changed files with 291 additions and 13722 deletions
Split View
  1. 0
      .gitignore
  2. 0
      .mvn/wrapper/MavenWrapperDownloader.java
  3. 0
      .mvn/wrapper/maven-wrapper.jar
  4. 0
      .mvn/wrapper/maven-wrapper.properties
  5. 17
      Angular-UrbanBazaar/.browserslistrc
  6. 16
      Angular-UrbanBazaar/.editorconfig
  7. 45
      Angular-UrbanBazaar/.gitignore
  8. 27
      Angular-UrbanBazaar/README.md
  9. 106
      Angular-UrbanBazaar/angular.json
  10. 44
      Angular-UrbanBazaar/karma.conf.js
  11. 12122
      Angular-UrbanBazaar/package-lock.json
  12. 39
      Angular-UrbanBazaar/package.json
  13. 15
      Angular-UrbanBazaar/src/app/app-routing.module.ts
  14. 0
      Angular-UrbanBazaar/src/app/app.component.css
  15. 3
      Angular-UrbanBazaar/src/app/app.component.html
  16. 35
      Angular-UrbanBazaar/src/app/app.component.spec.ts
  17. 10
      Angular-UrbanBazaar/src/app/app.component.ts
  18. 30
      Angular-UrbanBazaar/src/app/app.module.ts
  19. 99
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.css
  20. 72
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.html
  21. 25
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.spec.ts
  22. 15
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.ts
  23. 0
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.css
  24. 1
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.html
  25. 25
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.spec.ts
  26. 15
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.ts
  27. 22
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.css
  28. 36
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.html
  29. 25
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.spec.ts
  30. 39
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.ts
  31. 0
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.css
  32. 1
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.html
  33. 25
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.spec.ts
  34. 15
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.ts
  35. 3
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.css
  36. 29
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.html
  37. 25
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.spec.ts
  38. 22
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.ts
  39. 7
      Angular-UrbanBazaar/src/app/models/member-user.spec.ts
  40. 10
      Angular-UrbanBazaar/src/app/models/member-user.ts
  41. 7
      Angular-UrbanBazaar/src/app/models/orders.spec.ts
  42. 21
      Angular-UrbanBazaar/src/app/models/orders.ts
  43. 7
      Angular-UrbanBazaar/src/app/models/product-category.spec.ts
  44. 7
      Angular-UrbanBazaar/src/app/models/product-category.ts
  45. 7
      Angular-UrbanBazaar/src/app/models/product.spec.ts
  46. 13
      Angular-UrbanBazaar/src/app/models/product.ts
  47. 7
      Angular-UrbanBazaar/src/app/models/user.spec.ts
  48. 15
      Angular-UrbanBazaar/src/app/models/user.ts
  49. 16
      Angular-UrbanBazaar/src/app/services/member-user.service.spec.ts
  50. 23
      Angular-UrbanBazaar/src/app/services/member-user.service.ts
  51. 16
      Angular-UrbanBazaar/src/app/services/orders.service.spec.ts
  52. 27
      Angular-UrbanBazaar/src/app/services/orders.service.ts
  53. 16
      Angular-UrbanBazaar/src/app/services/product-category.service.spec.ts
  54. 18
      Angular-UrbanBazaar/src/app/services/product-category.service.ts
  55. 16
      Angular-UrbanBazaar/src/app/services/product.service.spec.ts
  56. 22
      Angular-UrbanBazaar/src/app/services/product.service.ts
  57. 16
      Angular-UrbanBazaar/src/app/services/user.service.spec.ts
  58. 27
      Angular-UrbanBazaar/src/app/services/user.service.ts
  59. 0
      Angular-UrbanBazaar/src/assets/.gitkeep
  60. 3
      Angular-UrbanBazaar/src/environments/environment.prod.ts
  61. 16
      Angular-UrbanBazaar/src/environments/environment.ts
  62. BIN
      Angular-UrbanBazaar/src/favicon.ico
  63. 14
      Angular-UrbanBazaar/src/index.html
  64. 12
      Angular-UrbanBazaar/src/main.ts
  65. 65
      Angular-UrbanBazaar/src/polyfills.ts
  66. 1
      Angular-UrbanBazaar/src/styles.css
  67. 25
      Angular-UrbanBazaar/src/test.ts
  68. 15
      Angular-UrbanBazaar/tsconfig.app.json
  69. 31
      Angular-UrbanBazaar/tsconfig.json
  70. 18
      Angular-UrbanBazaar/tsconfig.spec.json
  71. 1
      README.md
  72. 35
      UrbanBazaar/src/main/java/com/example/urbanbazaar/Controller/UserController.java
  73. 11
      UrbanBazaar/src/main/java/com/example/urbanbazaar/Repository/UserRepository.java
  74. 8
      UrbanBazaar/src/main/resources/application.properties
  75. 156
      grocery_db_tables.sql
  76. 0
      mvnw
  77. 0
      mvnw.cmd
  78. 0
      pom.xml
  79. 39
      src/main/java/com/example/urbanbazaar/Controller/CartController.java
  80. 0
      src/main/java/com/example/urbanbazaar/Controller/MemberUserController.java
  81. 20
      src/main/java/com/example/urbanbazaar/Controller/OrderController.java
  82. 0
      src/main/java/com/example/urbanbazaar/Controller/ProductCategoryController.java
  83. 0
      src/main/java/com/example/urbanbazaar/Controller/ProductController.java
  84. 94
      src/main/java/com/example/urbanbazaar/Controller/UserController.java
  85. 103
      src/main/java/com/example/urbanbazaar/Model/Cart.java
  86. 0
      src/main/java/com/example/urbanbazaar/Model/MemberUser.java
  87. 0
      src/main/java/com/example/urbanbazaar/Model/Orders.java
  88. 0
      src/main/java/com/example/urbanbazaar/Model/Product.java
  89. 0
      src/main/java/com/example/urbanbazaar/Model/ProductCategory.java
  90. 0
      src/main/java/com/example/urbanbazaar/Model/User.java
  91. 9
      src/main/java/com/example/urbanbazaar/Repository/CartRepository.java
  92. 0
      src/main/java/com/example/urbanbazaar/Repository/MemberUserRepository.java
  93. 0
      src/main/java/com/example/urbanbazaar/Repository/OrderRepository.java
  94. 0
      src/main/java/com/example/urbanbazaar/Repository/ProductCategoryRepository.java
  95. 0
      src/main/java/com/example/urbanbazaar/Repository/ProductRepository.java
  96. 28
      src/main/java/com/example/urbanbazaar/Repository/UserRepository.java
  97. 0
      src/main/java/com/example/urbanbazaar/ServletInitializer.java
  98. 0
      src/main/java/com/example/urbanbazaar/UrbanBazarApplication.java
  99. 8
      src/main/resources/application.properties
  100. 0
      src/test/java/com/example/urbanbazar/UrbanBazarApplicationTests.java

UrbanBazaar/.gitignore → .gitignore

UrbanBazaar/.mvn/wrapper/MavenWrapperDownloader.java → .mvn/wrapper/MavenWrapperDownloader.java

UrbanBazaar/.mvn/wrapper/maven-wrapper.jar → .mvn/wrapper/maven-wrapper.jar

UrbanBazaar/.mvn/wrapper/maven-wrapper.properties → .mvn/wrapper/maven-wrapper.properties

17
Angular-UrbanBazaar/.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-UrbanBazaar/.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-UrbanBazaar/.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-UrbanBazaar/README.md

@ -1,27 +0,0 @@
# AngularUrbanBazaar
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-UrbanBazaar/angular.json

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

44
Angular-UrbanBazaar/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/Angular-UrbanBazaar'),
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-UrbanBazaar/package-lock.json
File diff suppressed because it is too large
View File

39
Angular-UrbanBazaar/package.json

@ -1,39 +0,0 @@
{
"name": "angular-urban-bazaar",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"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"
}
}

15
Angular-UrbanBazaar/src/app/app-routing.module.ts

@ -1,15 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { UserProfileDetailsComponent } from './components/user-profile-details/user-profile-details.component';
import { UserShowComponent } from './components/user-show/user-show.component';
const routes: Routes = [
{path:'showAllUsers', component: UserShowComponent},
{path:'profile', component: UserProfileDetailsComponent},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

0
Angular-UrbanBazaar/src/app/app.component.css

3
Angular-UrbanBazaar/src/app/app.component.html

@ -1,3 +0,0 @@
<app-page-nav-bar></app-page-nav-bar>
<router-outlet></router-outlet>

35
Angular-UrbanBazaar/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 'Angular-UrbanBazaar'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('Angular-UrbanBazaar');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;
expect(compiled.querySelector('.content span').textContent).toContain('Angular-UrbanBazaar app is running!');
});
});

10
Angular-UrbanBazaar/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 {
title = 'Angular-UrbanBazaar';
}

30
Angular-UrbanBazaar/src/app/app.module.ts

@ -1,30 +0,0 @@
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HttpClientModule } from '@angular/common/http';
import { UserShowComponent } from './components/user-show/user-show.component';
import { UserAddComponent } from './components/user-add/user-add.component';
import { UserProfileDetailsComponent } from './components/user-profile-details/user-profile-details.component';
import { PageNavBarComponent } from './components/page-nav-bar/page-nav-bar.component';
@NgModule({
declarations: [
AppComponent,
UserShowComponent,
UserAddComponent,
UserProfileDetailsComponent,
PageNavBarComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
HttpClientModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

99
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.css

@ -1,99 +0,0 @@
@import url("//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css");
.navbar-icon-top .navbar-nav .nav-link > .fa {
position: relative;
width: 36px;
font-size: 24px;
}
.navbar-icon-top .navbar-nav .nav-link > .fa > .badge {
font-size: 0.75rem;
position: absolute;
right: 0;
font-family: sans-serif;
}
.navbar-icon-top .navbar-nav .nav-link > .fa {
top: 3px;
line-height: 12px;
}
.navbar-icon-top .navbar-nav .nav-link > .fa > .badge {
top: -10px;
}
@media (min-width: 576px) {
.navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}
.navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}
.navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}
@media (min-width: 768px) {
.navbar-icon-top.navbar-expand-md .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}
.navbar-icon-top.navbar-expand-md .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}
.navbar-icon-top.navbar-expand-md .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}
@media (min-width: 992px) {
.navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}
.navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}
.navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}
@media (min-width: 1200px) {
.navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}
.navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}
.navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}

72
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.html

@ -1,72 +0,0 @@
<p>page-nav-bar works!</p>
<nav class="navbar navbar-icon-top navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">
<i class="fa fa-home"></i>
Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fa fa-envelope-o">
<span class="badge badge-danger">11</span>
</i>
Link
</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">
<i class="fa fa-envelope-o">
<span class="badge badge-warning">11</span>
</i>
Disabled
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-envelope-o">
<span class="badge badge-primary">11</span>
</i>
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
</ul>
<ul class="navbar-nav ">
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fa fa-bell">
<span class="badge badge-info">11</span>
</i>
Test
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fa fa-globe">
<span class="badge badge-success">11</span>
</i>
Test
</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>

25
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.spec.ts

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

15
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.ts

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

0
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.css

1
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.html

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

25
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.spec.ts

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

15
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.ts

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

22
Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.css

@ -1,22 +0,0 @@
body {
padding-left: 10px;
color: #212121;
}
div {
padding: 24px 32px 0;
box-sizing: border-box;
margin: 0;
}
._3E8aIl {
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 4px 0 rgba(0,0,0,.08);
}
._3X2gOt {
vertical-align: middle;
width: 50px;
height: 50px;
}

36
Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.html

@ -1,36 +0,0 @@
<p>user-profile-details works!</p>
<body>
<div>
<p>
Personal Information
<button class="btn" (click)="editUserName()">Edit</button> <br>
<input name="firstName" value="{{user.userfirstname}}" disabled=""> &nbsp;
<input name="lastName" value="{{user.userlastname}}" disabled="">
</p>
<p>
Email Address
<button class="btn" (click)="editEmail()">Edit</button>
<button class="btn" (click)="editPassword()">Change Password</button> <br>
<input name="firstName" value="{{user.useremail}}" disabled="">
</p>
<p>
Mobile Number
<button class="btn" (click)="editPhone()">Edit</button> <br>
<input type="number" name="firstName" value="{{user.userphone}}" disabled="">
</p>
<br>
<h4>FAQs</h4>
<b>What happens when I update my email address (or mobile number)?</b> <br>
Your login email id (or mobile number) changes, likewise. You'll receive all your account related communication on your updated email address (or mobile number). <br><br>
<b>When will my UrbanBazaar account be updated with the new email address (or mobile number)?</b> <br>
It happens as soon as you confirm the verification code sent to your email (or mobile) and save the changes. <br><br>
<b>What happens to my existing UrbanBazaar account when I update my email address (or mobile number)?</b> <br>
Updating your email address (or mobile number) doesn't invalidate your account. Your account remains fully functional.
You'll continue seeing your Order history, saved information and personal details. <br><br>
<b>Does my Seller account get affected when I update my email address?</b> <br>
UrbanBazaar has a 'single sign-on' policy.
Any changes will reflect in your Seller account also.
</div>
<br><br><br>
</body>

25
Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.spec.ts

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

39
Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.ts

@ -1,39 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { User } from 'src/app/models/user';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-user-profile-details',
templateUrl: './user-profile-details.component.html',
styleUrls: ['./user-profile-details.component.css']
})
export class UserProfileDetailsComponent implements OnInit {
currentUser : Observable<User>;
user : User;
constructor(private _userService : UserService) {
this.currentUser = this._userService.searchUser(100);
this.currentUser.subscribe((user: User)=> this.user = user);
}
public editUserName() {
alert("editUserName pressed !");
}
public editEmail() {
alert("editEmail pressed !");
}
public editPassword() {
alert("editPassword pressed !");
}
public editPhone() {
alert("editPhone pressed !");
}
ngOnInit(): void {
}
}

0
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.css

1
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.html

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

25
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.spec.ts

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

15
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.ts

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

3
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.css

@ -1,3 +0,0 @@
body {
padding-left: 10px;
}

29
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.html

@ -1,29 +0,0 @@
<p>user-show works!</p>
<body>
<h3>All User Details</h3>
<table class="table table-hover">
<tr>
<th>User Id</th>
<th>User Email</th>
<th>First Name</th>
<th>City</th>
<th>Zipcode</th>
<th>Phone</th>
<th>Address Line 1</th>
<th>Address Line 2</th>
</tr>
<tr *ngFor="let user of userList | async">
<td>{{user.userid}}</td>
<td>{{user.useremail}}</td>
<td>{{user.userfirstname}}</td>
<td>{{user.usercity}}</td>
<td>{{user.userzip}}</td>
<td>{{user.userphone}}</td>
<td>{{user.useraddress}}</td>
<td>{{user.useraddress2}}</td>
</tr>
</table>
</body>

25
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.spec.ts

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

22
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.ts

@ -1,22 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { User } from 'src/app/models/user';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-user-show',
templateUrl: './user-show.component.html',
styleUrls: ['./user-show.component.css']
})
export class UserShowComponent implements OnInit {
userList : Observable<User[]>;
constructor(private _userService : UserService) {
this.userList = this._userService.showAllUsers();
}
ngOnInit(): void {
}
}

7
Angular-UrbanBazaar/src/app/models/member-user.spec.ts

@ -1,7 +0,0 @@
import { MemberUser } from './member-user';
describe('MemberUser', () => {
it('should create an instance', () => {
expect(new MemberUser()).toBeTruthy();
});
});

10
Angular-UrbanBazaar/src/app/models/member-user.ts

@ -1,10 +0,0 @@
export class MemberUser {
public userid : number;
public memberid : number;
public membername : string;
public totalitems : number;
public memberphone : string;
public membertotalamount : number;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/orders.spec.ts

@ -1,7 +0,0 @@
import { Orders } from './orders';
describe('Orders', () => {
it('should create an instance', () => {
expect(new Orders()).toBeTruthy();
});
});

21
Angular-UrbanBazaar/src/app/models/orders.ts

@ -1,21 +0,0 @@
export class Orders {
public orderid : number;
public orderuserid : number;
public orderamount : number;
public ordershipaddress : string;
public ordershipaddress2 : string;
public ordercity : string;
public orderzip : string;
public orderstate : string;
public ordercountry : string;
public orderphone : string;
public ordershippingcost : number;
public ordertax : number;
public orderemail : string;
public orderdate : Date;
public ordershipped : string;
public ordertrackingnumber : string;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/product-category.spec.ts

@ -1,7 +0,0 @@
import { ProductCategory } from './product-category';
describe('ProductCategory', () => {
it('should create an instance', () => {
expect(new ProductCategory()).toBeTruthy();
});
});

7
Angular-UrbanBazaar/src/app/models/product-category.ts

@ -1,7 +0,0 @@
export class ProductCategory {
public categoryid : number;
public categoryname : string;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/product.spec.ts

@ -1,7 +0,0 @@
import { Product } from './product';
describe('Product', () => {
it('should create an instance', () => {
expect(new Product()).toBeTruthy();
});
});

13
Angular-UrbanBazaar/src/app/models/product.ts

@ -1,13 +0,0 @@
export class Product {
public productid : number;
public productname : string;
public productprice : number;
public productweight : number;
public productshortdesc : string;
public productlongdesc : string;
public productimage : string;
public productcategoryid : number;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/user.spec.ts

@ -1,7 +0,0 @@
import { User } from './user';
describe('User', () => {
it('should create an instance', () => {
expect(new User()).toBeTruthy();
});
});

15
Angular-UrbanBazaar/src/app/models/user.ts

@ -1,15 +0,0 @@
export class User {
public userid : number;
public useremail : string;
public userpassword : string;
public userfirstname : string;
public userlastname : string;
public usercity: string;
public userstate : string;
public userzip : string;
public userphone : string;
public useraddress : string;
public useraddress2 : string;
constructor() {}
}

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

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

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

@ -1,23 +0,0 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { MemberUser } from '../models/member-user';
@Injectable({
providedIn: 'root'
})
export class MemberUserService {
private _url : String = "http://localhost:9000";
constructor(private _http : HttpClient) { }
public showMembersByUser(id : number) : Observable<MemberUser[]> {
return this._http.get<MemberUser[]>(this._url+"/showUserMembers/"+id);
}
public addMemberToUser(member : MemberUser) {
this._http.post(this._url+"/addMember", member);
}
}

16
Angular-UrbanBazaar/src/app/services/orders.service.spec.ts

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

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

@ -1,27 +0,0 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Orders } from '../models/orders';
@Injectable({
providedIn: 'root'
})
export class OrdersService {
private _url : String = "http://localhost:9000";
constructor(private _http : HttpClient) { }
public addOrder(order : Orders) {
this._http.post(this._url+"/addOrder", order);
}
public findOrder(id : number) : Observable<Orders> {
return this._http.get<Orders>(this._url+"/findOrder"+id);
}
public findOrdersByUser(id : number) : Observable<Orders[]> {
return this._http.get<Orders[]>(this._url+"/findOrdersByUser"+id);
}
}

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

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

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

@ -1,18 +0,0 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { ProductCategory } from '../models/product-category';
@Injectable({
providedIn: 'root'
})
export class ProductCategoryService {
private _url : String = "http://localhost:9000";
constructor(private _http : HttpClient) { }
public showAllCategory() : Observable<ProductCategory[]> {
return this._http.get<ProductCategory[]>(this._url+"/showProductCategory");
}
}

16
Angular-UrbanBazaar/src/app/services/product.service.spec.ts

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

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

@ -1,22 +0,0 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Product } from '../models/product';
@Injectable({
providedIn: 'root'
})
export class ProductService {
private _url : String = "http://localhost:9000";
constructor(private _http : HttpClient) { }
public showAllProduct() : Observable<Product[]> {
return this._http.get<Product[]>(this._url+"/showAllProducts");
}
public searchProduct(name : string) : Observable<Product[]> {
return this._http.get<Product[]>(this._url+"/searchProduct/"+name);
}
}

16
Angular-UrbanBazaar/src/app/services/user.service.spec.ts

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

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

@ -1,27 +0,0 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { User } from '../models/user';
@Injectable({
providedIn: 'root'
})
export class UserService {
private _url : String = "http://localhost:9000";
constructor(private _http : HttpClient) { }
public showAllUsers() : Observable<User[]> {
return this._http.get<User[]>(this._url + "/showAllUsers");
}
public searchUser(id : number) : Observable<User> {
return this._http.get<User>(this._url+"/findUserById/"+id);
}
public addUser(user : User) {
this._http.post(this._url+"/addUser", user);
}
}

0
Angular-UrbanBazaar/src/assets/.gitkeep

3
Angular-UrbanBazaar/src/environments/environment.prod.ts

@ -1,3 +0,0 @@
export const environment = {
production: true
};

16
Angular-UrbanBazaar/src/environments/environment.ts

@ -1,16 +0,0 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false
};
/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

BIN
Angular-UrbanBazaar/src/favicon.ico

Before After
Width: 28  |  Height: 30  |  Size: 948 B

14
Angular-UrbanBazaar/src/index.html

@ -1,14 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularUrbanBazaar</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<app-root></app-root>
</body>
</html>

12
Angular-UrbanBazaar/src/main.ts

@ -1,12 +0,0 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

65
Angular-UrbanBazaar/src/polyfills.ts

@ -1,65 +0,0 @@
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/**
* IE11 requires the following for NgClass support on SVG elements
*/
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/

1
Angular-UrbanBazaar/src/styles.css

@ -1 +0,0 @@
/* You can add global styles to this file, and also import other style files */

25
Angular-UrbanBazaar/src/test.ts

@ -1,25 +0,0 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

15
Angular-UrbanBazaar/tsconfig.app.json

@ -1,15 +0,0 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}

31
Angular-UrbanBazaar/tsconfig.json

@ -1,31 +0,0 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictNullChecks": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}

18
Angular-UrbanBazaar/tsconfig.spec.json

@ -1,18 +0,0 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}

1
README.md

@ -1 +0,0 @@
UrbanBazaar - Online Grocery Store

35
UrbanBazaar/src/main/java/com/example/urbanbazaar/Controller/UserController.java

@ -1,35 +0,0 @@
package com.example.urbanbazaar.Controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.example.urbanbazaar.Model.User;
import com.example.urbanbazaar.Repository.UserRepository;
@RestController
public class UserController {
@Autowired
private UserRepository repo;
@PostMapping("/addUser")
public void addUser(@RequestBody User user) {
repo.save(user);
}
@GetMapping("/showAllUsers")
public List<User> showUsers() {
return repo.findAll();
}
@GetMapping("/findUserById/{userId}")
public User findUserById(@PathVariable int userId) {
return repo.findById(userId).get();
}
}

11
UrbanBazaar/src/main/java/com/example/urbanbazaar/Repository/UserRepository.java

@ -1,11 +0,0 @@
package com.example.urbanbazaar.Repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.example.urbanbazaar.Model.User;
public interface UserRepository extends JpaRepository<User, Integer> {
}

8
UrbanBazaar/src/main/resources/application.properties

@ -1,8 +0,0 @@
server.port=9000
spring.jpa.hibernate.ddl-auto=none
spring.datasource.url=jdbc:mysql://localhost:3306/grocery_db
spring.datasource.username=root
spring.datasource.password=Password123
spring.jackson.serialization.INDENT_OUTPUT=true

156
grocery_db_tables.sql

@ -1,156 +0,0 @@
drop database if exists grocery_db;
create database grocery_db;
use grocery_db;
-- Users Table Schema
CREATE TABLE `users` (
`UserID` int(11) NOT NULL AUTO_INCREMENT,
`UserFirstName` varchar(50) DEFAULT NULL,
`UserLastName` varchar(50) DEFAULT NULL,
`UserEmail` varchar(50) DEFAULT NULL,
`UserPassword` varchar(50) DEFAULT NULL,
`UserCity` varchar(50) DEFAULT NULL,
`UserState` varchar(20) DEFAULT NULL,
`UserZip` varchar(12) DEFAULT NULL,
`UserPhone` varchar(20) DEFAULT NULL,
`UserAddress` varchar(100) DEFAULT NULL,
`UserAddress2` varchar(50) DEFAULT NULL,
PRIMARY KEY (`UserID`)
);
ALTER TABLE users AUTO_INCREMENT = 100;
insert into users values(
100, "Rajesh", "Kumar",
"shawn@mail.com", "shawn@mail.com",
"Chennai", "Tamil Nadu", "600040",
"5000500050", "Block B, Abirami Apartments",
"Anna Nagar"
);
insert into users values(
101, "Vignesh", "Shivan",
"vignesh@mail.com", "vignesh@mail.com",
"Chennai", "Tamil Nadu", "600030",
"5000500060", "Block A, Harmony Melody",
"Shenoy Nagar"
);
select * from users;
-- Product-Categories Table Schema
CREATE TABLE IF NOT EXISTS `productcategories` (
`CategoryID` int(11) NOT NULL AUTO_INCREMENT,
`CategoryName` varchar(50) NOT NULL,
PRIMARY KEY (`CategoryID`)
);
INSERT INTO `productcategories` (`CategoryID`, `CategoryName`) VALUES
(1, 'Snacks'),
(2, 'Vegetables'),
(3, 'Fruits'),
(4, 'Beverages'),
(5, 'Bakery Products'),
(6, 'Fist-Meat');
select * from productcategories;
-- Product Table Schema
create table Product(
`ProductID` int(12) NOT NULL AUTO_INCREMENT,
`ProductName` varchar(100) NOT NULL,
`ProductPrice` float NOT NULL,
`ProductWeight` float NOT NULL,
`ProductShortDesc` varchar(1000) NOT NULL,
`ProductLongDesc` text NOT NULL,
`ProductImage` varchar(100) NOT NULL,
`ProductCategoryID` int(11) DEFAULT NULL,
PRIMARY KEY (`ProductID`),
FOREIGN KEY (`ProductCategoryID`) REFERENCES productcategories(`CategoryID`)
);
ALTER TABLE Product AUTO_INCREMENT = 1000;
-- Vegetables
insert into product values (1000, "Carrot", 55, 0.5,
"Fresh Carrot - Ooty",
"A popular sweet-tasting root vegetable, Carrots provide the highest content of vitamin A of all the vegetables.",
"https://www.bigbasket.com/media/uploads/p/l/10000271_13-fresho-carrot-ooty.jpg", 2);
insert into product values (1001, "Potato", 30, 1,
"Fresh Potato - Organically Grown",
"Potatoes are nutrient-dense, non-fattening and have reasonable amount of calories. Consumption of potatoes helps to maintain the blood glucose level and keeps the brain alert and active.",
"https://www.bigbasket.com/media/uploads/p/l/10000159_25-fresho-potato.jpg", 2);
insert into product values (1002, "Cauliflower", 60, 0.45,
"Fresh Cauliflower",
"Cauliflower is made up of tightly bound clusters of soft, crumbly, sweet cauliflower florets that form a dense head.",
"https://www.bigbasket.com/media/uploads/p/l/10000074_19-fresho-cauliflower.jpg", 2);
-- Fruits
insert into product values (1003, "Orange", 65, 1,
"Fresh Orange",
"Navel oranges are very sugary and juicy and considered to be the world's finest orange for fresh consumption because they are very sweet, naturally juice, seedless and peels and segments very easily.",
"https://www.bigbasket.com/media/uploads/p/l/20000910_12-fresho-orange-imported.jpg", 3);
insert into product values (1004, "Banana - Yelakki", 70, 1,
"Fresh Banana - Yelakki",
"Yelakki bananas are small size, they are naturally flavoured, aromatic and sweeter compared to regular bananas.",
"https://www.bigbasket.com/media/uploads/p/l/10000031_21-fresho-banana-yelakki.jpg", 3);
-- Snacks
insert into product values (1005, "Britannia Good Day Cashew Cookies", 90, 0.120,
"Britannia Good Day Cashew Cookies",
"Britannia Good Day Cashew Cookies are delicious crunchy cookies made with rich cashews.",
"https://www.bigbasket.com/media/uploads/p/l/40083744_5-britannia-good-day-cashew-cookies.jpg", 1);
insert into product values (1006, "Haldirams Namkeen - Bhujia Sev", 200, 1,
"Haldirams Namkeen - Bhujia Sev",
"Haldirams Bhujia Sev is a authentic namkeen. This classic snack is made with chickpea flour and some spices.",
"https://www.bigbasket.com/media/uploads/p/l/100022552_1-haldirams-namkeen-bhujia-sev.jpg", 1);
-- Fist-Meat
insert into product values (1007, "Eggs - Regular (12)", 76, 0.150,
"Fresh Eggs - Regular, 2x6 pcs Multipack ",
"Fresh Table eggs are hygienically processed and securely filled for keeping these free from any contamination and impurity.",
"https://www.bigbasket.com/media/uploads/p/l/40083744_5-britannia-good-day-cashew-cookies.jpg", 6);
select * from product;
-- Orders Table Schema
CREATE TABLE IF NOT EXISTS `orders` (
`OrderID` int(11) NOT NULL AUTO_INCREMENT,
`OrderUserID` int(11) NOT NULL,
`OrderAmount` float NOT NULL,
`OrderShipAddress` varchar(100) NOT NULL,
`OrderShipAddress2` varchar(100) NOT NULL,
`OrderCity` varchar(50) NOT NULL,
`OrderState` varchar(50) NOT NULL,
`OrderZip` varchar(20) NOT NULL,
`OrderCountry` varchar(50) NOT NULL,
`OrderPhone` varchar(20) NOT NULL,
`OrderShippingCost` float NOT NULL,
`OrderTax` float NOT NULL,
`OrderEmail` varchar(100) NOT NULL,
`OrderDate` date not null,
`OrderShipped` varchar(100) not null,
`OrderTrackingNumber` varchar(80) DEFAULT NULL,
PRIMARY KEY (`OrderID`)
);
insert into orders values(1,1,12.5,'indra nagar','panchshill nagar','bhilai','c.g.','490025','india','7896545210',25.3,56.2,'g@gmail.com','2021-09-10','done','456');
insert into orders values(2,1,12.5,'indra nagar','panchshill nagar','bhilai','c.g.','490025','india','7896545210',25.3,56.2,'g@gmail.com','2021-09-10','done','457');
ALTER TABLE orders AUTO_INCREMENT = 1000;
SELECT * FROM orders;
-- Members Table Schema
create table `members`(
`UserID` int(11) NOT NULL,
`MemberID` int(11) not null,
`MemberName` varchar(20) not null,
`TotalItems` int(3) not null default 0,
`MemberPhone` varchar(15) not null,
`MemberTotalAmount` float not null default 0,
PRIMARY KEY (`MemberID`),
FOREIGN KEY (`UserID`) REFERENCES users(`UserID`)
);
INSERT INTO members VALUES(100, 1, "Abhishek", 0,"1234512345", 0);
INSERT INTO members VALUES(100, 2, "Meera", 5,"12345234567", 1200);
INSERT INTO members VALUES(100, 3, "Shyam", 10,"1234598745", 800);
select * from members;

UrbanBazaar/mvnw → mvnw

UrbanBazaar/mvnw.cmd → mvnw.cmd

UrbanBazaar/pom.xml → pom.xml

39
src/main/java/com/example/urbanbazaar/Controller/CartController.java

@ -0,0 +1,39 @@
package com.example.urbanbazaar.Controller;
import java.util.List;
import com.example.urbanbazaar.Model.Cart;
import com.example.urbanbazaar.Repository.CartRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class CartController {
@Autowired
private CartRepository repo;
@PostMapping("/addCart")
public void addtoCart(@RequestBody Cart cart)
{
repo.save(cart);
}
@DeleteMapping("/deleteCart")
public void deletefromCart(@RequestBody Cart cart)
{
repo.delete(cart);
}
@RequestMapping("/showCart")
public List<Cart>showAll()
{
return repo.findAll();
}
}

UrbanBazaar/src/main/java/com/example/urbanbazaar/Controller/MemberUserController.java → src/main/java/com/example/urbanbazaar/Controller/MemberUserController.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/Controller/OrderController.java → src/main/java/com/example/urbanbazaar/Controller/OrderController.java

@ -49,16 +49,16 @@ public class OrderController {
}
}
@GetMapping("/trackOrder/{trackid}")
public ResponseEntity<Orders> searchOrderByTrackingNumber(@PathVariable String trackid)
{
try {
Orders order = repo.findByTrackId(trackid);
return new ResponseEntity<Orders>(order,HttpStatus.OK);
} catch (NoSuchElementException e) {
return new ResponseEntity<Orders>(HttpStatus.NOT_FOUND);
}
}
// @GetMapping("/trackOrder/{trackid}")
// public ResponseEntity<Orders> searchOrderByTrackingNumber(@PathVariable String trackid)
// {
// try {
// Orders order = repo.findByTrackId(trackid);
// return new ResponseEntity<Orders>(order,HttpStatus.OK);
// } catch (NoSuchElementException e) {
// return new ResponseEntity<Orders>(HttpStatus.NOT_FOUND);
// }
// }
@GetMapping("/showAllOrders")
public List<Orders> showAllOrders()

UrbanBazaar/src/main/java/com/example/urbanbazaar/Controller/ProductCategoryController.java → src/main/java/com/example/urbanbazaar/Controller/ProductCategoryController.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/Controller/ProductController.java → src/main/java/com/example/urbanbazaar/Controller/ProductController.java

94
src/main/java/com/example/urbanbazaar/Controller/UserController.java

@ -0,0 +1,94 @@
package com.example.urbanbazaar.Controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.example.urbanbazaar.Model.User;
import com.example.urbanbazaar.Repository.UserRepository;
@RestController
public class UserController {
@Autowired
private UserRepository repo;
@PostMapping("/addUser")
public void addUser(@RequestBody User user) {
repo.save(user);
}
@GetMapping("/showAllUsers")
public List<User> showUsers() {
return repo.findAll();
}
@GetMapping("/findUserById/{userId}")
public User findUserById(@PathVariable int userId) {
return repo.findById(userId).get();
}
@PutMapping("/{id}/{userfirstname}/{userlastname}")
public void updateName(@PathVariable Integer id, @PathVariable String userfirstname,
@PathVariable String userlastname) {
User user = repo.findById(id).get();
if (user.getUserfirstname() != userfirstname && user.getUserlastname() != userlastname) {
user.setUserfirstname(userfirstname);
user.setUserlastname(userlastname);
repo.save(user);
}
if (user.getUserfirstname() != userfirstname) {
user.setUserfirstname(userfirstname);
repo.save(user);
}
if (user.getUserlastname() != userlastname) {
user.setUserlastname(userlastname);
repo.save(user);
}
}
@PutMapping("/{id}/{email}")
public void updateEmail(@PathVariable String email, @PathVariable Integer id) {
repo.updateEmail(email, id);
}
@PutMapping("/phone/{userphone}/{id}")
public void updatephoneNumber(@PathVariable String userphone, @PathVariable Integer id) {
repo.updatePhoneNumber(userphone, id);
}
@PutMapping("/address/{id}/{useraddress}")
public void updateaddressOne(@PathVariable String useraddress,@PathVariable
Integer id)
{
User user = repo.findById(id).get();
if(user.getUseraddress() !=useraddress)
{
user.setUseraddress(useraddress);
repo.save(user);
}
}
@PutMapping("/address2/{id}/{useraddress2}")
public void updateaddressTwo(@PathVariable String useraddress2,@PathVariable
Integer id)
{
User user = repo.findById(id).get();
if(user.getUseraddress2() !=useraddress2)
{
user.setUseraddress2(useraddress2);;
repo.save(user);
}
}
}

103
src/main/java/com/example/urbanbazaar/Model/Cart.java

@ -0,0 +1,103 @@
package com.example.urbanbazaar.Model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "Cart")
public class Cart {
@Id
@GeneratedValue
private int productid;
private String productname;
private float productprice;
private float productweight;
private String productshortdesc;
private String productlongdesc;
private String productimage;
private int productcategoryid;
public int getProductid() {
return productid;
}
public void setProductid(int productid) {
this.productid = productid;
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname;
}
public float getProductprice() {
return productprice;
}
public void setProductprice(float productprice) {
this.productprice = productprice;
}
public float getProductweight() {
return productweight;
}
public void setProductweight(float productweight) {
this.productweight = productweight;
}
public String getProductshortdesc() {
return productshortdesc;
}
public void setProductshortdesc(String productshortdesc) {
this.productshortdesc = productshortdesc;
}
public String getProductlongdesc() {
return productlongdesc;
}
public void setProductlongdesc(String productlongdesc) {
this.productlongdesc = productlongdesc;
}
public String getProductimage() {
return productimage;
}
public void setProductimage(String productimage) {
this.productimage = productimage;
}
public int getProductcategoryid() {
return productcategoryid;
}
public void setProductcategoryid(int productcategoryid) {
this.productcategoryid = productcategoryid;
}
public Cart(int productid, String productname, float productprice, float productweight, String productshortdesc,
String productlongdesc, String productimage, int productcategoryid) {
this.productid = productid;
this.productname = productname;
this.productprice = productprice;
this.productweight = productweight;
this.productshortdesc = productshortdesc;
this.productlongdesc = productlongdesc;
this.productimage = productimage;
this.productcategoryid = productcategoryid;
}
public Cart() {
}
}

UrbanBazaar/src/main/java/com/example/urbanbazaar/Model/MemberUser.java → src/main/java/com/example/urbanbazaar/Model/MemberUser.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/Model/Orders.java → src/main/java/com/example/urbanbazaar/Model/Orders.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/Model/Product.java → src/main/java/com/example/urbanbazaar/Model/Product.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/Model/ProductCategory.java → src/main/java/com/example/urbanbazaar/Model/ProductCategory.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/Model/User.java → src/main/java/com/example/urbanbazaar/Model/User.java

9
src/main/java/com/example/urbanbazaar/Repository/CartRepository.java

@ -0,0 +1,9 @@
package com.example.urbanbazaar.Repository;
import com.example.urbanbazaar.Model.Cart;
import org.springframework.data.jpa.repository.JpaRepository;
public interface CartRepository extends JpaRepository<Cart,Integer> {
}

UrbanBazaar/src/main/java/com/example/urbanbazaar/Repository/MemberUserRepository.java → src/main/java/com/example/urbanbazaar/Repository/MemberUserRepository.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/Repository/OrderRepository.java → src/main/java/com/example/urbanbazaar/Repository/OrderRepository.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/Repository/ProductCategoryRepository.java → src/main/java/com/example/urbanbazaar/Repository/ProductCategoryRepository.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/Repository/ProductRepository.java → src/main/java/com/example/urbanbazaar/Repository/ProductRepository.java

28
src/main/java/com/example/urbanbazaar/Repository/UserRepository.java

@ -0,0 +1,28 @@
package com.example.urbanbazaar.Repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import javax.transaction.Transactional;
import com.example.urbanbazaar.Model.User;
public interface UserRepository extends JpaRepository<User, Integer> {
@Transactional
@Modifying
@Query(value = "UPDATE User u SET useremail=:email WHERE u.userid=:id")
void updateEmail(@Param("email") String email, @Param("id") int id);
@Transactional
@Modifying
@Query("UPDATE User u SET userphone=:userphone WHERE u.userid=:id")
void updatePhoneNumber(@Param("userphone") String userphone, @Param("id") int id);
}

UrbanBazaar/src/main/java/com/example/urbanbazaar/ServletInitializer.java → src/main/java/com/example/urbanbazaar/ServletInitializer.java

UrbanBazaar/src/main/java/com/example/urbanbazaar/UrbanBazarApplication.java → src/main/java/com/example/urbanbazaar/UrbanBazarApplication.java

8
src/main/resources/application.properties

@ -0,0 +1,8 @@
server.port=9000
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/grocery_db
spring.datasource.username=root
spring.datasource.password=root
spring.jackson.serialization.INDENT_OUTPUT=true

UrbanBazaar/src/test/java/com/example/urbanbazar/UrbanBazarApplicationTests.java → src/test/java/com/example/urbanbazar/UrbanBazarApplicationTests.java

Loading…
Cancel
Save