├── src ├── assets │ ├── .gitkeep │ ├── i18n │ │ └── en.json │ ├── img │ │ ├── bg │ │ │ ├── bg.png │ │ │ ├── bg2.png │ │ │ ├── bg-small.png │ │ │ ├── bg-small2.png │ │ │ ├── bg-small3.png │ │ │ ├── bg-small4.png │ │ │ ├── bg-small5.png │ │ │ └── bg-small6.png │ │ ├── logo.gif │ │ ├── logo.png │ │ ├── metamask.png │ │ ├── posts │ │ │ ├── 1.jpg │ │ │ ├── 2.jpg │ │ │ ├── 3.jpg │ │ │ ├── 4.jpg │ │ │ ├── 5.jpg │ │ │ ├── 6.jpg │ │ │ └── article.jpg │ │ ├── home │ │ │ ├── home.png │ │ │ ├── slide1.jpg │ │ │ ├── slide2.jpg │ │ │ └── slide3.jpg │ │ ├── banner image.png │ │ ├── cover │ │ │ ├── cover1.jpg │ │ │ ├── cover2.jpg │ │ │ ├── cover3.jpg │ │ │ ├── cover4.jpg │ │ │ ├── cover5.jpg │ │ │ ├── cover6.jpg │ │ │ ├── cover7.jpg │ │ │ ├── cover8.jpg │ │ │ ├── slide1.jpg │ │ │ ├── slide2.jpg │ │ │ ├── slide3.jpg │ │ │ └── cover-big.jpg │ │ ├── logo-footer.png │ │ ├── avatars │ │ │ ├── avatar.jpg │ │ │ ├── avatar2.jpg │ │ │ ├── avatar3.jpg │ │ │ ├── avatar4.jpg │ │ │ ├── avatar5.jpg │ │ │ ├── avatar6.jpg │ │ │ ├── avatar7.jpg │ │ │ ├── avatar8.jpg │ │ │ ├── avatar9.jpg │ │ │ ├── avatar10.jpg │ │ │ ├── avatar11.jpg │ │ │ ├── avatar12.jpg │ │ │ ├── avatar13.jpg │ │ │ ├── avatar14.jpg │ │ │ └── avatar15.jpg │ │ ├── partners │ │ │ ├── 3docean-light-background.png │ │ │ ├── activeden-light-background.png │ │ │ ├── photodune-light-background.png │ │ │ ├── audiojungle-light-background.png │ │ │ ├── codecanyon-light-background.png │ │ │ └── themeforest-light-background.png │ │ ├── checkmark.svg │ │ ├── verified.svg │ │ ├── arrow.svg │ │ ├── arrow2.svg │ │ ├── breadcrumb.svg │ │ ├── close.svg │ │ ├── ViGallery-Logo.svg │ │ ├── flags │ │ │ ├── russia.svg │ │ │ ├── spain.svg │ │ │ ├── china.svg │ │ │ └── uk.svg │ │ ├── avatar.svg │ │ └── logo.svg │ ├── icon │ │ ├── 395128.png │ │ ├── favicon.ico │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── apple-touch-icon.png │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ └── site.webmanifest │ └── css │ │ ├── owl.carousel.min.css │ │ └── bootstrap-reboot.min.css ├── app │ ├── app.component.css │ ├── pages │ │ ├── auth │ │ │ ├── auth.component.css │ │ │ ├── register │ │ │ │ ├── register.component.css │ │ │ │ ├── register.component.spec.ts │ │ │ │ ├── register.component.ts │ │ │ │ └── register.component.html │ │ │ ├── reset-password │ │ │ │ ├── reset-password.component.css │ │ │ │ ├── reset-password.component.spec.ts │ │ │ │ ├── reset-password.component.html │ │ │ │ └── reset-password.component.ts │ │ │ ├── forgot-password │ │ │ │ ├── forgot-password.component.css │ │ │ │ ├── forgot-password.component.spec.ts │ │ │ │ ├── forgot-password.component.html │ │ │ │ └── forgot-password.component.ts │ │ │ ├── auth.component.spec.ts │ │ │ ├── auth-routing.module.ts │ │ │ ├── auth.module.ts │ │ │ ├── auth.component.html │ │ │ └── auth.component.ts │ │ ├── main │ │ │ ├── main.component.css │ │ │ ├── faq │ │ │ │ ├── faq.component.css │ │ │ │ ├── faq.component.ts │ │ │ │ ├── faq.component.spec.ts │ │ │ │ └── faq.component.html │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.spec.ts │ │ │ │ └── home.component.ts │ │ │ ├── blogs │ │ │ │ ├── blogs.component.css │ │ │ │ ├── blogs.component.ts │ │ │ │ └── blogs.component.spec.ts │ │ │ ├── contact │ │ │ │ ├── contact.component.css │ │ │ │ ├── contact.component.spec.ts │ │ │ │ └── contact.component.ts │ │ │ ├── about-us │ │ │ │ ├── about-us.component.css │ │ │ │ ├── about-us.component.ts │ │ │ │ └── about-us.component.spec.ts │ │ │ ├── privacy-policy │ │ │ │ ├── privacy-policy.component.css │ │ │ │ ├── privacy-policy.component.ts │ │ │ │ ├── privacy-policy.component.html │ │ │ │ └── privacy-policy.component.spec.ts │ │ │ ├── term-condition │ │ │ │ ├── term-condition.component.css │ │ │ │ ├── term-condition.component.ts │ │ │ │ ├── term-condition.component.html │ │ │ │ └── term-condition.component.spec.ts │ │ │ ├── create-nft │ │ │ │ ├── create-nft.component.css │ │ │ │ ├── create-nft.component.spec.ts │ │ │ │ ├── create-nft.component.ts │ │ │ │ └── create-nft.component.html │ │ │ ├── nft-detail │ │ │ │ ├── nft-detail.component.css │ │ │ │ └── nft-detail.component.spec.ts │ │ │ ├── nft-preview │ │ │ │ ├── nft-preview.component.css │ │ │ │ ├── nft-preview.component.spec.ts │ │ │ │ ├── nft-preview.component.ts │ │ │ │ └── nft-preview.component.html │ │ │ ├── main.component.html │ │ │ ├── marketplace │ │ │ │ ├── marketplace.component.css │ │ │ │ ├── marketplace.component.spec.ts │ │ │ │ └── marketplace.component.ts │ │ │ ├── main.component.spec.ts │ │ │ ├── search-result │ │ │ │ ├── search-result.component.css │ │ │ │ ├── search-result.component.spec.ts │ │ │ │ └── search-result.component.ts │ │ │ ├── profile │ │ │ │ └── profile.component.spec.ts │ │ │ ├── artist-profile │ │ │ │ ├── artist-profile.component.spec.ts │ │ │ │ └── artist-profile.component.ts │ │ │ ├── main.component.ts │ │ │ ├── main.module.ts │ │ │ └── main-routing.module.ts │ │ └── not-found │ │ │ ├── not-found.component.css │ │ │ ├── not-found.component.ts │ │ │ ├── not-found.component.html │ │ │ └── not-found.component.spec.ts │ ├── _components │ │ ├── footer │ │ │ ├── footer.component.css │ │ │ ├── footer.component.ts │ │ │ ├── footer.component.spec.ts │ │ │ └── footer.component.html │ │ ├── countdown │ │ │ ├── countdown.component.css │ │ │ ├── countdown.component.html │ │ │ ├── countdown.component.spec.ts │ │ │ └── countdown.component.ts │ │ ├── top-seller │ │ │ ├── top-seller.component.css │ │ │ ├── top-seller.component.ts │ │ │ └── top-seller.component.spec.ts │ │ ├── error-field │ │ │ ├── error-field.component.css │ │ │ ├── error-field.component.html │ │ │ ├── error-field.component.spec.ts │ │ │ └── error-field.component.ts │ │ ├── live-auction │ │ │ ├── live-auction.component.css │ │ │ ├── live-auction.component.spec.ts │ │ │ ├── live-auction.component.ts │ │ │ └── live-auction.component.html │ │ ├── header │ │ │ ├── header.component.spec.ts │ │ │ ├── header.component.css │ │ │ └── header.component.ts │ │ └── shared │ │ │ └── shared.module.ts │ ├── _helpers │ │ ├── index.ts │ │ ├── mustMatch.validator.ts │ │ ├── error.interceptor.ts │ │ └── jwt.interceptor.ts │ ├── app.component.html │ ├── _services │ │ ├── index.ts │ │ ├── store.service.ts │ │ ├── nft.service.spec.ts │ │ ├── connect.service.spec.ts │ │ ├── contact.service.spec.ts │ │ ├── utility.service.spec.ts │ │ ├── contact.service.ts │ │ ├── user.service.ts │ │ ├── utility.service.ts │ │ ├── nft.service.ts │ │ └── authentication.service.ts │ ├── _pipe │ │ ├── date-ago.pipe.spec.ts │ │ ├── safe-url.pipe.spec.ts │ │ ├── safe-html.pipe.spec.ts │ │ ├── safe-url.pipe.ts │ │ ├── safe-html.pipe.ts │ │ └── date-ago.pipe.ts │ ├── _directives │ │ ├── two-digit-decimal.directive.spec.ts │ │ └── two-digit-decimal.directive.ts │ ├── _guards │ │ ├── artist.guard.spec.ts │ │ ├── artist.guard.ts │ │ └── auth.guard.ts │ ├── app.component.ts │ ├── app-routing.module.ts │ ├── app.component.spec.ts │ └── app.module.ts ├── favicon.ico ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── styles.css ├── main.ts ├── test.ts ├── index.html └── polyfills.ts ├── .env.example ├── .gitattributes ├── screencapture-localhost-4200-2022-01-25-18_59_11.png ├── e2e ├── src │ ├── app.po.ts │ └── app.e2e-spec.ts └── tsconfig.json ├── tsconfig.app.json ├── tsconfig.spec.json ├── web3-patch.js ├── .gitignore ├── tsconfig.json ├── .vscode └── settings.json ├── README.md ├── karma.conf.js ├── package.json ├── tslint.json └── angular.json /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/i18n/en.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/auth/auth.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/main/main.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/main/faq/faq.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/main/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/_components/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/main/blogs/blogs.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/main/contact/contact.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/not-found/not-found.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/_components/countdown/countdown.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/auth/register/register.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/main/about-us/about-us.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/_components/top-seller/top-seller.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/auth/reset-password/reset-password.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/main/privacy-policy/privacy-policy.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/main/term-condition/term-condition.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/auth/forgot-password/forgot-password.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | API_BASE_URL= 2 | IMG_BASE_URL= 3 | CONTRACT_ADDRESS= 4 | OWNER_ADDRESS= -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /src/app/_helpers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './jwt.interceptor'; 2 | export * from './error.interceptor'; -------------------------------------------------------------------------------- /src/app/pages/main/create-nft/create-nft.component.css: -------------------------------------------------------------------------------- 1 | .text-center{ 2 | justify-content: center; 3 | } -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /src/assets/img/bg/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/bg/bg.png -------------------------------------------------------------------------------- /src/assets/img/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/logo.gif -------------------------------------------------------------------------------- /src/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/logo.png -------------------------------------------------------------------------------- /src/assets/icon/395128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/icon/395128.png -------------------------------------------------------------------------------- /src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /src/assets/img/bg/bg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/bg/bg2.png -------------------------------------------------------------------------------- /src/assets/img/metamask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/metamask.png -------------------------------------------------------------------------------- /src/assets/img/posts/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/posts/1.jpg -------------------------------------------------------------------------------- /src/assets/img/posts/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/posts/2.jpg -------------------------------------------------------------------------------- /src/assets/img/posts/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/posts/3.jpg -------------------------------------------------------------------------------- /src/assets/img/posts/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/posts/4.jpg -------------------------------------------------------------------------------- /src/assets/img/posts/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/posts/5.jpg -------------------------------------------------------------------------------- /src/assets/img/posts/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/posts/6.jpg -------------------------------------------------------------------------------- /src/assets/img/home/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/home/home.png -------------------------------------------------------------------------------- /src/assets/img/banner image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/banner image.png -------------------------------------------------------------------------------- /src/assets/img/bg/bg-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/bg/bg-small.png -------------------------------------------------------------------------------- /src/assets/img/bg/bg-small2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/bg/bg-small2.png -------------------------------------------------------------------------------- /src/assets/img/bg/bg-small3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/bg/bg-small3.png -------------------------------------------------------------------------------- /src/assets/img/bg/bg-small4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/bg/bg-small4.png -------------------------------------------------------------------------------- /src/assets/img/bg/bg-small5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/bg/bg-small5.png -------------------------------------------------------------------------------- /src/assets/img/bg/bg-small6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/bg/bg-small6.png -------------------------------------------------------------------------------- /src/assets/img/cover/cover1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/cover1.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/cover2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/cover2.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/cover3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/cover3.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/cover4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/cover4.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/cover5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/cover5.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/cover6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/cover6.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/cover7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/cover7.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/cover8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/cover8.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/slide1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/slide1.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/slide2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/slide2.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/slide3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/slide3.jpg -------------------------------------------------------------------------------- /src/assets/img/home/slide1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/home/slide1.jpg -------------------------------------------------------------------------------- /src/assets/img/home/slide2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/home/slide2.jpg -------------------------------------------------------------------------------- /src/assets/img/home/slide3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/home/slide3.jpg -------------------------------------------------------------------------------- /src/assets/img/logo-footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/logo-footer.png -------------------------------------------------------------------------------- /src/assets/img/posts/article.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/posts/article.jpg -------------------------------------------------------------------------------- /src/assets/icon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/icon/favicon-16x16.png -------------------------------------------------------------------------------- /src/assets/icon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/icon/favicon-32x32.png -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar2.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar3.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar4.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar5.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar6.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar7.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar8.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar9.jpg -------------------------------------------------------------------------------- /src/assets/img/cover/cover-big.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/cover/cover-big.jpg -------------------------------------------------------------------------------- /src/assets/icon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/icon/apple-touch-icon.png -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar10.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar11.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar12.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar13.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar14.jpg -------------------------------------------------------------------------------- /src/assets/img/avatars/avatar15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/avatars/avatar15.jpg -------------------------------------------------------------------------------- /src/assets/icon/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/icon/android-chrome-192x192.png -------------------------------------------------------------------------------- /src/assets/icon/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/icon/android-chrome-512x512.png -------------------------------------------------------------------------------- /src/app/_components/error-field/error-field.component.css: -------------------------------------------------------------------------------- 1 | .invalid-feedback { 2 | display: block !important; 3 | color: white; 4 | font-size: 13px; 5 | } 6 | -------------------------------------------------------------------------------- /src/app/_components/error-field/error-field.component.html: -------------------------------------------------------------------------------- 1 |
2 |
{{ getErrorMessage(errorMsg)}}
3 |
-------------------------------------------------------------------------------- /src/app/pages/main/nft-detail/nft-detail.component.css: -------------------------------------------------------------------------------- 1 | .nft-desc p { 2 | margin-bottom: 5px !important; 3 | } 4 | 5 | .nft-desc { 6 | color: #bdbdbd !important; 7 | } -------------------------------------------------------------------------------- /src/app/pages/main/nft-preview/nft-preview.component.css: -------------------------------------------------------------------------------- 1 | .nft-desc p { 2 | margin-bottom: 5px !important; 3 | } 4 | 5 | .nft-desc { 6 | color: #bdbdbd !important; 7 | } -------------------------------------------------------------------------------- /screencapture-localhost-4200-2022-01-25-18_59_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/screencapture-localhost-4200-2022-01-25-18_59_11.png -------------------------------------------------------------------------------- /src/app/_components/countdown/countdown.component.html: -------------------------------------------------------------------------------- 1 | 2 | {{daysToDday}}:{{hoursToDday}}:{{minutesToDday}}:{{secondsToDday}} 3 | -------------------------------------------------------------------------------- /src/assets/img/partners/3docean-light-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/partners/3docean-light-background.png -------------------------------------------------------------------------------- /src/assets/img/partners/activeden-light-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/partners/activeden-light-background.png -------------------------------------------------------------------------------- /src/assets/img/partners/photodune-light-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/partners/photodune-light-background.png -------------------------------------------------------------------------------- /src/assets/img/partners/audiojungle-light-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/partners/audiojungle-light-background.png -------------------------------------------------------------------------------- /src/assets/img/partners/codecanyon-light-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/partners/codecanyon-light-background.png -------------------------------------------------------------------------------- /src/assets/img/partners/themeforest-light-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dreamfullstacker/NFTmarketplace-Angular-metamask/HEAD/src/assets/img/partners/themeforest-light-background.png -------------------------------------------------------------------------------- /src/assets/img/checkmark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/img/verified.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/img/arrow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/_services/index.ts: -------------------------------------------------------------------------------- 1 | export * from './authentication.service'; 2 | export * from './user.service'; 3 | export * from './utility.service'; 4 | export * from './nft.service'; 5 | export * from './connect.service'; 6 | export * from './contact.service'; -------------------------------------------------------------------------------- /src/assets/img/arrow2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/_pipe/date-ago.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { DateAgoPipe } from './date-ago.pipe'; 2 | 3 | describe('DateAgoPipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new DateAgoPipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /src/app/_pipe/safe-url.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { SafeUrlPipe } from './safe-url.pipe'; 2 | 3 | describe('SafeUrlPipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new SafeUrlPipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /src/app/_pipe/safe-html.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { SafeHtmlPipe } from './safe-html.pipe'; 2 | 3 | describe('SafeHtmlPipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new SafeHtmlPipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /src/assets/img/breadcrumb.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/icon/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} -------------------------------------------------------------------------------- /src/assets/img/close.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/main/main.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 |
9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | API_BASE_URL: 'http://15.207.100.113:3000/v1/', 4 | IMG_BASE_URL: 'http://15.207.100.113:3000/', 5 | CONTRACT_ADDRESS: '0xaf49F92B39F22547BeaD17dDcfde18F1C662F3dD', 6 | OWNER_ADDRESS: '0x4bCa8e532F351f7Eb21554406fA30b57FE6D08D0', 7 | }; 8 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | async navigateTo(): Promise { 5 | return browser.get(browser.baseUrl); 6 | } 7 | 8 | async getTitleText(): Promise { 9 | return element(by.css('app-root .content span')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/app/_directives/two-digit-decimal.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { TwoDigitDecimalDirective } from './two-digit-decimal.directive'; 2 | 3 | describe('TwoDigitDecimalDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new TwoDigitDecimalDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../out-tsc/e2e", 6 | "module": "commonjs", 7 | "target": "es2018", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/app/_services/store.service.ts: -------------------------------------------------------------------------------- 1 | import { BehaviorSubject } from 'rxjs'; 2 | 3 | export class StoreService { 4 | constructor() {} 5 | 6 | public static restoreAuthenticationTaskCompleted = new BehaviorSubject< 7 | boolean 8 | >(false); 9 | public static isAuthenticationCompleted = new BehaviorSubject(false); 10 | } 11 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import '~ngx-toastr/toastr'; 3 | 4 | 5 | button:disabled, 6 | button[disabled] { 7 | border: 1px solid #999999; 8 | background-color: #cccccc; 9 | color: #666666; 10 | cursor: not-allowed; 11 | } 12 | .asset__author img{ 13 | object-fit: cover; 14 | } -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/app/_pipe/safe-url.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | import { DomSanitizer } from '@angular/platform-browser'; 3 | 4 | @Pipe({ 5 | name: 'safeUrl', 6 | }) 7 | export class SafeUrlPipe implements PipeTransform { 8 | constructor(private sanitizer: DomSanitizer) {} 9 | transform(url) { 10 | return this.sanitizer.bypassSecurityTrustResourceUrl(url); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment.prod'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /src/app/_guards/artist.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ArtistGuard } from './artist.guard'; 4 | 5 | describe('ArtistGuard', () => { 6 | let guard: ArtistGuard; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | guard = TestBed.inject(ArtistGuard); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(guard).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/_services/nft.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { NftService } from './nft.service'; 4 | 5 | describe('NftService', () => { 6 | let service: NftService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(NftService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/_services/connect.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ConnectService } from './connect.service'; 4 | 5 | describe('ConnectService', () => { 6 | let service: ConnectService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ConnectService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/_services/contact.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ContactService } from './contact.service'; 4 | 5 | describe('ContactService', () => { 6 | let service: ContactService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ContactService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/_services/utility.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UtilityService } from './utility.service'; 4 | 5 | describe('UtilityService', () => { 6 | let service: UtilityService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(UtilityService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/_components/top-seller/top-seller.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-top-seller', 5 | templateUrl: './top-seller.component.html', 6 | styleUrls: ['./top-seller.component.css'], 7 | changeDetection: ChangeDetectionStrategy.OnPush 8 | }) 9 | export class TopSellerComponent implements OnInit { 10 | 11 | constructor() { } 12 | 13 | ngOnInit(): void { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/assets/img/ViGallery-Logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/app/_components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'], 7 | changeDetection: ChangeDetectionStrategy.OnPush 8 | }) 9 | export class FooterComponent implements OnInit { 10 | 11 | constructor() { } 12 | 13 | ngOnInit(): void { 14 | } 15 | 16 | getYear() { 17 | return new Date().getFullYear(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /web3-patch.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | // path can differ depend on Angular CLI version 4 | const browserConfigPath = 'node_modules/@angular-devkit/build-angular/src/webpack/configs/browser.js'; 5 | 6 | fs.readFile(browserConfigPath, 'utf8', function (err, data) { 7 | if (err) { 8 | return console.log(err); 9 | } 10 | const result = data.replace(/node: false/g, 'node: {crypto: true, stream: true}'); 11 | 12 | fs.writeFile(browserConfigPath, result, 'utf8', function (err) { 13 | if (err) return console.log(err); 14 | }); 15 | }); -------------------------------------------------------------------------------- /src/app/_components/live-auction/live-auction.component.css: -------------------------------------------------------------------------------- 1 | .card__cover img { 2 | max-height: 300px; 3 | object-fit: cover; 4 | } 5 | .card__author a{ 6 | color: #ffffff !important; 7 | } 8 | .main__nav--prev,.main__nav--next { 9 | display: none; 10 | } 11 | /* .fix-height { 12 | height: 150px; 13 | object-fit: cover; 14 | } */ 15 | .fix-height { 16 | /* height: 150px; */ 17 | object-fit: cover; 18 | height: 300px; 19 | } 20 | 21 | .card-main { 22 | padding: 20px; 23 | width: 100%; 24 | } 25 | .card { 26 | padding: 0% !important; 27 | } -------------------------------------------------------------------------------- /src/app/pages/not-found/not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { UtilityService } from '../../_services'; 3 | 4 | @Component({ 5 | templateUrl: './not-found.component.html', 6 | styleUrls: ['./not-found.component.css'] 7 | }) 8 | export class NotFoundComponent implements OnInit { 9 | 10 | constructor(private utility: UtilityService) { 11 | this.utility.updatePageSEO( '404 Not Found | NFT', '404 Not Found | NFT', '', '') 12 | } 13 | 14 | year = new Date().getFullYear() 15 | 16 | ngOnInit(): void { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/app/pages/main/blogs/blogs.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { UtilityService } from './../../../_services/utility.service'; 3 | @Component({ 4 | templateUrl: './blogs.component.html', 5 | styleUrls: ['./blogs.component.css'], 6 | }) 7 | export class BlogsComponent implements OnInit { 8 | constructor(private utility: UtilityService) { 9 | this.utility.updatePageSEO( 10 | 'Defy Blogs | NFT News, Analysis, Guides, and Updates | nft.defydefi.io', 11 | 'Check out the latest happenings and updates.' 12 | ); 13 | } 14 | 15 | ngOnInit(): void {} 16 | } 17 | -------------------------------------------------------------------------------- /src/app/pages/main/faq/faq.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { UtilityService } from './../../../_services/utility.service'; 3 | @Component({ 4 | templateUrl: './faq.component.html', 5 | styleUrls: ['./faq.component.css'], 6 | }) 7 | export class FaqComponent implements OnInit { 8 | constructor(private utility: UtilityService) { 9 | this.utility.updatePageSEO( 10 | 'FAQ | Buy and Sell your NFT, and NFT Money. NFT Collections, Crypto artworks.', 11 | 'At Defy, we work every day to solve NFT Trading problems.' 12 | ); 13 | } 14 | 15 | ngOnInit(): void {} 16 | } 17 | -------------------------------------------------------------------------------- /src/app/pages/not-found/not-found.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 | 6 |
7 |
8 |
9 |
10 |

404

11 |

The page you are looking for not available!

12 | go back 13 |
14 |
15 |
16 |
17 | 18 |
19 |
-------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { UtilityService } from './_services/utility.service'; 2 | import { Component, OnInit } from '@angular/core'; 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent implements OnInit { 9 | title = 'nft-web-app'; 10 | loaderText: string = 'Loading...'; // decorate the property with @Input() 11 | constructor(private utility: UtilityService) { 12 | utility.loader_callback.subscribe(data => { 13 | this.loaderText = data 14 | }); 15 | } 16 | 17 | ngOnInit(): void { 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/app/pages/main/about-us/about-us.component.ts: -------------------------------------------------------------------------------- 1 | import { UtilityService } from './../../../_services/utility.service'; 2 | import { Component, OnInit } from '@angular/core'; 3 | 4 | @Component({ 5 | templateUrl: './about-us.component.html', 6 | styleUrls: ['./about-us.component.css'], 7 | }) 8 | export class AboutUsComponent implements OnInit { 9 | constructor(private utility: UtilityService) { 10 | this.utility.updatePageSEO( 11 | 'NFT Marketplace | Buy and Sell your NFT, and NFT Money. NFT Collections, Crypto artworks.', 12 | 'At Defy, we work every day to solve NFT Trading problems.' 13 | ); 14 | } 15 | 16 | ngOnInit(): void {} 17 | } 18 | -------------------------------------------------------------------------------- /src/app/_pipe/safe-html.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Pipe, PipeTransform } from '@angular/core'; 2 | import { DomSanitizer } from '@angular/platform-browser'; 3 | 4 | @Pipe({ name: 'safeHtml' }) 5 | export class SafeHtmlPipe implements PipeTransform { 6 | constructor(private sanitized: DomSanitizer) {} 7 | transform(value: string) { 8 | console.log(value); 9 | 10 | if (value) { 11 | return this.sanitized.bypassSecurityTrustHtml( 12 | value 13 | .replace(new RegExp('<', 'g'), '<') 14 | .replace(new RegExp('>', 'g'), '>') 15 | ); 16 | } 17 | else { 18 | return ''; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/app/pages/main/privacy-policy/privacy-policy.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { UtilityService } from './../../../_services/utility.service'; 3 | @Component({ 4 | templateUrl: './privacy-policy.component.html', 5 | styleUrls: ['./privacy-policy.component.css'], 6 | }) 7 | export class PrivacyPolicyComponent implements OnInit { 8 | constructor(private utility: UtilityService) { 9 | this.utility.updatePageSEO( 10 | 'Privacy Policy | Buy and Sell your NFT, and NFT Money. NFT Collections, Crypto artworks.', 11 | 'At Defy, we work every day to solve NFT Trading problems.' 12 | ); 13 | } 14 | 15 | ngOnInit(): void {} 16 | } 17 | -------------------------------------------------------------------------------- /src/app/_services/contact.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { map } from 'rxjs/operators'; 4 | import { environment } from '../../environments/environment'; 5 | 6 | @Injectable({ 7 | providedIn: 'root', 8 | }) 9 | export class ContactService { 10 | public readonly apiUrl = environment.API_BASE_URL; 11 | 12 | constructor(public http: HttpClient) {} 13 | 14 | // send contact request 15 | createContact(nftBody: Object) { 16 | return this.http.post(`${this.apiUrl}contacts`, nftBody).pipe( 17 | map((response: Response) => { 18 | return response; 19 | }) 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/app/pages/main/term-condition/term-condition.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { UtilityService } from './../../../_services/utility.service'; 3 | @Component({ 4 | templateUrl: './term-condition.component.html', 5 | styleUrls: ['./term-condition.component.css'], 6 | }) 7 | export class TermConditionComponent implements OnInit { 8 | constructor(private utility: UtilityService) { 9 | this.utility.updatePageSEO( 10 | 'Terms & Condition | Buy and Sell your NFT, and NFT Money. NFT Collections, Crypto artworks.', 11 | 'At Defy, we work every day to solve NFT Trading problems.' 12 | ); 13 | } 14 | 15 | ngOnInit(): void {} 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | ./node_modules 10 | node_modules 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage/* 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | # e2e 36 | /e2e/*.js 37 | /e2e/*.map 38 | 39 | #System Files 40 | .DS_Store 41 | Thumbs.db 42 | 43 | .env 44 | -------------------------------------------------------------------------------- /src/app/pages/main/faq/faq.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FaqComponent } from './faq.component'; 4 | 5 | describe('FaqComponent', () => { 6 | let component: FaqComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ FaqComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FaqComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/marketplace/marketplace.component.css: -------------------------------------------------------------------------------- 1 | form { 2 | width: 100%; 3 | } 4 | ::ng-deep .ngx-pagination .current { 5 | background: #6164ff !important; 6 | } 7 | 8 | 9 | ::ng-deep .ngx-pagination a span, 10 | .ngx-pagination button span { 11 | color: #6164ff !important; 12 | } 13 | ::ng-deep .pagination-previous { 14 | color: #6164ff; 15 | } 16 | ::ng-deep .pagination-next { 17 | color: #6164ff; 18 | } 19 | .card__cover img{ 20 | /* max-height: 250px; */ 21 | /* height: 300px; */ 22 | } 23 | .fix-height{ 24 | /* height: 150px; */ 25 | object-fit: cover; 26 | height: 300px; 27 | } 28 | .card-main{ 29 | padding: 20px; 30 | width: 100%; 31 | } 32 | .card{ 33 | padding: 0% !important; 34 | } -------------------------------------------------------------------------------- /src/app/pages/auth/auth.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthComponent } from './auth.component'; 4 | 5 | describe('AuthComponent', () => { 6 | let component: AuthComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ AuthComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AuthComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/main.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MainComponent } from './main.component'; 4 | 5 | describe('MainComponent', () => { 6 | let component: MainComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ MainComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MainComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ HomeComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HomeComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "downlevelIteration": true, 10 | "experimentalDecorators": true, 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "module": "es2020", 15 | "lib": [ 16 | "es2018", 17 | "dom" 18 | ], 19 | "paths": { 20 | "crypto": [ 21 | "../../node_modules/crypto-js" 22 | ] 23 | } 24 | }, 25 | "angularCompilerOptions": { 26 | "enableI18nLegacyMessageIdFormat": false 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/app/pages/main/blogs/blogs.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BlogsComponent } from './blogs.component'; 4 | 5 | describe('BlogsComponent', () => { 6 | let component: BlogsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ BlogsComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BlogsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/_guards/artist.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | 5 | @Injectable({ 6 | providedIn: 'root' 7 | }) 8 | export class ArtistGuard implements CanActivate { 9 | canActivate( 10 | route: ActivatedRouteSnapshot, 11 | state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { 12 | var role = JSON.parse(localStorage.getItem('user')) 13 | ? JSON.parse(localStorage.getItem('user'))['role'] 14 | : ''; 15 | 16 | if (role === 'artist' || role === 'user') { 17 | return true; 18 | } 19 | return false; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/app/pages/main/search-result/search-result.component.css: -------------------------------------------------------------------------------- 1 | form { 2 | width: 100%; 3 | } 4 | 5 | ::ng-deep .ngx-pagination .current { 6 | background: #6164ff !important; 7 | } 8 | 9 | 10 | ::ng-deep .ngx-pagination a span, 11 | .ngx-pagination button span { 12 | color: #6164ff !important; 13 | } 14 | 15 | ::ng-deep .pagination-previous { 16 | color: #6164ff; 17 | } 18 | 19 | ::ng-deep .pagination-next { 20 | color: #6164ff; 21 | } 22 | 23 | .card__cover img { 24 | /* max-height: 250px; */ 25 | /* height: 300px; */ 26 | } 27 | 28 | .fix-height { 29 | /* height: 150px; */ 30 | object-fit: cover; 31 | height: 300px; 32 | } 33 | 34 | .card-main { 35 | padding: 20px; 36 | width: 100%; 37 | } 38 | 39 | .card { 40 | padding: 0% !important; 41 | } -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { browser, logging } from 'protractor'; 2 | import { AppPage } from './app.po'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', async () => { 12 | await page.navigateTo(); 13 | expect(await page.getTitleText()).toEqual('nft-web-app app is running!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/app/_components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/_components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/contact/contact.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ContactComponent } from './contact.component'; 4 | 5 | describe('ContactComponent', () => { 6 | let component: ContactComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ContactComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ContactComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/profile/profile.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProfileComponent } from './profile.component'; 4 | 5 | describe('ProfileComponent', () => { 6 | let component: ProfileComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ProfileComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ProfileComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/about-us/about-us.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AboutUsComponent } from './about-us.component'; 4 | 5 | describe('AboutUsComponent', () => { 6 | let component: AboutUsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ AboutUsComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AboutUsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/not-found/not-found.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NotFoundComponent } from './not-found.component'; 4 | 5 | describe('NotFoundComponent', () => { 6 | let component: NotFoundComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ NotFoundComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NotFoundComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/auth/register/register.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RegisterComponent } from './register.component'; 4 | 5 | describe('RegisterComponent', () => { 6 | let component: RegisterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ RegisterComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(RegisterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/_components/countdown/countdown.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CountdownComponent } from './countdown.component'; 4 | 5 | describe('CountdownComponent', () => { 6 | let component: CountdownComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ CountdownComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CountdownComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/_components/top-seller/top-seller.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TopSellerComponent } from './top-seller.component'; 4 | 5 | describe('TopSellerComponent', () => { 6 | let component: TopSellerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ TopSellerComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TopSellerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/create-nft/create-nft.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CreateNftComponent } from './create-nft.component'; 4 | 5 | describe('CreateNftComponent', () => { 6 | let component: CreateNftComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ CreateNftComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CreateNftComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/nft-detail/nft-detail.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NftDetailComponent } from './nft-detail.component'; 4 | 5 | describe('NftDetailComponent', () => { 6 | let component: NftDetailComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ NftDetailComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NftDetailComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/_components/error-field/error-field.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ErrorFieldComponent } from './error-field.component'; 4 | 5 | describe('ErrorFieldComponent', () => { 6 | let component: ErrorFieldComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ErrorFieldComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ErrorFieldComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/nft-preview/nft-preview.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NftPreviewComponent } from './nft-preview.component'; 4 | 5 | describe('NftPreviewComponent', () => { 6 | let component: NftPreviewComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ NftPreviewComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NftPreviewComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/privacy-policy/privacy-policy.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 9 |
10 | 11 | 12 | 13 |
14 |
15 |

Privacy policy

16 |

Last updated: August 05, 2021

17 | 18 | 19 | 20 | 21 |
22 |
23 | 24 |
25 |
-------------------------------------------------------------------------------- /src/app/pages/main/term-condition/term-condition.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 9 |
10 | 11 | 12 | 13 |
14 |
15 |

Terms Condition

16 |

Last updated: August 05, 2021

17 | 18 | 19 | 20 | 21 |
22 |
23 | 24 |
25 |
-------------------------------------------------------------------------------- /src/app/pages/main/marketplace/marketplace.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MarketplaceComponent } from './marketplace.component'; 4 | 5 | describe('MarketplaceComponent', () => { 6 | let component: MarketplaceComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ MarketplaceComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MarketplaceComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/_components/live-auction/live-auction.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LiveAuctionComponent } from './live-auction.component'; 4 | 5 | describe('LiveAuctionComponent', () => { 6 | let component: LiveAuctionComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ LiveAuctionComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LiveAuctionComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/search-result/search-result.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SearchResultComponent } from './search-result.component'; 4 | 5 | describe('SearchResultComponent', () => { 6 | let component: SearchResultComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ SearchResultComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SearchResultComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/auth/reset-password/reset-password.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ResetPasswordComponent } from './reset-password.component'; 4 | 5 | describe('ResetPasswordComponent', () => { 6 | let component: ResetPasswordComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ResetPasswordComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ResetPasswordComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/artist-profile/artist-profile.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ArtistProfileComponent } from './artist-profile.component'; 4 | 5 | describe('ArtistProfileComponent', () => { 6 | let component: ArtistProfileComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ArtistProfileComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ArtistProfileComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/privacy-policy/privacy-policy.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PrivacyPolicyComponent } from './privacy-policy.component'; 4 | 5 | describe('PrivacyPolicyComponent', () => { 6 | let component: PrivacyPolicyComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ PrivacyPolicyComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(PrivacyPolicyComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/main/term-condition/term-condition.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TermConditionComponent } from './term-condition.component'; 4 | 5 | describe('TermConditionComponent', () => { 6 | let component: TermConditionComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ TermConditionComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TermConditionComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/auth/forgot-password/forgot-password.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ForgotPasswordComponent } from './forgot-password.component'; 4 | 5 | describe('ForgotPasswordComponent', () => { 6 | let component: ForgotPasswordComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ForgotPasswordComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ForgotPasswordComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | keys(): string[]; 13 | (id: string): T; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting() 21 | ); 22 | // Then we find all the tests. 23 | const context = require.context('./', true, /\.spec\.ts$/); 24 | // And load the modules. 25 | context.keys().map(context); 26 | -------------------------------------------------------------------------------- /src/app/_helpers/mustMatch.validator.ts: -------------------------------------------------------------------------------- 1 | import { FormGroup } from '@angular/forms'; 2 | 3 | // custom validator to check that two fields match 4 | export function MustMatch(controlName: string, matchingControlName: string) { 5 | return (formGroup: FormGroup) => { 6 | const control = formGroup.controls[controlName]; 7 | const matchingControl = formGroup.controls[matchingControlName]; 8 | 9 | if (matchingControl.errors && !matchingControl.errors.mustMatch) { 10 | // return if another validator has already found an error on the matchingControl 11 | return; 12 | } 13 | 14 | // set error on matchingControl if validation fails 15 | if (control.value !== matchingControl.value) { 16 | matchingControl.setErrors({ mustMatch: true }); 17 | } else { 18 | matchingControl.setErrors(null); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "files.exclude": { 4 | "/.git": true, 5 | "/.DS_Store": true, 6 | "/node_modules": true, 7 | "/node_modules/": true 8 | }, 9 | "search.exclude": { 10 | "/node_modules": true 11 | }, 12 | "files.watcherExclude": { 13 | "/node_modules/": true 14 | }, 15 | "window.zoomLevel": 2, 16 | "javascript.updateImportsOnFileMove.enabled": "always", 17 | "editor.tabSize": 2, 18 | "editor.insertSpaces": true, 19 | "editor.detectIndentation": true, 20 | "eslint.validate": [ 21 | { 22 | "language": "vue", 23 | "autoFix": true 24 | }, 25 | { 26 | "language": "javascript", 27 | "autoFix": true 28 | }, 29 | { 30 | "language": "javascriptreact", 31 | "autoFix": true 32 | } 33 | ], 34 | "eslint.autoFixOnSave": false, 35 | "editor.formatOnSave": false, 36 | "vetur.validation.template": false, 37 | "editor.fontSize": 14 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/app/_guards/auth.guard.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Injectable } from '@angular/core'; 3 | import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 4 | 5 | import { AuthenticationService } from '../_services'; 6 | 7 | @Injectable({ providedIn: 'root' }) 8 | export class AuthGuard implements CanActivate { 9 | constructor( 10 | private router: Router, 11 | private authenticationService: AuthenticationService 12 | ) {} 13 | 14 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { 15 | const currentUser = this.authenticationService.token; 16 | if (currentUser) { 17 | // authorised so return true 18 | return true; 19 | } 20 | 21 | // not logged in so redirect to login page with the return url 22 | this.router.navigate(['/auth/login'], { queryParams: { returnUrl: state.url }}); 23 | return false; 24 | } 25 | } -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NotFoundComponent } from './pages/not-found/not-found.component'; 2 | import { NgModule } from '@angular/core'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { CommonModule, } from '@angular/common'; 5 | import { BrowserModule } from '@angular/platform-browser'; 6 | import { AuthGuard } from './_guards/auth.guard' 7 | 8 | const routes: Routes = [ 9 | { path: 'auth', loadChildren: () => import('./pages/auth/auth.module').then(m => m.AuthModule) }, 10 | { path: '', loadChildren: () => import('./pages/main/main.module').then(m => m.MainModule) }, 11 | { path: '**', component: NotFoundComponent }, 12 | ]; 13 | @NgModule({ 14 | imports: [ 15 | CommonModule, 16 | BrowserModule, 17 | RouterModule.forRoot(routes, { 18 | useHash: true, 19 | anchorScrolling: 'enabled', 20 | scrollPositionRestoration: 'top', 21 | }), 22 | ], 23 | exports: [], 24 | }) 25 | export class AppRoutingModule {} -------------------------------------------------------------------------------- /src/app/pages/auth/auth-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { ForgotPasswordComponent } from './forgot-password/forgot-password.component'; 2 | import { NgModule } from '@angular/core'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { AuthComponent } from './auth.component'; 5 | import { ResetPasswordComponent } from './reset-password/reset-password.component' 6 | import { RegisterComponent } from './register/register.component'; 7 | 8 | const routes: Routes = [ {path: '', redirectTo: 'login', pathMatch: 'full'}, 9 | { path: 'login', component: AuthComponent }, 10 | { path: 'register', component: RegisterComponent }, 11 | {path: 'forgot-password', component: ForgotPasswordComponent}, 12 | {path: 'reset-password', component: ResetPasswordComponent}]; 13 | 14 | @NgModule({ 15 | imports: [RouterModule.forChild(routes)], 16 | exports: [RouterModule] 17 | }) 18 | export class AuthRoutingModule { } 19 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | require('dotenv').config(); 6 | 7 | export const environment = { 8 | production: false, 9 | API_BASE_URL: 'http://localhost:3000/v1/', 10 | IMG_BASE_URL: 'http://localhost:3000/', 11 | CONTRACT_ADDRESS: '0x37ad23C5b727419E4C7405FB9DF7335F82aB8684', 12 | OWNER_ADDRESS: '0x0cE1E760252Fd26c924c24F7f25b269B2b979c2A', 13 | }; 14 | 15 | /* 16 | * For easier debugging in development mode, you can import the following file 17 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 18 | * 19 | * This import should be commented out in production mode because it will have a negative impact 20 | * on performance if an error is thrown. 21 | */ 22 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 23 | -------------------------------------------------------------------------------- /src/assets/img/flags/russia.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/app/pages/auth/auth.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule } from '@angular/router'; 4 | import { AuthRoutingModule } from './auth-routing.module'; 5 | import { AuthComponent } from './auth.component'; 6 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 7 | // import { ErrorFieldComponent } from '../../_components/error-field/error-field.component'; 8 | import { ForgotPasswordComponent } from './forgot-password/forgot-password.component'; 9 | import { ResetPasswordComponent } from './reset-password/reset-password.component' 10 | import { SharedModule } from './../../_components/shared/shared.module'; 11 | import { RegisterComponent } from './register/register.component'; 12 | @NgModule({ 13 | declarations: [AuthComponent, ForgotPasswordComponent, ResetPasswordComponent, RegisterComponent], 14 | imports: [ 15 | CommonModule, 16 | RouterModule, 17 | FormsModule, 18 | ReactiveFormsModule, 19 | AuthRoutingModule, 20 | SharedModule 21 | ] 22 | }) 23 | export class AuthModule { } 24 | -------------------------------------------------------------------------------- /src/app/_pipe/date-ago.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'dateAgo', 5 | pure: true, 6 | }) 7 | export class DateAgoPipe implements PipeTransform { 8 | transform(value: any, args?: any): any { 9 | if (value) { 10 | const seconds = Math.floor((+new Date() - +new Date(value)) / 1000); 11 | if (seconds < 29) 12 | // less than 30 seconds ago will show as 'Just now' 13 | return 'Just now'; 14 | const intervals = { 15 | year: 31536000, 16 | month: 2592000, 17 | week: 604800, 18 | day: 86400, 19 | hour: 3600, 20 | minute: 60, 21 | second: 1, 22 | }; 23 | let counter; 24 | for (const i in intervals) { 25 | counter = Math.floor(seconds / intervals[i]); 26 | if (counter > 0) 27 | if (counter === 1) { 28 | return counter + ' ' + i + ' ago'; // singular (1 day ago) 29 | } else { 30 | return counter + ' ' + i + 's ago'; // plural (2 days ago) 31 | } 32 | } 33 | } 34 | return value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NFT BSC CHAIN APP 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.1.2. 4 | 5 | ## Development server 6 | 7 | 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. 8 | 9 | ## Code scaffolding 10 | 11 | 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`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | 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. 28 | -------------------------------------------------------------------------------- /src/app/_helpers/error.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { 3 | HttpRequest, 4 | HttpHandler, 5 | HttpEvent, 6 | HttpInterceptor, 7 | } from '@angular/common/http'; 8 | import { Observable, throwError } from 'rxjs'; 9 | import { catchError } from 'rxjs/operators'; 10 | 11 | import { AuthenticationService } from '../_services'; 12 | 13 | @Injectable() 14 | export class ErrorInterceptor implements HttpInterceptor { 15 | constructor(private authenticationService: AuthenticationService) {} 16 | 17 | intercept( 18 | request: HttpRequest, 19 | next: HttpHandler 20 | ): Observable> { 21 | return next.handle(request).pipe( 22 | catchError((err) => { 23 | const error = err.error.message || err.statusText; 24 | if (err.status === 401 && error === 'Please authenticate') { 25 | // auto logout if 401 response returned from api 26 | this.authenticationService.logout(); 27 | // //location.reload(true); 28 | window.location.href = '/#/auth/login' 29 | } 30 | return throwError(error); 31 | }) 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/assets/img/flags/spain.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/app/_directives/two-digit-decimal.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, ElementRef, HostListener } from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: '[appTwoDigitDecimal]', 5 | }) 6 | export class TwoDigitDecimalDirective { 7 | private regex: RegExp = new RegExp(/^\d*\.?\d{0,2}$/g); 8 | private specialKeys: Array = [ 9 | 'Backspace', 10 | 'Tab', 11 | 'End', 12 | 'Home', 13 | '-', 14 | 'ArrowLeft', 15 | 'ArrowRight', 16 | 'Del', 17 | 'Delete', 18 | ]; 19 | constructor(private el: ElementRef) {} 20 | @HostListener('keydown', ['$event']) 21 | onKeyDown(event: KeyboardEvent) { 22 | console.log(this.el.nativeElement.value); 23 | // Allow Backspace, tab, end, and home keys 24 | if (this.specialKeys.indexOf(event.key) !== -1) { 25 | return; 26 | } 27 | let current: string = this.el.nativeElement.value; 28 | const position = this.el.nativeElement.selectionStart; 29 | const next: string = [ 30 | current.slice(0, position), 31 | event.key == 'Decimal' ? '.' : event.key, 32 | current.slice(position), 33 | ].join(''); 34 | if (next && !String(next).match(this.regex)) { 35 | event.preventDefault(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'nft-web-app'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('nft-web-app'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement; 33 | expect(compiled.querySelector('.content span').textContent).toContain('nft-web-app app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /src/app/pages/main/artist-profile/artist-profile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { 3 | UserService, 4 | UtilityService, 5 | } from '../../../_services'; 6 | import { environment } from 'src/environments/environment'; 7 | import { ActivatedRoute } from '@angular/router'; 8 | 9 | @Component({ 10 | templateUrl: './artist-profile.component.html', 11 | styleUrls: ['./artist-profile.component.css'], 12 | }) 13 | export class ArtistProfileComponent implements OnInit { 14 | constructor( 15 | private userService: UserService, 16 | private utility: UtilityService, 17 | private activatedRoute: ActivatedRoute 18 | ) {} 19 | userProfile: any; 20 | imgBaseUrl = environment.IMG_BASE_URL; 21 | 22 | ngOnInit(): void { 23 | this.getArtistProfile(); 24 | } 25 | 26 | getArtistProfile() { 27 | this.utility.startLoader(); 28 | this.userService 29 | .getArtistProfile(this.activatedRoute.snapshot.paramMap.get('artist_id')) 30 | .subscribe( 31 | (res) => { 32 | this.userProfile = res; 33 | this.utility.stopLoader(); 34 | }, 35 | (error) => { 36 | this.utility.stopLoader(); 37 | this.utility.showErrorAlert('Error', error); 38 | } 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/app/pages/main/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component,Injectable, OnInit } from '@angular/core'; 2 | import { UtilityService, AuthenticationService, ConnectService, NftService } from '../../../_services'; 3 | import {connectToWallet} from '../../../utils/web3'; 4 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 5 | declare var $: any; 6 | declare let window:any; 7 | 8 | @Injectable({ 9 | providedIn: 'root', 10 | }) 11 | 12 | @Component({ 13 | templateUrl: './home.component.html', 14 | styleUrls: ['./home.component.css'], 15 | }) 16 | export class HomeComponent implements OnInit { 17 | constructor(private utility: UtilityService,private connectService: ConnectService) { 18 | 19 | this.utility.updatePageSEO( 20 | 'NFT Marketplace | Buy and Sell your NFT, and NFT Money. NFT Collections, Crypto artworks.', 21 | 'Buy, Sell and trade your NFTs and NFT Money Secured with blockchain.' 22 | ); 23 | } 24 | 25 | walletAddres: any = ''; 26 | 27 | async ngOnInit() { 28 | this.walletAddres = await this.connectService.getAddress(); 29 | } 30 | async connectToWallet(){ 31 | $('#connect_to_wallet').modal('hide'); 32 | this.walletAddres = await this.connectService.getAddress(); 33 | }; 34 | connectWallet(){ 35 | $('#connect_to_wallet').modal('show'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/assets/img/flags/china.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 13 | 15 | 17 | 19 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | jasmine: { 17 | // you can add configuration options for Jasmine here 18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html 19 | // for example, you can disable the random execution with `random: false` 20 | // or set a specific seed with `seed: 4321` 21 | }, 22 | clearContext: false // leave Jasmine Spec Runner output visible in browser 23 | }, 24 | jasmineHtmlReporter: { 25 | suppressAll: true // removes the duplicated traces 26 | }, 27 | coverageReporter: { 28 | dir: require('path').join(__dirname, './coverage/nft-web-app'), 29 | subdir: '.', 30 | reporters: [ 31 | { type: 'html' }, 32 | { type: 'text-summary' } 33 | ] 34 | }, 35 | reporters: ['progress', 'kjhtml'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false, 42 | restartOnFileChange: true 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /src/app/_components/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { DateAgoPipe } from './../../_pipe/date-ago.pipe'; 2 | import { SafeUrlPipe } from './../../_pipe/safe-url.pipe'; 3 | import { RouterModule } from '@angular/router'; 4 | import { ErrorFieldComponent } from './../error-field/error-field.component'; 5 | import { HeaderComponent } from './../header/header.component'; 6 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 7 | import { NgModule } from '@angular/core'; 8 | import { CommonModule } from '@angular/common'; 9 | import { AvatarModule } from 'ngx-avatar'; 10 | import { CountdownComponent } from './../countdown/countdown.component'; 11 | import { FooterComponent } from './../footer/footer.component'; 12 | import { LiveAuctionComponent } from './../live-auction/live-auction.component'; 13 | import { TopSellerComponent } from './../top-seller/top-seller.component'; 14 | import { NgxSpinnerModule } from 'ngx-spinner'; 15 | @NgModule({ 16 | declarations: [ 17 | ErrorFieldComponent, 18 | HeaderComponent, 19 | CountdownComponent, 20 | FooterComponent, 21 | LiveAuctionComponent, 22 | TopSellerComponent, 23 | SafeUrlPipe, 24 | DateAgoPipe, 25 | ], 26 | imports: [ 27 | CommonModule, 28 | RouterModule, 29 | AvatarModule, 30 | NgxSpinnerModule, 31 | FormsModule, 32 | ReactiveFormsModule, 33 | ], 34 | exports: [ 35 | HeaderComponent, 36 | ErrorFieldComponent, 37 | CountdownComponent, 38 | FooterComponent, 39 | LiveAuctionComponent, 40 | TopSellerComponent, 41 | SafeUrlPipe, 42 | DateAgoPipe, 43 | ], 44 | }) 45 | export class SharedModule {} 46 | -------------------------------------------------------------------------------- /src/app/pages/auth/reset-password/reset-password.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |
7 |
8 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | 23 | Already have an account? Sign In! 24 |
25 |
26 |
27 |
28 | 29 |
30 |
-------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | NFT Marketplace 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/app/pages/auth/forgot-password/forgot-password.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |
7 |
8 | 11 | 12 |
13 | 14 | 15 |
16 | 17 |
18 | 19 | 20 |
21 | 22 | 23 | 24 | We will send a password to your Email 25 | Already have an account? Sign In! 26 |
27 |
28 |
29 |
30 | 31 |
32 |
-------------------------------------------------------------------------------- /src/app/pages/auth/forgot-password/forgot-password.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormBuilder, FormGroup, Validators} from '@angular/forms'; 3 | import { AuthenticationService, UtilityService } from '../../../_services'; 4 | import { Router } from '@angular/router'; 5 | 6 | @Component({ 7 | templateUrl: './forgot-password.component.html', 8 | styleUrls: ['./forgot-password.component.css'] 9 | }) 10 | export class ForgotPasswordComponent implements OnInit { 11 | 12 | constructor(private authService: AuthenticationService, private utility: UtilityService, private formBuilder: FormBuilder, private router: Router) { 13 | 14 | this.utility.updatePageSEO( 15 | 'Forgot Password | NFT Marketplace', 16 | 'Forgot Password | NFT Marketplace', 17 | '', 18 | '' 19 | ); 20 | } 21 | 22 | form: FormGroup; 23 | 24 | ngOnInit(): void { 25 | 26 | this.form = this.formBuilder.group({ 27 | email: [null, [Validators.required, Validators.email, Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$')]] 28 | }); 29 | } 30 | 31 | get getForm() { 32 | return this.form.controls; 33 | } 34 | 35 | submitAction() { 36 | if (this.form.valid) { 37 | this.utility.startLoader() 38 | this.authService.sendPasswordResetEmail(this.form.value.email).subscribe( 39 | (res) => { 40 | this.utility.stopLoader() 41 | this.utility.showSuccessAlert('Success!', 'Email Sent successfully', ); 42 | this.form.reset() 43 | }, 44 | (error) => { 45 | this.utility.stopLoader() 46 | this.utility.showErrorAlert('Error', error); 47 | } 48 | ); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/assets/img/avatar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/app/pages/main/main.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ElementRef } from '@angular/core'; 2 | declare var $: any; 3 | @Component({ 4 | selector: 'app-main', 5 | templateUrl: './main.component.html', 6 | styleUrls: ['./main.component.css'] 7 | }) 8 | export class MainComponent implements OnInit { 9 | 10 | constructor( private elementRef: ElementRef ) { } 11 | 12 | ngOnInit(): void { 13 | } 14 | 15 | ngAfterViewInit(): void { 16 | // $(this.elementRef.nativeElement).find('[data-toggle="tooltip"]').tooltip(); 17 | $('body').tooltip({ 18 | selector: '.tooltp' 19 | }); 20 | 21 | $(document).mouseup(function(e) { 22 | var container = $('.nav-item .dropdown-box'); 23 | // if the target of the click isn't the container nor a descendant of the container 24 | if (!container.is(e.target) && container.has(e.target).length === 0) { 25 | $('.nav-item .dropdown-box').fadeOut(); 26 | } 27 | 28 | $('.header__btn').unbind() 29 | .click(function () { 30 | console.log('click1'); 31 | 32 | $(this).toggleClass('header__btn--active'); 33 | $('.header__menu').toggleClass('header__menu--active'); 34 | }); 35 | 36 | $('.nav-action') 37 | .unbind() 38 | .click(function () { 39 | console.log('click'); 40 | $('.header__btn').toggleClass('header__btn--active'); 41 | $('.header__menu').toggleClass('header__menu--active'); 42 | }); 43 | 44 | $('.header__search .close, .header__action--search button').on( 45 | 'click', 46 | function () { 47 | $('.header__search').toggleClass('header__search--active'); 48 | } 49 | ); 50 | }); 51 | 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/app/pages/main/nft-preview/nft-preview.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { NftService, UtilityService, ConnectService } from '../../../_services'; 3 | import { Router, ActivatedRoute } from '@angular/router'; 4 | declare var $: any; 5 | import { environment } from './../../../../environments/environment'; 6 | 7 | @Component({ 8 | templateUrl: './nft-preview.component.html', 9 | styleUrls: ['./nft-preview.component.css'], 10 | }) 11 | export class NftPreviewComponent implements OnInit { 12 | constructor( 13 | private nftService: NftService, 14 | private utility: UtilityService, 15 | private router: Router, 16 | private activatedRoute: ActivatedRoute, 17 | private connectService: ConnectService 18 | ) {} 19 | 20 | // get user id from localstorage 21 | userId = JSON.parse(localStorage.getItem('user')) 22 | ? JSON.parse(localStorage.getItem('user'))['id'] 23 | : ''; 24 | user = JSON.parse(localStorage.getItem('user')) 25 | ? JSON.parse(localStorage.getItem('user')) 26 | : ''; 27 | imgBaseUrl = environment.IMG_BASE_URL; 28 | nft: any = {}; 29 | 30 | ngOnInit(): void { 31 | this.getNftById(); 32 | } 33 | 34 | getNftById() { 35 | this.utility.startLoader(); 36 | this.nftService 37 | .getNftById(this.activatedRoute.snapshot.paramMap.get('product_id')) 38 | .subscribe( 39 | (res) => { 40 | this.nft = res; 41 | this.utility.updatePageSEO( 42 | this.nft.name + ' | NFT Marketplace', 43 | this.nft.description 44 | ); 45 | this.utility.stopLoader(); 46 | }, 47 | (error) => { 48 | console.log(error); 49 | this.utility.stopLoader(); 50 | this.utility.showErrorAlert('Error', error); 51 | } 52 | ); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/assets/img/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/_helpers/jwt.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { 3 | HttpRequest, 4 | HttpHandler, 5 | HttpEvent, 6 | HttpInterceptor, 7 | HttpHeaders, 8 | } from '@angular/common/http'; 9 | import { Observable } from 'rxjs'; 10 | import { environment } from 'src/environments/environment'; 11 | 12 | @Injectable() 13 | export class JwtInterceptor implements HttpInterceptor { 14 | public headers: HttpHeaders; 15 | intercept( 16 | request: HttpRequest, 17 | next: HttpHandler 18 | ): Observable> { 19 | 20 | if ( 21 | 22 | request.url.includes(environment.API_BASE_URL) || 23 | request.url.includes(environment.IMG_BASE_URL) 24 | // request.url.includes('https://memeexhibit.com/api') || 25 | // request.url.includes('https://api.memeexhibit.com') || 26 | // request.url.includes('http://localhost:3001') || 27 | // request.url.includes('http://localhost:3000') || 28 | // request.url.includes('http://15.207.100.113:3001') || 29 | // request.url.includes('http://147.182.187.164:3001') 30 | ) { 31 | // append headers 32 | this.headers = new HttpHeaders(); 33 | this.headers.set('Content-Type', 'application/json'); 34 | this.headers.set('Access-Control-Allow-Origin', '*'); 35 | this.headers.set( 36 | 'Access-Control-Allow-Headers', 37 | 'Origin, Authorization, Content-Type, Accept' 38 | ); 39 | 40 | request = request.clone({ 41 | headers: this.headers, 42 | }); 43 | 44 | const currentUser = JSON.parse(localStorage.getItem('user')); 45 | if (currentUser && currentUser.token) { 46 | request = request.clone({ 47 | setHeaders: { 48 | Authorization: `Bearer ${currentUser.token}`, 49 | }, 50 | }); 51 | } 52 | // add authorization header with jwt token if available 53 | } 54 | 55 | return next.handle(request); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/app/pages/main/contact/contact.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ContactService, UtilityService } from '../../../_services'; 3 | import { Router, ActivatedRoute } from '@angular/router'; 4 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 5 | import Swal from 'sweetalert2'; 6 | @Component({ 7 | templateUrl: './contact.component.html', 8 | styleUrls: ['./contact.component.css'], 9 | }) 10 | export class ContactComponent implements OnInit { 11 | constructor( 12 | private _ContactService: ContactService, 13 | private utility: UtilityService, 14 | private router: Router, 15 | private activatedRoute: ActivatedRoute, 16 | private formBuilder: FormBuilder 17 | ) { 18 | this.utility.updatePageSEO( 19 | 'Contact Us | Buy and Sell your NFT, and NFT Money. NFT Collections, Crypto artworks.', 20 | 'At Defy, we work every day to solve NFT Trading problems.' 21 | ); 22 | } 23 | 24 | contactForm: FormGroup; 25 | 26 | ngOnInit(): void { 27 | this.contactForm = this.formBuilder.group({ 28 | name: [null, Validators.required], 29 | email: [null, Validators.required], 30 | subject: [null, Validators.required], 31 | message: [null, Validators.required], 32 | }); 33 | } 34 | 35 | get getContactForm() { 36 | return this.contactForm.controls; 37 | } 38 | 39 | sendContactRequest() { 40 | this.utility.startLoader(); 41 | this._ContactService.createContact(this.contactForm.value).subscribe( 42 | (res) => { 43 | this.contactForm.reset() 44 | this.utility.stopLoader(); 45 | Swal.fire({ 46 | icon: 'success', 47 | title: 'Congratulations!', 48 | text: 'Your request has been submitted successfully. We will get back to you.', 49 | }); 50 | }, 51 | (error) => { 52 | this.utility.stopLoader(); 53 | this.utility.showErrorAlert('Error', error); 54 | } 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/app/_components/error-field/error-field.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | import { TranslateService } from '@ngx-translate/core'; 3 | import { FormBuilder, FormGroup, Validators, AbstractControl} from '@angular/forms'; 4 | 5 | @Component({ 6 | selector: 'app-error-field', 7 | templateUrl: './error-field.component.html', 8 | styleUrls: ['./error-field.component.css'] 9 | }) 10 | export class ErrorFieldComponent implements OnInit { 11 | @Input() errorMsg: any; 12 | constructor() { } 13 | 14 | ngOnInit(): void { 15 | 16 | } 17 | 18 | getErrorMessage(response) { 19 | if(response.touched){ 20 | if (response.errors.required) { 21 | return 'This field is required'; 22 | } else if (response.errors.pattern) { 23 | return 'This field should be in valid format'; 24 | } else if (response.errors.minlength) { 25 | return `${this.getControlName(response)} should be minimum ${ 26 | response.errors.minlength.requiredLength 27 | } character`; 28 | } else if (response.errors.max) { 29 | return `${this.getControlName(response)} should be maximum ${ 30 | response.errors.max.max 31 | }`; 32 | } else if (response.errors.min) { 33 | return `${this.getControlName(response)} should be minimum ${ 34 | response.errors.min.min 35 | }`; 36 | } else if (response.errors.mustMatch) { 37 | return `Password & Confirm password does not match`; 38 | } 39 | } 40 | } 41 | 42 | getControlName(c: AbstractControl): string | null { 43 | const formGroup = c.parent.controls; 44 | return this.titleCase(Object.keys(formGroup).find(name => c === formGroup[name])) || null; 45 | } 46 | 47 | titleCase(string) { 48 | var sentence = string.toLowerCase().split("_"); 49 | for (let i = 0; i < sentence.length; i++) { 50 | sentence[i] = sentence[i][0].toUpperCase() + sentence[i].slice(1); 51 | } 52 | 53 | return sentence.join(" "); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/app/pages/auth/auth.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |
7 | 8 |
9 | 12 | 13 |
14 | 15 | 16 |
17 | 18 |
19 | 20 | 21 |
22 | 23 |
24 | 25 | 26 |
27 | 28 | 29 | 30 | Don't have an account? Sign up! 31 | 32 | Forgot password? 33 |
34 | 35 |
36 |
37 |
38 | 39 |
40 |
-------------------------------------------------------------------------------- /src/app/_services/user.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { DomSanitizer } from '@angular/platform-browser'; 3 | import { HttpClient } from '@angular/common/http'; 4 | import { map } from 'rxjs/operators'; 5 | import { environment } from '../../environments/environment'; 6 | 7 | @Injectable() 8 | export class UserService { 9 | public readonly apiUrl = environment.API_BASE_URL; 10 | 11 | constructor(public http: HttpClient, public sanitizer: DomSanitizer) { 12 | // set token if saved in local storage 13 | } 14 | 15 | // Get user by id 16 | getUserById(userId: String) { 17 | return this.http.get(`${this.apiUrl}users/${userId}`).pipe( 18 | map((response: Response) => { 19 | return response; 20 | }) 21 | ); 22 | } 23 | 24 | // Get user profile 25 | getUserProfileInfo(walletAddress: string) { 26 | return this.http 27 | .get(`${this.apiUrl}users/user-profile?walletAddress=${walletAddress}`) 28 | .pipe( 29 | map((response: Response) => { 30 | return response; 31 | }) 32 | ); 33 | } 34 | 35 | // Add New User 36 | updateUser(userId: String, userBody: Object) { 37 | return this.http.patch(`${this.apiUrl}users/${userId}`, userBody).pipe( 38 | map((response: Response) => { 39 | return response; 40 | }) 41 | ); 42 | } 43 | 44 | // Add Picture 45 | uploadPicture(file: File, type: any) { 46 | var fd = new FormData(); 47 | fd.append('file', file); 48 | fd.append('type', type); 49 | return this.http.post(`${this.apiUrl}users/update-picture`, fd).pipe( 50 | map((response: Response) => { 51 | return response; 52 | }) 53 | ); 54 | } 55 | 56 | // get setting info 57 | getSettingInfo() { 58 | return this.http.get(`${this.apiUrl}users/get-admin-setting`).pipe( 59 | map((response: Response) => { 60 | return response; 61 | }) 62 | ); 63 | } 64 | 65 | // get setting info 66 | getArtistProfile(userId) { 67 | return this.http 68 | .get(`${this.apiUrl}users/get-artist-profile/${userId}`) 69 | .pipe( 70 | map((response: Response) => { 71 | return response; 72 | }) 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/app/_services/utility.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, Output, EventEmitter } from '@angular/core'; 2 | import { ToastrService } from 'ngx-toastr'; 3 | import { TranslateService } from '@ngx-translate/core'; 4 | import { NgxUiLoaderService } from "ngx-ui-loader"; 5 | import { PageService } from 'ngx-seo-page'; 6 | declare var $: any; 7 | 8 | @Injectable({ 9 | providedIn: 'root' 10 | }) 11 | export class UtilityService { 12 | 13 | @Output() loader_callback: EventEmitter = new EventEmitter(); 14 | constructor(public toastr: ToastrService, public translate: TranslateService, public loader: NgxUiLoaderService, private seoService: PageService) { } 15 | 16 | getItem(key) { 17 | return localStorage.getItem(key); 18 | } 19 | 20 | setItem(key, value) { 21 | localStorage.setItem(key, value); 22 | } 23 | 24 | deleteItem(key) { 25 | localStorage.removeItem(key) 26 | } 27 | 28 | startLoader(text = 'Loading...') { 29 | this.loader_callback.emit(text); 30 | this.loader.start(); 31 | } 32 | 33 | stopLoader() { 34 | this.loader.stop(); 35 | } 36 | 37 | stopLoaderWithTableReload() { 38 | $("#datatable").dataTable().fnDestroy() 39 | this.loader.stop(); 40 | setTimeout(() => { 41 | $('#datatable').DataTable({ordering: false, lengthChange: true, paging: true }); 42 | }, 1000); 43 | } 44 | 45 | setDefaultLocale(locale) { 46 | this.translate.setDefaultLang(locale) 47 | } 48 | 49 | getLocale(string) { 50 | this.translate.get(string) 51 | } 52 | 53 | updatePageSEO(title, name, url = '', image = '') { 54 | this.seoService.updatePage({ 55 | title: title, 56 | schema: { 57 | '@type': 'WebSite', 58 | name: name, 59 | url: window.location.host, 60 | }, 61 | metatags: [ 62 | { name: 'description', content: name }, 63 | { property: 'og:url', content: url }, 64 | { property: 'og:title', content: title }, 65 | ], 66 | canonical: window.location.host, 67 | }); 68 | } 69 | 70 | showSuccessAlert(title = 'Success', description) { 71 | this.toastr.success(description, title); 72 | } 73 | 74 | showErrorAlert(title = 'Error', description) { 75 | this.toastr.error(description, title); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/app/pages/auth/register/register.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormBuilder, FormGroup, Validators} from '@angular/forms'; 3 | import { AuthenticationService, UtilityService } from '../../../_services'; 4 | import { Router } from '@angular/router'; 5 | 6 | 7 | @Component({ 8 | templateUrl: './register.component.html', 9 | styleUrls: ['./register.component.css'] 10 | }) 11 | export class RegisterComponent implements OnInit { 12 | 13 | constructor(private authService: AuthenticationService, private utility: UtilityService, private formBuilder: FormBuilder, private router: Router) { 14 | 15 | this.utility.updatePageSEO( 16 | 'Register | NFT Marketplace', 17 | 'Register | NFT Marketplace', 18 | '', 19 | '' 20 | ); 21 | } 22 | 23 | form: FormGroup; 24 | 25 | ngOnInit(): void { 26 | 27 | this.form = this.formBuilder.group({ 28 | name: [null, [Validators.required]], 29 | email: [ 30 | null, 31 | [ 32 | Validators.required, 33 | Validators.email, 34 | Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$'), 35 | ], 36 | ], 37 | password: [null, Validators.required], 38 | terms: [null, [Validators.required]], 39 | role: ['user', [Validators.required]], 40 | // fb_link: [null, [Validators.required]], 41 | // twitter_link: [null, [Validators.required]], 42 | // opensea_link: [null, [Validators.required]], 43 | }); 44 | 45 | // this.getAccountAndBalance() 46 | 47 | 48 | } 49 | 50 | get getForm() { 51 | return this.form.controls; 52 | } 53 | 54 | registerAction() { 55 | if (this.form.valid) { 56 | this.utility.startLoader() 57 | this.authService.register(this.form.value.name, this.form.value.email, this.form.value.password, this.form.value.role).subscribe( 58 | (res) => { 59 | this.utility.stopLoader() 60 | this.utility.showSuccessAlert('Success!', 'User has been registered successfully! Please check your email for email verification' ); 61 | this.router.navigate(['auth/login']); 62 | }, 63 | (error) => { 64 | this.utility.stopLoader() 65 | this.utility.showErrorAlert('Error', error); 66 | } 67 | ); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/app/pages/main/main.module.ts: -------------------------------------------------------------------------------- 1 | import { SharedModule } from './../../_components/shared/shared.module'; 2 | import { NgModule } from '@angular/core'; 3 | import { CommonModule } from '@angular/common'; 4 | import { MainRoutingModule } from './main-routing.module'; 5 | import { MainComponent } from './main.component'; 6 | import { HomeComponent } from './home/home.component'; 7 | import { RouterModule } from '@angular/router'; 8 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 9 | import { AvatarModule } from 'ngx-avatar'; 10 | import { MarketplaceComponent } from './marketplace/marketplace.component'; 11 | import { NgxPaginationModule } from 'ngx-pagination'; 12 | import { ContactComponent } from './contact/contact.component'; 13 | import { AboutUsComponent } from './about-us/about-us.component'; 14 | import { BlogsComponent } from './blogs/blogs.component'; 15 | import { ProfileComponent } from './profile/profile.component'; 16 | import { SafeHtmlPipe } from '../../_pipe/safe-html.pipe'; 17 | import { FaqComponent } from './faq/faq.component'; 18 | import { PrivacyPolicyComponent } from './privacy-policy/privacy-policy.component'; 19 | import { TermConditionComponent } from './term-condition/term-condition.component'; 20 | import { CreateNftComponent } from './create-nft/create-nft.component'; 21 | import { NftDetailComponent } from './nft-detail/nft-detail.component'; 22 | import { NftPreviewComponent } from './nft-preview/nft-preview.component'; 23 | import { SearchResultComponent } from './search-result/search-result.component'; 24 | import { ArtistProfileComponent } from './artist-profile/artist-profile.component'; 25 | @NgModule({ 26 | declarations: [ 27 | MainComponent, 28 | HomeComponent, 29 | MarketplaceComponent, 30 | ContactComponent, 31 | AboutUsComponent, 32 | BlogsComponent, 33 | ProfileComponent, 34 | SafeHtmlPipe, 35 | FaqComponent, 36 | PrivacyPolicyComponent, 37 | TermConditionComponent, 38 | CreateNftComponent, 39 | NftDetailComponent, 40 | NftPreviewComponent, 41 | SearchResultComponent, 42 | ArtistProfileComponent, 43 | ], 44 | imports: [ 45 | CommonModule, 46 | RouterModule, 47 | FormsModule, 48 | ReactiveFormsModule, 49 | MainRoutingModule, 50 | SharedModule, 51 | AvatarModule, 52 | NgxPaginationModule, 53 | ], 54 | }) 55 | export class MainModule {} 56 | -------------------------------------------------------------------------------- /src/app/_components/live-auction/live-auction.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | declare var $: any; 3 | import { NftService, UtilityService } from '../../_services'; 4 | import { NgxSpinnerService } from 'ngx-spinner'; 5 | import { environment } from 'src/environments/environment'; 6 | @Component({ 7 | selector: 'app-live-auction', 8 | templateUrl: './live-auction.component.html', 9 | styleUrls: ['./live-auction.component.css'], 10 | }) 11 | export class LiveAuctionComponent implements OnInit { 12 | constructor( 13 | private nftService: NftService, 14 | private utility: UtilityService, 15 | private spinner: NgxSpinnerService 16 | ) {} 17 | 18 | nfts: any = []; 19 | currentDate = new Date(); 20 | baseImageUrl = environment.IMG_BASE_URL; 21 | 22 | ngOnInit(): void { 23 | this.spinner.show(); 24 | } 25 | 26 | ngAfterViewInit(): void { 27 | this.getAllNfts(); 28 | } 29 | 30 | reloadCarousel() { 31 | $('.main__carousel--live').owlCarousel({ 32 | mouseDrag: true, 33 | touchDrag: true, 34 | dots: true, 35 | loop: false, 36 | autoplay: true, 37 | autoplayHoverPause: true, 38 | autoplayTimeout: 5000, 39 | smartSpeed: 600, 40 | margin: 20, 41 | autoHeight: true, 42 | responsive: { 43 | 0: { 44 | items: 1, 45 | }, 46 | 576: { 47 | items: 2, 48 | }, 49 | 768: { 50 | items: 3, 51 | margin: 30, 52 | }, 53 | 992: { 54 | items: 4, 55 | margin: 30, 56 | }, 57 | 1200: { 58 | items: 4, 59 | margin: 30, 60 | mouseDrag: false, 61 | dots: false, 62 | }, 63 | }, 64 | }); 65 | } 66 | 67 | getAllNfts() { 68 | var self = this; 69 | this.utility.startLoader(); 70 | this.nftService.getNfts(true).subscribe( 71 | (res) => { 72 | this.nfts = res; 73 | this.utility.stopLoader(); 74 | setTimeout(() => { 75 | this.reloadCarousel(); 76 | this.spinner.hide(); 77 | }, 5000); 78 | }, 79 | (error) => { 80 | this.utility.stopLoader(); 81 | this.utility.showErrorAlert('Error', error); 82 | } 83 | ); 84 | } 85 | 86 | convertDate(date) { 87 | return new Date(date); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/app/pages/auth/reset-password/reset-password.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormBuilder, FormGroup, Validators} from '@angular/forms'; 3 | import { AuthenticationService, UtilityService } from '../../../_services'; 4 | import { Router, ActivatedRoute } from '@angular/router'; 5 | import { MustMatch } from '../../../_helpers/mustMatch.validator'; 6 | @Component({ 7 | templateUrl: './reset-password.component.html', 8 | styleUrls: ['./reset-password.component.css'] 9 | }) 10 | export class ResetPasswordComponent implements OnInit { 11 | 12 | constructor(private authService: AuthenticationService, private utility: UtilityService, private formBuilder: FormBuilder, private router: Router, private activatedRoute: ActivatedRoute) { 13 | 14 | this.utility.updatePageSEO( 15 | 'Reset Password | NFT Marketplace', 16 | 'Reset Password | NFT Marketplace', 17 | '', 18 | '' 19 | ); 20 | } 21 | 22 | public form: FormGroup; 23 | public token: string = ''; 24 | 25 | ngOnInit(): void { 26 | 27 | if (this.activatedRoute.snapshot.queryParamMap.get('token')) { 28 | this.token = this.activatedRoute.snapshot.queryParamMap.get('token'); 29 | } else { 30 | this.utility.showErrorAlert('Error', 'Something Went wrong'); 31 | this.router.navigate(['auth/login']); 32 | } 33 | 34 | this.form = this.formBuilder.group({ 35 | password: ['', [Validators.required, Validators.minLength(6)]], 36 | confirm_password: ['', [Validators.required, Validators.minLength(6)]], 37 | }, 38 | { 39 | validator: [MustMatch('password', 'confirm_password')], 40 | }); 41 | } 42 | 43 | get getForm() { 44 | return this.form.controls; 45 | } 46 | 47 | submitAction() { 48 | if (this.form.valid) { 49 | this.utility.startLoader() 50 | this.authService.resetPassword(this.form.value.password, this.token).subscribe( 51 | (res) => { 52 | this.utility.stopLoader() 53 | this.form.reset() 54 | this.utility.showSuccessAlert('Success!', 'Your Password has been reset successfully', ); 55 | this.router.navigate(['auth/login']); 56 | }, 57 | (error) => { 58 | this.utility.stopLoader() 59 | this.utility.showErrorAlert('Error', error); 60 | } 61 | ); 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/app/_components/countdown/countdown.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy, Input } from '@angular/core'; 2 | import { Subscription, interval } from 'rxjs'; 3 | 4 | @Component({ 5 | selector: 'app-countdown', 6 | templateUrl: './countdown.component.html', 7 | styleUrls: ['./countdown.component.css'], 8 | }) 9 | export class CountdownComponent implements OnInit { 10 | private subscription: Subscription; 11 | 12 | @Input() expiry = ''; 13 | @Input() type = 'large'; 14 | 15 | 16 | 17 | 18 | public dateNow = new Date(); 19 | public dDay = new Date(this.expiry); 20 | milliSecondsInASecond = 1000; 21 | hoursInADay = 24; 22 | minutesInAnHour = 60; 23 | SecondsInAMinute = 60; 24 | 25 | public timeDifference; 26 | public secondsToDday; 27 | public minutesToDday; 28 | public hoursToDday; 29 | public daysToDday; 30 | 31 | private getTimeDifference() { 32 | this.timeDifference = this.dDay.getTime() - new Date().getTime(); 33 | this.allocateTimeUnits(this.timeDifference); 34 | } 35 | 36 | private allocateTimeUnits(timeDifference) { 37 | if (timeDifference > 0){ 38 | this.secondsToDday = Math.floor( 39 | (timeDifference / this.milliSecondsInASecond) % this.SecondsInAMinute 40 | ); 41 | this.minutesToDday = Math.floor( 42 | (timeDifference / (this.milliSecondsInASecond * this.minutesInAnHour)) % 43 | this.SecondsInAMinute 44 | ); 45 | this.hoursToDday = Math.floor( 46 | (timeDifference / 47 | (this.milliSecondsInASecond * 48 | this.minutesInAnHour * 49 | this.SecondsInAMinute)) % 50 | this.hoursInADay 51 | ); 52 | this.daysToDday = Math.floor( 53 | timeDifference / 54 | (this.milliSecondsInASecond * 55 | this.minutesInAnHour * 56 | this.SecondsInAMinute * 57 | this.hoursInADay) 58 | ); 59 | } else { 60 | this.secondsToDday = 0 61 | this.minutesToDday = 0; 62 | this.hoursToDday = 0; 63 | this.daysToDday = 0; 64 | window.location.reload() 65 | } 66 | } 67 | 68 | ngOnInit() { 69 | console.log(this.expiry); 70 | console.log(new Date(this.expiry)); 71 | this.dDay = new Date(this.expiry); 72 | this.subscription = interval(1000).subscribe((x) => { 73 | this.getTimeDifference(); 74 | }); 75 | } 76 | 77 | ngOnDestroy() { 78 | this.subscription.unsubscribe(); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/app/_services/nft.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { map } from 'rxjs/operators'; 4 | import { environment } from '../../environments/environment'; 5 | 6 | @Injectable({ 7 | providedIn: 'root', 8 | }) 9 | export class NftService { 10 | public readonly apiUrl = environment.API_BASE_URL; 11 | // get user id from localstorage 12 | userId = JSON.parse(localStorage.getItem('user')) 13 | ? JSON.parse(localStorage.getItem('user'))['id'] 14 | : ''; 15 | constructor(public http: HttpClient) {} 16 | 17 | // create New Nft 18 | createNft(nftBody: Object) { 19 | return this.http.post(`${this.apiUrl}nfts`, nftBody).pipe( 20 | map((response: Response) => { 21 | return response; 22 | }) 23 | ); 24 | } 25 | 26 | // buy New Nft 27 | buyNft(nftBody: Object) { 28 | return this.http.post(`${this.apiUrl}nfts/buy-nft`, nftBody).pipe( 29 | map((response: Response) => { 30 | return response; 31 | }) 32 | ); 33 | } 34 | 35 | // search Nft 36 | searchNft(text: String) { 37 | return this.http.get(`${this.apiUrl}nfts/search-nft/${text}`).pipe( 38 | map((response: Response) => { 39 | return response; 40 | }) 41 | ); 42 | } 43 | 44 | // Get all nft list role wise 45 | getNfts(isFeatured : boolean = false) { 46 | return this.http 47 | .get(`${this.apiUrl}nfts/available?isFeatured=${isFeatured}`) 48 | .pipe( 49 | map((response: Response) => { 50 | return response; 51 | }) 52 | ); 53 | } 54 | 55 | // Get nft by id 56 | getNftById(nftId: String) { 57 | return this.http.get(`${this.apiUrl}nfts/${nftId}`).pipe( 58 | map((response: Response) => { 59 | return response; 60 | }) 61 | ); 62 | } 63 | 64 | // update Nft 65 | updateNft(nftId: String, nftBody: Object) { 66 | return this.http.patch(`${this.apiUrl}nfts/${nftId}`, nftBody).pipe( 67 | map((response: Response) => { 68 | return response; 69 | }) 70 | ); 71 | } 72 | 73 | // check nft status 74 | checkNftStatus(nftId: String) { 75 | return this.http.get(`${this.apiUrl}nfts/check-nft-status/${nftId}`).pipe( 76 | map((response: Response) => { 77 | return response; 78 | }) 79 | ); 80 | } 81 | 82 | // release nft 83 | releaseNft(nftId: String) { 84 | return this.http.get(`${this.apiUrl}nfts/release-nft/${nftId}`).pipe( 85 | map((response: Response) => { 86 | return response; 87 | }) 88 | ); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ajeet-nft-marketplace", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "node web3-patch.js && ng build", 8 | "prod": "node web3-patch.js && ng build --prod", 9 | "config": "ts-node ./scripts/setenv.ts", 10 | "test": "ng test", 11 | "lint": "ng lint", 12 | "e2e": "ng e2e", 13 | "postinstall": "node web3-patch.js" 14 | }, 15 | "private": true, 16 | "dependencies": { 17 | "@angular/animations": "~11.1.1", 18 | "@angular/common": "~11.1.1", 19 | "@angular/compiler": "~11.1.1", 20 | "@angular/core": "~11.1.1", 21 | "@angular/forms": "~11.1.1", 22 | "@angular/platform-browser": "~11.1.1", 23 | "@angular/platform-browser-dynamic": "~11.1.1", 24 | "@angular/router": "~11.1.1", 25 | "@ngx-translate/core": "^13.0.0", 26 | "@ngx-translate/http-loader": "^6.0.0", 27 | "async": "^3.2.0", 28 | "ethers": "^5.4.0", 29 | "file-saver": "^2.0.5", 30 | "ipfs-http-client": "^49.0.4", 31 | "jquery": "^3.4.1", 32 | "moralis": "0.0.32", 33 | "ngx-avatar": "^4.1.0", 34 | "ngx-pagination": "^5.1.0", 35 | "ngx-seo-page": "^2.0.2", 36 | "ngx-spinner": "11.0.2", 37 | "ngx-toastr": "^13.2.1", 38 | "ngx-ui-loader": "^11.0.0", 39 | "rxjs": "~6.6.0", 40 | "sweetalert2": "^11.0.16", 41 | "tslib": "^2.0.0", 42 | "web3": "^1.3.6", 43 | "web3modal": "^1.9.5", 44 | "xlsx": "^0.16.9", 45 | "zone.js": "~0.11.3" 46 | }, 47 | "devDependencies": { 48 | "@angular-builders/custom-webpack": "^11.1.1", 49 | "@angular-builders/dev-server": "^7.3.1", 50 | "@angular-devkit/build-angular": "~0.1101.2", 51 | "@angular/cli": "~11.1.2", 52 | "@angular/compiler-cli": "~11.1.1", 53 | "@angular/localize": "^11.1.2", 54 | "@types/core-js": "^2.5.4", 55 | "@types/datatables.net": "^1.10.18", 56 | "@types/jasmine": "~3.6.0", 57 | "@types/jquery": "^3.5.5", 58 | "@types/node": "^12.11.1", 59 | "codelyzer": "^6.0.0", 60 | "dotenv": "^10.0.0", 61 | "jasmine-core": "~3.6.0", 62 | "jasmine-spec-reporter": "~5.0.0", 63 | "karma": "~5.2.0", 64 | "karma-chrome-launcher": "~3.1.0", 65 | "karma-coverage": "~2.0.3", 66 | "karma-jasmine": "~4.0.0", 67 | "karma-jasmine-html-reporter": "^1.5.0", 68 | "protractor": "~7.0.0", 69 | "ts-node": "~8.3.0", 70 | "tslint": "~6.1.0", 71 | "typescript": "~4.1.2", 72 | "yargs": "^17.1.1" 73 | }, 74 | "browser": { 75 | "http": false, 76 | "https": false, 77 | "net": false, 78 | "fs": false, 79 | "path": false, 80 | "stream": false, 81 | "tls": false, 82 | "crypto": false 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { RouterModule } from '@angular/router'; 4 | import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http'; 5 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 6 | import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; 7 | import { TranslateHttpLoader } from '@ngx-translate/http-loader'; 8 | import { NgxUiLoaderModule, NgxUiLoaderConfig, 9 | SPINNER, 10 | POSITION, 11 | PB_DIRECTION 12 | } from "ngx-ui-loader"; 13 | 14 | 15 | const ngxUiLoaderConfig: NgxUiLoaderConfig = { 16 | fgsColor: "white", 17 | pbColor: "white", 18 | pbDirection: PB_DIRECTION.leftToRight, // progress bar direction 19 | pbThickness: 5, // progress bar thickness 20 | }; 21 | 22 | import { AppRoutingModule } from './app-routing.module'; 23 | import { AppComponent } from './app.component'; 24 | export function HttpLoaderFactory(http: HttpClient) { 25 | return new TranslateHttpLoader(http); 26 | } 27 | 28 | 29 | import { ToastrModule } from 'ngx-toastr'; 30 | // all guards 31 | import { AuthGuard } from './_guards/auth.guard'; 32 | // all intercepters 33 | import { JwtInterceptor, ErrorInterceptor } from './_helpers'; 34 | 35 | // All Services 36 | import { AuthenticationService, UtilityService, UserService } from './_services/index'; 37 | import { NotFoundComponent } from './pages/not-found/not-found.component'; 38 | import { TwoDigitDecimalDirective } from './_directives/two-digit-decimal.directive'; 39 | 40 | @NgModule({ 41 | declarations: [ 42 | AppComponent, 43 | NotFoundComponent, 44 | TwoDigitDecimalDirective 45 | ], 46 | imports: [ 47 | BrowserModule, 48 | RouterModule, 49 | AppRoutingModule, 50 | HttpClientModule, 51 | TranslateModule.forRoot({ 52 | defaultLanguage: 'en', 53 | loader: { 54 | provide: TranslateLoader, 55 | useFactory: HttpLoaderFactory, 56 | deps: [HttpClient] 57 | } 58 | }), 59 | NgxUiLoaderModule.forRoot(ngxUiLoaderConfig), 60 | ToastrModule.forRoot({ 61 | timeOut: 2000, 62 | positionClass: 'toast-top-right', 63 | preventDuplicates: true, 64 | }), // ToastrModule added 65 | BrowserAnimationsModule 66 | ], 67 | providers: [ 68 | { provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true }, 69 | { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true }, 70 | AuthGuard, 71 | AuthenticationService, 72 | UtilityService, 73 | UserService 74 | ], 75 | bootstrap: [AppComponent], 76 | exports: [AppComponent] 77 | }) 78 | export class AppModule { } 79 | -------------------------------------------------------------------------------- /src/app/pages/main/main-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { HomeComponent } from './home/home.component'; 2 | import { NgModule } from '@angular/core'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { MainComponent } from './main.component'; 5 | import { MarketplaceComponent } from './marketplace/marketplace.component'; 6 | import { ContactComponent } from './contact/contact.component'; 7 | import { AboutUsComponent } from './about-us/about-us.component'; 8 | import { BlogsComponent } from './blogs/blogs.component'; 9 | import { ProfileComponent } from './profile/profile.component'; 10 | import { AuthGuard } from 'src/app/_guards/auth.guard'; 11 | import { ArtistGuard } from 'src/app/_guards/artist.guard'; 12 | import { FaqComponent } from './faq/faq.component'; 13 | import { PrivacyPolicyComponent } from './privacy-policy/privacy-policy.component'; 14 | import { TermConditionComponent } from './term-condition/term-condition.component'; 15 | import { CreateNftComponent } from './create-nft/create-nft.component'; 16 | import { NftDetailComponent } from './nft-detail/nft-detail.component'; 17 | import { NftPreviewComponent } from './nft-preview/nft-preview.component'; 18 | import { SearchResultComponent } from './search-result/search-result.component'; 19 | import { ArtistProfileComponent } from './artist-profile/artist-profile.component'; 20 | 21 | 22 | const routes: Routes = [ 23 | { 24 | path: '', 25 | component: MainComponent, 26 | children: [ 27 | { path: '', component: HomeComponent }, 28 | { path: 'home', component: HomeComponent }, 29 | { path: 'blogs', component: BlogsComponent }, 30 | { path: 'about-us', component: AboutUsComponent }, 31 | { path: 'contact-us', component: ContactComponent }, 32 | { path: 'faq', component: FaqComponent }, 33 | { 34 | path: 'create-nft', 35 | canActivate: [ArtistGuard], 36 | component: CreateNftComponent, 37 | }, 38 | { path: 'privacy-policy', component: PrivacyPolicyComponent }, 39 | { path: 'terms-condition', component: TermConditionComponent }, 40 | { path: 'marketplace', component: MarketplaceComponent }, 41 | { path: 'marketplace/:product_id', component: NftDetailComponent }, 42 | { path: 'artist-profile/:artist_id', component: ArtistProfileComponent }, 43 | { path: 'search/:term', component: SearchResultComponent }, 44 | { 45 | path: 'manage-profile', 46 | canActivate: [AuthGuard], 47 | component: ProfileComponent, 48 | }, 49 | { path: 'my-nft/:product_id', component: NftPreviewComponent }, 50 | ], 51 | }, 52 | ]; 53 | 54 | @NgModule({ 55 | imports: [RouterModule.forChild(routes)], 56 | exports: [RouterModule] 57 | }) 58 | export class MainRoutingModule { } 59 | -------------------------------------------------------------------------------- /src/assets/img/flags/uk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 22 | 24 | 26 | 28 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/app/_components/live-auction/live-auction.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |
6 |

Featured NFT

7 |
8 |
9 | 10 | 11 | 12 |
13 | 14 | 15 | 46 |
47 | 48 |
49 | -------------------------------------------------------------------------------- /src/app/pages/auth/auth.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormBuilder, FormGroup, Validators} from '@angular/forms'; 3 | import { AuthenticationService, UtilityService } from '../../_services'; 4 | import { Router, ActivatedRoute } from '@angular/router'; 5 | 6 | @Component({ 7 | selector: 'app-auth', 8 | templateUrl: './auth.component.html', 9 | styleUrls: ['./auth.component.css'] 10 | }) 11 | export class AuthComponent implements OnInit { 12 | 13 | constructor(private authService: AuthenticationService, private utility: UtilityService, private formBuilder: FormBuilder, private router: Router, private activatedRoute: ActivatedRoute) { 14 | 15 | this.utility.updatePageSEO( 16 | 'Login | NFT Marketplace', 17 | 'Login | NFT Marketplace', 18 | '', 19 | '' 20 | ); 21 | } 22 | 23 | form: FormGroup; 24 | token: string; 25 | 26 | ngOnInit(): void { 27 | if (this.activatedRoute.snapshot.queryParamMap.get('token')) { 28 | this.token = this.activatedRoute.snapshot.queryParamMap.get('token'); 29 | this.emailVerification() 30 | } 31 | 32 | this.form = this.formBuilder.group({ 33 | email: [null, [Validators.required, Validators.email, Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$')]], 34 | password: [null, Validators.required], 35 | }); 36 | } 37 | 38 | get getForm() { 39 | return this.form.controls; 40 | } 41 | 42 | loginAction() { 43 | if (this.form.valid) { 44 | this.utility.startLoader() 45 | this.authService.login(this.form.value.email, this.form.value.password).subscribe( 46 | (res) => { 47 | this.utility.stopLoader() 48 | if ( 49 | res['user']['role'] === 'user' || 50 | res['user']['role'] === 'artist' 51 | ) { 52 | this.utility.showSuccessAlert('Success!', 'Logged in successfully'); 53 | if (this.activatedRoute.snapshot.queryParamMap.get('returnUrl')) { 54 | this.router.navigate([ 55 | this.activatedRoute.snapshot.queryParamMap.get('returnUrl'), 56 | ]); 57 | } else { 58 | this.router.navigate(['home']); 59 | } 60 | } else { 61 | this.utility.showErrorAlert( 62 | 'Error', 63 | 'You have not permission to access' 64 | ); 65 | } 66 | }, 67 | (error) => { 68 | this.utility.stopLoader() 69 | this.utility.showErrorAlert('Error', error); 70 | } 71 | ); 72 | } 73 | } 74 | 75 | emailVerification() { 76 | this.utility.startLoader() 77 | this.authService.emailVerifcation(this.token).subscribe( 78 | (res) => { 79 | this.utility.stopLoader() 80 | this.utility.showSuccessAlert('Success!', 'Email verified successfully! Now you can login', ); 81 | this.router.navigate(['auth/login']); 82 | 83 | }, 84 | (error) => { 85 | this.utility.stopLoader() 86 | this.utility.showErrorAlert('Error', error); 87 | } 88 | ); 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /src/app/pages/auth/register/register.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |
7 |
8 | 11 | 12 | 27 | 28 |
29 | 30 | 31 |
32 | 33 |
34 | 35 | 36 |
37 | 38 |
39 | 40 | 41 |
42 | 43 |
44 | 45 | 46 |
47 | 48 | 49 | Already have an account? Sign In! 50 |
51 |
52 |
53 |
54 | 55 |
56 |
-------------------------------------------------------------------------------- /src/assets/css/owl.carousel.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Owl Carousel v2.3.4 3 | * Copyright 2013-2018 David Deutsch 4 | * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE 5 | */ 6 | .owl-carousel,.owl-carousel .owl-item{-webkit-tap-highlight-color:transparent;position:relative}.owl-carousel{display:none;width:100%;z-index:1}.owl-carousel .owl-stage{position:relative;-ms-touch-action:pan-Y;touch-action:manipulation;-moz-backface-visibility:hidden}.owl-carousel .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.owl-carousel .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0,0,0)}.owl-carousel .owl-item,.owl-carousel .owl-wrapper{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.owl-carousel .owl-item{min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-touch-callout:none}.owl-carousel .owl-item img{display:block;width:100%}.owl-carousel .owl-dots.disabled,.owl-carousel .owl-nav.disabled{display:none}.no-js .owl-carousel,.owl-carousel.owl-loaded{display:block}.owl-carousel .owl-dot,.owl-carousel .owl-nav .owl-next,.owl-carousel .owl-nav .owl-prev{cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel .owl-nav button.owl-next,.owl-carousel .owl-nav button.owl-prev,.owl-carousel button.owl-dot{background:0 0;color:inherit;border:none;padding:0!important;font:inherit}.owl-carousel.owl-loading{opacity:0;display:block}.owl-carousel.owl-hidden{opacity:0}.owl-carousel.owl-refresh .owl-item{visibility:hidden}.owl-carousel.owl-drag .owl-item{-ms-touch-action:pan-y;touch-action:pan-y;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-grab{cursor:move;cursor:grab}.owl-carousel.owl-rtl{direction:rtl}.owl-carousel.owl-rtl .owl-item{float:right}.owl-carousel .animated{animation-duration:1s;animation-fill-mode:both}.owl-carousel .owl-animated-in{z-index:0}.owl-carousel .owl-animated-out{z-index:1}.owl-carousel .fadeOut{animation-name:fadeOut}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{transition:height .5s ease-in-out}.owl-carousel .owl-item .owl-lazy{opacity:0;transition:opacity .4s ease}.owl-carousel .owl-item .owl-lazy:not([src]),.owl-carousel .owl-item .owl-lazy[src^=""]{max-height:0}.owl-carousel .owl-item img.owl-lazy{transform-style:preserve-3d}.owl-carousel .owl-video-wrapper{position:relative;height:100%;background:#000}.owl-carousel .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url(owl.video.play.png) no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;transition:transform .1s ease}.owl-carousel .owl-video-play-icon:hover{-ms-transform:scale(1.3,1.3);transform:scale(1.3,1.3)}.owl-carousel .owl-video-playing .owl-video-play-icon,.owl-carousel .owl-video-playing .owl-video-tn{display:none}.owl-carousel .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;background-size:contain;transition:opacity .4s ease}.owl-carousel .owl-video-frame{position:relative;z-index:1;height:100%;width:100%} -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /*************************************************************************************************** 2 | * Load `$localize` onto the global scope - used if i18n tags appear in Angular templates. 3 | */ 4 | import '@angular/localize/init'; 5 | /** 6 | * This file includes polyfills needed by Angular and is loaded before the app. 7 | * You can add your own extra polyfills to this file. 8 | * 9 | * This file is divided into 2 sections: 10 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 11 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 12 | * file. 13 | * 14 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 15 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 16 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 17 | * 18 | * Learn more in https://angular.io/guide/browser-support 19 | */ 20 | 21 | /*************************************************************************************************** 22 | * BROWSER POLYFILLS 23 | */ 24 | 25 | /** 26 | * IE11 requires the following for NgClass support on SVG elements 27 | */ 28 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 29 | 30 | /** 31 | * Web Animations `@angular/platform-browser/animations` 32 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 33 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 34 | */ 35 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 36 | 37 | /** 38 | * By default, zone.js will patch all possible macroTask and DomEvents 39 | * user can disable parts of macroTask/DomEvents patch by setting following flags 40 | * because those flags need to be set before `zone.js` being loaded, and webpack 41 | * will put import in the top of bundle, so user need to create a separate file 42 | * in this directory (for example: zone-flags.ts), and put the following flags 43 | * into that file, and then add the following code before importing zone.js. 44 | * import './zone-flags'; 45 | * 46 | * The flags allowed in zone-flags.ts are listed here. 47 | * 48 | * The following flags will work for all browsers. 49 | * 50 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 51 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 52 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 53 | * 54 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 55 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 56 | * 57 | * (window as any).__Zone_enable_cross_context_check = true; 58 | * 59 | */ 60 | 61 | /*************************************************************************************************** 62 | * Zone JS is required by default for Angular itself. 63 | */ 64 | import 'zone.js/dist/zone'; // Included with Angular CLI. 65 | 66 | 67 | /*************************************************************************************************** 68 | * APPLICATION IMPORTS 69 | */ 70 | -------------------------------------------------------------------------------- /src/app/pages/main/faq/faq.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 9 |
10 | 11 | 12 | 13 |
14 |
15 |

FAQ's

16 |
17 |
18 | 19 | 20 | 21 | 22 | 23 |
24 |
25 |
26 |

What collections are listed on the marketplace?

27 |

Only the collections affiliated with Defydefi launchpad are listed on the marketplace.

28 |
29 | 30 |
31 |

Can I trade/list NFT to all contracts?

32 |

No, only a smart contract affiliated with Defydefi, like Bimp, is eligible.

33 |
34 | 35 |
36 |

What network is this running?

37 |

Binance Smart Chain Network

38 |
39 |
40 | 41 |
42 |
43 |

Can I trade the NFTs that were airdropped to me?

44 |

Yes, only if the NFT is affiliated with DefyDefi. NFTs earned outside our platform will not be recognized.

45 |
46 | 47 |
48 |

How can I view my nft?

49 |

Simply open your wallet's browser, head to NFTmoney.bimp.finance, connect your wallet, and your NFTs will be shown at the bottom panel. To claim, go to Wallet > NFTs > Add NFT > Paste the Address, and copy the NFT ID given on the browser.

50 |
51 | 52 |
53 |

How can I get NFT?

54 |

You can buy NFT at DefyDefi.io and Bimp.Finance, win it through lottery at app.defydefi.io, or get it for free by tuning in to our Social Media giveaways.

55 |
56 |
57 | 58 |
59 |
60 |

What currency is used in the marketplace?

61 |

ETH is used for trading.

62 |
63 | 64 |
65 |

How to start?

66 |

Setup your wallet by creating an account and changing the settings to Binance Smart Chain. Here's a tutorial on how to setup BSC on a MetaMask wallet: https://www.facebook.com/100558448943373/posts/121774333488451/ (Uploading right now sa YT 'yung tutorial)

67 |
68 | 69 |
70 |

How to partner with DefyDefi?

71 |

Contact us through email info@defydefi.com and attach the proposal, or join us at Telegram t.me/BimpFinance and look for an admin.

72 |
73 | 74 | 75 |
76 |
77 |
78 |
79 |

Note: Legit Defy staff will neither contact you first nor ask for money. Admins have "will not DM you first" on their names.

80 |
81 |
82 | 83 | 84 |
-------------------------------------------------------------------------------- /src/app/pages/main/nft-preview/nft-preview.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 10 |
11 | 12 | 13 | 14 |
15 |
16 |

{{ nft.name }}

17 |
18 |
19 | 20 |
21 | 22 |
23 | 24 |
25 |
26 | 27 | 29 |
30 |
31 | 32 | 33 | 34 |
35 |
36 |
37 |

Descriptions

38 |
39 |
40 | 41 | 50 | 51 | 52 | 57 | 58 |
59 |
60 |
    61 |
  • 62 | Token ID 63 |

    {{ nft.tokenId }}

    64 |
  • 65 |
  • 66 | Year created 67 |

    {{ nft.createdAt | date:'Y' }}

    68 |
  • 69 |
  • 70 | Document Link 71 |

    Click Here

    72 |
  • 73 |
  • 74 | Link 75 |

    Click Here

    76 |
  • 77 |
  • 78 | Owner Wallet Address 79 |

    {{ nft.currentOwnerWalletAddress }}

    80 |
  • 81 |
82 |
83 |
84 | 85 | 86 |
87 |
88 | 89 |
90 | 91 |
92 | 93 | -------------------------------------------------------------------------------- /src/app/_components/header/header.component.css: -------------------------------------------------------------------------------- 1 | ::ng-deep .avatar-content { 2 | margin-left: -12px !important; 3 | border-radius: 8px !important; 4 | align-items: center !important; 5 | width: 40px !important; 6 | height: 40px !important; 7 | } 8 | ::ng-deep .avatar-container { 9 | width: auto !important; 10 | height: auto !important; 11 | } 12 | ::ng-deep .header__profile-btn p { 13 | margin-left: 10px !important; 14 | } 15 | 16 | .search input:focus { 17 | outline: none; 18 | border-color: #66b1ee; 19 | -webkit-box-shadow: 0 0 2px rgba(85, 168, 236, 0.9); 20 | -moz-box-shadow: 0 0 2px rgba(85, 168, 236, 0.9); 21 | -ms-box-shadow: 0 0 2px rgba(85, 168, 236, 0.9); 22 | -o-box-shadow: 0 0 2px rgba(85, 168, 236, 0.9); 23 | box-shadow: 0 0 2px rgba(85, 168, 236, 0.9); 24 | } 25 | 26 | .search input:focus+.results { 27 | display: block 28 | } 29 | 30 | .search .results { 31 | display: none; 32 | position: absolute; 33 | top: 62px; 34 | left: 0; 35 | right: 0; 36 | z-index: 10; 37 | padding: 0; 38 | margin: 0; 39 | border-width: 1px; 40 | border-style: solid; 41 | border-color: #cbcfe2 #c8cee7 #c4c7d7; 42 | border-radius: 3px; 43 | background-color: #fdfdfd; 44 | background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fdfdfd), color-stop(100%, #eceef4)); 45 | } 46 | 47 | .search .results li { 48 | display: block 49 | } 50 | 51 | .search .results li:first-child { 52 | margin-top: -1px 53 | } 54 | 55 | .search .results li:first-child:before, 56 | .search .results li:first-child:after { 57 | display: block; 58 | content: ''; 59 | width: 0; 60 | height: 0; 61 | position: absolute; 62 | left: 50%; 63 | margin-left: -5px; 64 | border: 5px outset transparent; 65 | } 66 | 67 | .search .results li:first-child:before { 68 | border-bottom: 5px solid #c4c7d7; 69 | top: -11px; 70 | } 71 | 72 | .search .results li:first-child:after { 73 | border-bottom: 5px solid #fdfdfd; 74 | top: -10px; 75 | } 76 | 77 | .search .results li:first-child:hover:before, 78 | .search .results li:first-child:hover:after { 79 | display: none 80 | } 81 | 82 | .search .results li:last-child { 83 | margin-bottom: -1px 84 | } 85 | 86 | .search .results a { 87 | display: block; 88 | position: relative; 89 | margin: 0 -1px; 90 | padding: 6px 40px 6px 10px; 91 | color: #808394; 92 | font-size: 14px; 93 | font-weight: bolder; 94 | color: black; 95 | border: 1px solid transparent; 96 | border-radius: 3px; 97 | } 98 | 99 | .search .results a span { 100 | font-weight: 200; 101 | font-size: 12px; 102 | color: #807676; 103 | } 104 | 105 | .search .results a:before { 106 | content: ''; 107 | width: 18px; 108 | height: 18px; 109 | position: absolute; 110 | top: 50%; 111 | right: 10px; 112 | margin-top: -9px; 113 | background: url("https://cssdeck.com/uploads/media/items/7/7BNkBjd.png") 0 0 no-repeat; 114 | } 115 | 116 | .search .results a:hover { 117 | text-decoration: none; 118 | color: #fff; 119 | text-shadow: 0 -1px rgba(0, 0, 0, 0.3); 120 | border-color: #2380dd #2179d5 #1a60aa; 121 | background-color: #338cdf; 122 | } 123 | .search .results a:hover span { 124 | color: white; 125 | } 126 | 127 | :-moz-placeholder { 128 | color: #a7aabc; 129 | font-weight: 200; 130 | } 131 | 132 | ::-webkit-input-placeholder { 133 | color: #a7aabc; 134 | font-weight: 200; 135 | } 136 | 137 | .lt-ie9 .search input { 138 | line-height: 26px 139 | } -------------------------------------------------------------------------------- /src/app/_components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { environment } from 'src/environments/environment'; 2 | import { Component, Injectable, OnInit } from '@angular/core'; 3 | import { UtilityService, AuthenticationService, ConnectService, NftService } from '../../_services'; 4 | import { Router } from '@angular/router'; 5 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 6 | declare var $: any; 7 | declare let window:any; 8 | 9 | @Injectable({ 10 | providedIn: 'root', 11 | }) 12 | @Component({ 13 | selector: 'app-header', 14 | templateUrl: './header.component.html', 15 | styleUrls: ['./header.component.css'], 16 | }) 17 | export class HeaderComponent implements OnInit { 18 | constructor( 19 | private utility: UtilityService, 20 | private authService: AuthenticationService, 21 | private router: Router, 22 | private formBuilder: FormBuilder, 23 | private nftService: NftService, 24 | private connectService: ConnectService, 25 | ) {} 26 | 27 | userName: string; 28 | userPic: string = 29 | JSON.parse(localStorage.getItem('user')) && 30 | JSON.parse(localStorage.getItem('user'))['profile_pic'] 31 | ? environment.IMG_BASE_URL + 32 | JSON.parse(localStorage.getItem('user'))['profile_pic'] 33 | : '/assets/img/avatars/avatar.jpg'; 34 | userRole: string; 35 | searchTerm: string; 36 | balance: any = 0; 37 | walletAddres: any = ''; 38 | searchForm: FormGroup; 39 | searchResults: any = []; 40 | 41 | async ngOnInit() { 42 | console.log(localStorage.getItem('user')); 43 | this.searchForm = this.formBuilder.group({ 44 | search: [Validators.required], 45 | }); 46 | this.userName = JSON.parse(localStorage.getItem('user')) 47 | ? JSON.parse(localStorage.getItem('user')) ['name'] 48 | : ''; 49 | this.userRole = JSON.parse(localStorage.getItem('user')) 50 | ? JSON.parse(localStorage.getItem('user'))['role'] 51 | : ''; 52 | 53 | this.walletAddres = await this.connectService.getAddress(); 54 | } 55 | async connectToWallet(){ 56 | $('#connect_to_wallet').modal('hide'); 57 | this.walletAddres = await this.connectService.getAddress(); 58 | }; 59 | async ngAfterViewInit() { 60 | // this.walletAddres = await this.connectService.getAddress(); 61 | } 62 | connectWallet() { 63 | $('#connect_to_wallet').modal('show'); 64 | } 65 | 66 | logoutAction() { 67 | this.authService.logout().subscribe( 68 | (res) => { 69 | this.utility.stopLoader(); 70 | this.utility.showSuccessAlert('Success', 'Logout Successfully'); 71 | window.location.reload(); 72 | }, 73 | (error) => { 74 | localStorage.removeItem('user'); 75 | this.utility.stopLoader(); 76 | this.utility.showErrorAlert('Error', error); 77 | window.location.reload(); 78 | } 79 | ); 80 | } 81 | 82 | search() { 83 | if (this.searchTerm !== '') { 84 | this.router.navigate(['search', this.searchTerm]); 85 | } 86 | } 87 | 88 | redirect(id) { 89 | console.log(id); 90 | 91 | this.router.navigate(['/marketplace', id]); 92 | } 93 | 94 | setSearchValue(text) { 95 | this.searchTerm = text; 96 | if (text !== '') { 97 | this.searchResult(); 98 | } else { 99 | this.searchResults = []; 100 | } 101 | } 102 | 103 | searchResult() { 104 | this.nftService.searchNft(this.searchTerm).subscribe( 105 | (res) => { 106 | this.searchResults = []; 107 | this.searchResults = res; 108 | }, 109 | (error) => { 110 | this.utility.showErrorAlert('Error', error); 111 | } 112 | ); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /src/assets/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.5.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2020 The Bootstrap Authors 4 | * Copyright 2011-2020 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([class]){color:inherit;text-decoration:none}a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /src/app/pages/main/search-result/search-result.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 3 | import { NftService, UtilityService } from '../../../_services'; 4 | import { Router, ActivatedRoute } from '@angular/router'; 5 | import { environment } from 'src/environments/environment'; 6 | @Component({ 7 | templateUrl: './search-result.component.html', 8 | styleUrls: ['./search-result.component.css'], 9 | }) 10 | export class SearchResultComponent implements OnInit { 11 | constructor( 12 | private nftService: NftService, 13 | private utility: UtilityService, 14 | private formBuilder: FormBuilder, 15 | private activatedRoute: ActivatedRoute 16 | ) { 17 | this.utility.updatePageSEO( 18 | 'NFT Marketplace | Buy and Sell your NFT, and NFT Money. NFT Collections, Crypto artworks.', 19 | 'Buy, Sell and trade your NFTs and NFT Money Secured with blockchain.' 20 | ); 21 | this.activatedRoute.params.subscribe((p) => this.getAllNfts()); 22 | } 23 | 24 | activeTab = 'grid'; 25 | nfts: any = []; 26 | currentDate = new Date(); 27 | filteredNfts: any = []; 28 | collectionList: any = []; 29 | selectedCollection: any = []; 30 | filterForm: FormGroup; 31 | imgBaseUrl = environment.IMG_BASE_URL; 32 | p: number = 1; 33 | 34 | ngOnInit(): void { 35 | this.filterForm = this.formBuilder.group({ 36 | filterItems: [[]], 37 | sort: ['new'], 38 | }); 39 | } 40 | 41 | ngOnChanges(): void { 42 | this.getAllNfts(); 43 | } 44 | 45 | getAllNfts() { 46 | var self = this; 47 | this.utility.startLoader(); 48 | this.nftService 49 | .searchNft(this.activatedRoute.snapshot.paramMap.get('term')) 50 | .subscribe( 51 | (res) => { 52 | this.utility.stopLoader(); 53 | this.nfts = res; 54 | this.filteredNfts = res; 55 | this.getFilterList(); 56 | }, 57 | (error) => { 58 | this.utility.stopLoader(); 59 | this.utility.showErrorAlert('Error', error); 60 | } 61 | ); 62 | } 63 | 64 | getFilterList() { 65 | this.nfts.forEach((element) => { 66 | if (!this.collectionList[element.currentOwner.id]) { 67 | this.collectionList[element.currentOwner.id] = 68 | element.currentOwner.name; 69 | } 70 | }); 71 | } 72 | 73 | onChangeCategory(event, item: any) { 74 | // Use appropriate model type instead of any 75 | if (this.selectedCollection.indexOf(item) > -1) { 76 | const index = this.selectedCollection.indexOf(item); 77 | if (index > -1) { 78 | this.selectedCollection.splice(index, 1); 79 | } 80 | } else { 81 | this.selectedCollection.push(item); 82 | } 83 | } 84 | 85 | applyFilter() { 86 | this.getFilteredItems(); 87 | } 88 | 89 | async getFilteredItems() { 90 | var self = this; 91 | if (this.selectedCollection.length > 0) { 92 | self.filteredNfts = self.nfts.filter((element) => { 93 | return self.selectedCollection.indexOf(element.currentOwner.id) > -1; 94 | }); 95 | } else { 96 | self.filteredNfts = self.nfts; 97 | } 98 | 99 | if (this.filterForm.value.sort === 'new') { 100 | self.filteredNfts.sort((a, b) => (a.createdAt < b.createdAt ? 1 : -1)); 101 | } else if (this.filterForm.value.sort === 'old') { 102 | self.filteredNfts.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)); 103 | } else if (this.filterForm.value.sort === 'high') { 104 | self.filteredNfts.sort((a, b) => (a.price < b.price ? 1 : -1)); 105 | } else if (this.filterForm.value.sort === 'low') { 106 | await self.filteredNfts.sort((a, b) => (a.price > b.price ? 1 : -1)); 107 | } 108 | } 109 | 110 | convertDate(date) { 111 | return new Date(date); 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "align": { 8 | "options": [ 9 | "parameters", 10 | "statements" 11 | ] 12 | }, 13 | "array-type": false, 14 | "arrow-return-shorthand": true, 15 | "curly": true, 16 | "deprecation": { 17 | "severity": "warning" 18 | }, 19 | "eofline": true, 20 | "import-blacklist": [ 21 | true, 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": { 26 | "options": [ 27 | "spaces" 28 | ] 29 | }, 30 | "max-classes-per-file": false, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-console": [ 47 | true, 48 | "debug", 49 | "info", 50 | "time", 51 | "timeEnd", 52 | "trace" 53 | ], 54 | "no-empty": false, 55 | "no-inferrable-types": [ 56 | true, 57 | "ignore-params" 58 | ], 59 | "no-non-null-assertion": true, 60 | "no-redundant-jsdoc": true, 61 | "no-switch-case-fall-through": true, 62 | "no-var-requires": false, 63 | "object-literal-key-quotes": [ 64 | true, 65 | "as-needed" 66 | ], 67 | "quotemark": [ 68 | true, 69 | "single" 70 | ], 71 | "semicolon": { 72 | "options": [ 73 | "always" 74 | ] 75 | }, 76 | "space-before-function-paren": { 77 | "options": { 78 | "anonymous": "never", 79 | "asyncArrow": "always", 80 | "constructor": "never", 81 | "method": "never", 82 | "named": "never" 83 | } 84 | }, 85 | "typedef": [ 86 | true, 87 | "call-signature" 88 | ], 89 | "typedef-whitespace": { 90 | "options": [ 91 | { 92 | "call-signature": "nospace", 93 | "index-signature": "nospace", 94 | "parameter": "nospace", 95 | "property-declaration": "nospace", 96 | "variable-declaration": "nospace" 97 | }, 98 | { 99 | "call-signature": "onespace", 100 | "index-signature": "onespace", 101 | "parameter": "onespace", 102 | "property-declaration": "onespace", 103 | "variable-declaration": "onespace" 104 | } 105 | ] 106 | }, 107 | "variable-name": { 108 | "options": [ 109 | "ban-keywords", 110 | "check-format", 111 | "allow-pascal-case" 112 | ] 113 | }, 114 | "whitespace": { 115 | "options": [ 116 | "check-branch", 117 | "check-decl", 118 | "check-operator", 119 | "check-separator", 120 | "check-type", 121 | "check-typecast" 122 | ] 123 | }, 124 | "component-class-suffix": true, 125 | "contextual-lifecycle": true, 126 | "directive-class-suffix": true, 127 | "no-conflicting-lifecycle": true, 128 | "no-host-metadata-property": true, 129 | "no-input-rename": true, 130 | "no-inputs-metadata-property": true, 131 | "no-output-native": true, 132 | "no-output-on-prefix": true, 133 | "no-output-rename": true, 134 | "no-outputs-metadata-property": true, 135 | "template-banana-in-box": true, 136 | "template-no-negated-async": true, 137 | "use-lifecycle-interface": true, 138 | "use-pipe-transform-interface": true, 139 | "directive-selector": [ 140 | true, 141 | "attribute", 142 | "app", 143 | "camelCase" 144 | ], 145 | "component-selector": [ 146 | true, 147 | "element", 148 | "app", 149 | "kebab-case" 150 | ] 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /src/app/pages/main/create-nft/create-nft.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { 3 | UtilityService, 4 | NftService, 5 | ConnectService, 6 | } from '../../../_services'; 7 | import { Router } from '@angular/router'; 8 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 9 | const IpfsHttpClient = require('ipfs-http-client'); 10 | const ipfs = new IpfsHttpClient({ 11 | host: 'ipfs.infura.io', 12 | port: 5001, 13 | protocol: 'https', 14 | }); 15 | import Swal from 'sweetalert2'; 16 | 17 | @Component({ 18 | templateUrl: './create-nft.component.html', 19 | styleUrls: ['./create-nft.component.css'], 20 | }) 21 | export class CreateNftComponent implements OnInit { 22 | constructor( 23 | private utility: UtilityService, 24 | private formBuilder: FormBuilder, 25 | private router: Router, 26 | private nftService: NftService, 27 | private connectService: ConnectService 28 | ) {} 29 | 30 | createForm: FormGroup; 31 | 32 | ngOnInit(): void { 33 | // intialize form 34 | this.createForm = this.formBuilder.group({ 35 | name: [null, [Validators.required]], 36 | description: [null, [Validators.required]], 37 | image: [null, [Validators.required]], 38 | price: [null, [Validators.required]], 39 | category: [null, [Validators.required]], 40 | link: [null], 41 | }); 42 | } 43 | 44 | get getCreateForm() { 45 | return this.createForm.controls; 46 | } 47 | 48 | convertDataURIToBinary(dataURI) { 49 | var base64Index = dataURI.indexOf(';base64,') + ';base64,'.length; 50 | var base64 = dataURI.substring(base64Index); 51 | var raw = window.atob(base64); 52 | var rawLength = raw.length; 53 | var array = new Uint8Array(new ArrayBuffer(rawLength)); 54 | 55 | for (let i = 0; i < rawLength; i++) { 56 | array[i] = raw.charCodeAt(i); 57 | } 58 | return array; 59 | } 60 | 61 | upload() { 62 | const file = (( 63 | document.getElementById('sign__file-upload') 64 | )).files[0]; 65 | console.log(file); 66 | 67 | if (file.size <= 102400000){ 68 | var self = this; 69 | const reader = new FileReader(); 70 | let byteArray; 71 | 72 | reader.addEventListener( 73 | 'loadend', 74 | async function () { 75 | // convert image file to base64 string 76 | 77 | byteArray = self.convertDataURIToBinary(reader.result); 78 | self.utility.startLoader('Uploading document....'); 79 | var result = await ipfs.add(byteArray); 80 | self.utility.startLoader( 81 | 'Document uploaded sucessfully. Please wait...' 82 | ); 83 | self.utility.startLoader( 84 | 'Data encryption in progress. Please wait...' 85 | ); 86 | var fianalJSON = self.createForm.value; 87 | fianalJSON[ 88 | 'image' 89 | ] = `https://gateway.ipfs.io/ipfs/${result['path']}`; 90 | fianalJSON['status'] = `AVAILABLE`; 91 | fianalJSON['fileType'] = file.type; 92 | fianalJSON['currentOwnerWalletAddress'] = self.connectService.account; 93 | self.utility.startLoader('Almost finished. Please wait...'); 94 | self.createNFT(fianalJSON); 95 | }, 96 | false 97 | ); 98 | if (file) { 99 | reader.readAsDataURL(file); 100 | } 101 | } else { 102 | this.utility.showErrorAlert('Error', 'File size must be less than 100Mb'); 103 | } 104 | 105 | 106 | 107 | } 108 | 109 | createNFT(data) { 110 | var self = this; 111 | this.utility.startLoader(); 112 | this.nftService.createNft(data).subscribe( 113 | (res) => { 114 | this.utility.stopLoader(); 115 | Swal.fire({ 116 | icon: 'success', 117 | title: 'Congratulations!', 118 | text: 'You have minted NFT successfully.', 119 | }).then((result) => { 120 | this.router.navigate(['/manage-profile']); 121 | }); 122 | }, 123 | (error) => { 124 | this.utility.stopLoader(); 125 | this.utility.showErrorAlert('Error', error); 126 | } 127 | ); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /src/app/pages/main/marketplace/marketplace.component.ts: -------------------------------------------------------------------------------- 1 | import { environment } from 'src/environments/environment'; 2 | import { Component, OnInit } from '@angular/core'; 3 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 4 | import { NftService, UtilityService } from '../../../_services'; 5 | @Component({ 6 | templateUrl: './marketplace.component.html', 7 | styleUrls: ['./marketplace.component.css'], 8 | }) 9 | export class MarketplaceComponent implements OnInit { 10 | constructor( 11 | private nftService: NftService, 12 | private utility: UtilityService, 13 | private formBuilder: FormBuilder 14 | ) { 15 | this.utility.updatePageSEO( 16 | 'NFT Marketplace | Buy and Sell your NFT, and NFT Money. NFT Collections, Crypto artworks.', 17 | 'Buy, Sell and trade your NFTs and NFT Money Secured with blockchain.' 18 | ); 19 | } 20 | 21 | activeTab = 'grid'; 22 | nfts: any = []; 23 | baseImageUrl = environment.IMG_BASE_URL; 24 | currentDate = new Date(); 25 | filteredNfts: any = []; 26 | collectionList: any = []; 27 | selectedCollection: any = []; 28 | selectedCategory: any = []; 29 | filterForm: FormGroup; 30 | p: number = 1; 31 | categoryList = ['Image', 'Video']; 32 | 33 | ngOnInit(): void { 34 | this.filterForm = this.formBuilder.group({ 35 | filterItems: [[]], 36 | sort: ['new'], 37 | }); 38 | this.getAllNfts(); 39 | } 40 | 41 | getAllNfts() { 42 | var self = this; 43 | this.utility.startLoader(); 44 | this.nftService.getNfts().subscribe( 45 | (res) => { 46 | this.utility.stopLoader(); 47 | this.nfts = res; 48 | this.filteredNfts = res; 49 | this.getFilterList(); 50 | }, 51 | (error) => { 52 | this.utility.stopLoader(); 53 | this.utility.showErrorAlert('Error', error); 54 | } 55 | ); 56 | } 57 | 58 | getFilterList() { 59 | this.nfts.forEach((element) => { 60 | if (!this.collectionList[element.currentOwner.id]) { 61 | this.collectionList[element.currentOwner.id] = 62 | element.currentOwner.name; 63 | } 64 | }); 65 | } 66 | 67 | onChangeArtist(event, item: any) { 68 | // Use appropriate model type instead of any 69 | if (this.selectedCollection.indexOf(item) > -1) { 70 | const index = this.selectedCollection.indexOf(item); 71 | if (index > -1) { 72 | this.selectedCollection.splice(index, 1); 73 | } 74 | } else { 75 | this.selectedCollection.push(item); 76 | } 77 | } 78 | 79 | onChangeCategory(event, item: any) { 80 | // Use appropriate model type instead of any 81 | if (this.selectedCategory.indexOf(item) > -1) { 82 | const index = this.selectedCategory.indexOf(item); 83 | if (index > -1) { 84 | this.selectedCategory.splice(index, 1); 85 | } 86 | } else { 87 | this.selectedCategory.push(item); 88 | } 89 | } 90 | 91 | applyFilter() { 92 | this.getFilteredItems(); 93 | } 94 | 95 | async getFilteredItems() { 96 | var self = this; 97 | if (this.selectedCollection.length > 0) { 98 | self.filteredNfts = self.nfts.filter((element) => { 99 | return self.selectedCollection.indexOf(element.currentOwner.id) > -1; 100 | }); 101 | } else { 102 | self.filteredNfts = self.nfts; 103 | } 104 | 105 | if (this.selectedCategory.length > 0) { 106 | self.filteredNfts = self.filteredNfts.filter((element) => { 107 | return self.selectedCategory.indexOf(element.category) > -1; 108 | }); 109 | } 110 | 111 | if (this.filterForm.value.sort === 'new') { 112 | self.filteredNfts.sort((a, b) => (a.createdAt < b.createdAt ? 1 : -1)); 113 | } else if (this.filterForm.value.sort === 'old') { 114 | self.filteredNfts.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)); 115 | } else if (this.filterForm.value.sort === 'high') { 116 | self.filteredNfts.sort((a, b) => (a.price < b.price ? 1 : -1)); 117 | } else if (this.filterForm.value.sort === 'low') { 118 | await self.filteredNfts.sort((a, b) => (a.price > b.price ? 1 : -1)); 119 | } 120 | } 121 | 122 | convertDate(date) { 123 | return new Date(date); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "cli": { 4 | "analytics": "35254c2d-8c84-49e3-ae12-64100162cc98" 5 | }, 6 | "version": 1, 7 | "newProjectRoot": "projects", 8 | "projects": { 9 | "nft-web-app": { 10 | "projectType": "application", 11 | "schematics": {}, 12 | "root": "", 13 | "sourceRoot": "src", 14 | "prefix": "app", 15 | "architect": { 16 | "build": { 17 | "builder": "@angular-devkit/build-angular:browser", 18 | "options": { 19 | "outputPath": "dist/nft-web-app", 20 | "index": "src/index.html", 21 | "main": "src/main.ts", 22 | "polyfills": "src/polyfills.ts", 23 | "tsConfig": "tsconfig.app.json", 24 | "aot": true, 25 | "assets": [ 26 | "src/favicon.ico", 27 | "src/assets" 28 | ], 29 | "styles": [ 30 | "src/styles.css", 31 | "node_modules/ngx-toastr/toastr.css" 32 | ], 33 | "scripts": [ 34 | ] 35 | }, 36 | "configurations": { 37 | "production": { 38 | "fileReplacements": [ 39 | { 40 | "replace": "src/environments/environment.ts", 41 | "with": "src/environments/environment.prod.ts" 42 | } 43 | ], 44 | "optimization": true, 45 | "outputHashing": "all", 46 | "sourceMap": false, 47 | "namedChunks": false, 48 | "extractLicenses": true, 49 | "vendorChunk": false, 50 | "buildOptimizer": true, 51 | "budgets": [ 52 | { 53 | "type": "initial", 54 | "maximumWarning": "2mb", 55 | "maximumError": "5mb" 56 | }, 57 | { 58 | "type": "anyComponentStyle", 59 | "maximumWarning": "6kb", 60 | "maximumError": "10kb" 61 | } 62 | ] 63 | } 64 | } 65 | }, 66 | "serve": { 67 | "builder": "@angular-devkit/build-angular:dev-server", 68 | "options": { 69 | "browserTarget": "nft-web-app:build" 70 | }, 71 | "configurations": { 72 | "production": { 73 | "browserTarget": "nft-web-app:build:production" 74 | } 75 | } 76 | }, 77 | "extract-i18n": { 78 | "builder": "@angular-devkit/build-angular:extract-i18n", 79 | "options": { 80 | "browserTarget": "nft-web-app:build" 81 | } 82 | }, 83 | "test": { 84 | "builder": "@angular-devkit/build-angular:karma", 85 | "options": { 86 | "main": "src/test.ts", 87 | "polyfills": "src/polyfills.ts", 88 | "tsConfig": "tsconfig.spec.json", 89 | "karmaConfig": "karma.conf.js", 90 | "assets": [ 91 | "src/favicon.ico", 92 | "src/assets" 93 | ], 94 | "styles": [ 95 | "src/styles.css" 96 | ], 97 | "scripts": [] 98 | } 99 | }, 100 | "lint": { 101 | "builder": "@angular-devkit/build-angular:tslint", 102 | "options": { 103 | "tsConfig": [ 104 | "tsconfig.app.json", 105 | "tsconfig.spec.json", 106 | "e2e/tsconfig.json" 107 | ], 108 | "exclude": [ 109 | "**/node_modules/**" 110 | ] 111 | } 112 | }, 113 | "e2e": { 114 | "builder": "@angular-devkit/build-angular:protractor", 115 | "options": { 116 | "protractorConfig": "e2e/protractor.conf.js", 117 | "devServerTarget": "nft-web-app:serve" 118 | }, 119 | "configurations": { 120 | "production": { 121 | "devServerTarget": "nft-web-app:serve:production" 122 | } 123 | } 124 | } 125 | } 126 | } 127 | }, 128 | "defaultProject": "nft-web-app" 129 | } -------------------------------------------------------------------------------- /src/app/pages/main/create-nft/create-nft.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 9 |
10 | 11 | 12 | 13 |
14 |
15 |

Create collectible item

16 |
17 |
18 | 19 |
20 | 21 | 22 | 23 |
24 |
25 |
26 |

Upload file

27 |
28 | 29 |
30 |
31 | 32 | 33 | 34 |
35 |
36 | 37 | 38 |
39 |

Item details

40 |
41 | 42 |
43 |
44 | 45 | 46 | 47 |
48 |
49 | 50 |
51 |
52 | 53 | 61 | 62 |
63 |
64 | 65 |
66 |
67 | 68 | 69 | 70 |
71 |
72 | 73 |
74 |
75 | 76 | 77 | 78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 |
87 |
88 | 89 |
90 | 91 |
92 |
93 |
94 | 95 |
96 |
97 |
-------------------------------------------------------------------------------- /src/app/_services/authentication.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient, HttpHeaders } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | import { map } from 'rxjs/operators'; 5 | import { environment } from '../../environments/environment'; 6 | 7 | @Injectable() 8 | export class AuthenticationService { 9 | public token: string; 10 | public refresh_token: string; 11 | public headers: HttpHeaders; 12 | public readonly apiUrl = environment.API_BASE_URL; 13 | 14 | constructor(public http: HttpClient) { 15 | // set token if saved in local storage 16 | var currentUser = JSON.parse(localStorage.getItem('user')); 17 | this.token = currentUser && currentUser.token; 18 | this.refresh_token = currentUser && currentUser.refresh_token; 19 | } 20 | 21 | isLoggedIn() { 22 | if (localStorage.getItem('user')) { 23 | return true; 24 | } 25 | return false; 26 | } 27 | 28 | login(email: string, password: string): Observable { 29 | return this.http 30 | .post(this.apiUrl + 'auth/login', { 31 | email: email, 32 | password: password 33 | }) 34 | .pipe( 35 | map((response: Response) => { 36 | this.token = response['tokens']['access']['token']; 37 | this.refresh_token = response['tokens']['refresh']['token']; 38 | let expiresIn = response['tokens']['access']['expires']; 39 | if ( 40 | (this.token && (response['user']['role'] === 'user') || 41 | response['user']['role'] === 'artist') 42 | ) { 43 | // store expiresIn and jwt token in local storage to keep user logged in between page refreshes 44 | localStorage.setItem( 45 | 'user', 46 | JSON.stringify({ 47 | expires_in: expiresIn, 48 | token: this.token, 49 | refresh_token: this.refresh_token, 50 | email: response['user']['email'], 51 | name: response['user']['name'], 52 | role: response['user']['role'], 53 | profile_pic: response['user']['profile_pic'], 54 | email_verified_at: response['user']['email_verified_at'], 55 | id: response['user']['id'], 56 | }) 57 | ); 58 | } 59 | return response; 60 | }) 61 | ); 62 | } 63 | 64 | register(username: string, email: string, password: string, role: string): Observable { 65 | return this.http 66 | .post(this.apiUrl + 'auth/register', { 67 | email: email, 68 | name: username, 69 | password: password, 70 | role: role, 71 | }) 72 | .pipe( 73 | map((response: Response) => { 74 | // register successful if there's a jwt token in the response 75 | return response; 76 | }) 77 | ); 78 | } 79 | 80 | logout(): Observable { 81 | // clear token remove user from local storage to log user out 82 | console.log(this.refresh_token); 83 | return this.http 84 | .post(this.apiUrl + 'auth/logout', { refreshToken: this.refresh_token }) 85 | .pipe( 86 | map((response: Response) => { 87 | console.log(response); 88 | this.token = null; 89 | this.refresh_token = null; 90 | localStorage.removeItem('user'); 91 | return response; 92 | }) 93 | ); 94 | } 95 | 96 | sendPasswordResetEmail(email: string): Observable { 97 | return this.http 98 | .post(this.apiUrl + 'auth/forgot-password', { email: email }) 99 | .pipe( 100 | map((response: Response) => { 101 | return response; 102 | }) 103 | ); 104 | } 105 | 106 | resetPassword( 107 | newPassword: string, 108 | token: string 109 | ): Observable { 110 | return this.http 111 | .post(`${this.apiUrl}auth/reset-password?token=${token}`, { 112 | password: newPassword, 113 | }) 114 | .pipe( 115 | map((response: Response) => { 116 | return response; 117 | }) 118 | ); 119 | } 120 | 121 | emailVerifcation( 122 | token: string 123 | ): Observable { 124 | return this.http 125 | .get(`${this.apiUrl}auth/email-verification/${token}`) 126 | .pipe( 127 | map((response: Response) => { 128 | return response; 129 | }) 130 | ); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /src/app/_components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 | 9 | 10 |
11 | 12 |
13 | 14 | 19 |
20 | 21 |
22 | 23 | 28 |
29 |
30 | 31 |
32 |
33 | 50 |
51 |
52 |
53 |
54 | --------------------------------------------------------------------------------