Skip to content

Commit

Permalink
Migrate to indexer (#24)
Browse files Browse the repository at this point in the history
* Create Dockerfile

* Update Dockerfile

* Update Dockerfile

* Add collection header component

* Fix token limit display

* Fix nft mint with price

* Add collection list nfts preview

* Fix nft image ratio

* Minor improvements, add NFTs display and market forms validation (#11)

* Refactor create collections feature

* Rename home page

* Bump @gear-js/react-hooks

* Divide features

* Add home page nfts display

* Add grid sizing to main lists

* Add search input component

* Add grid size to collection nfts

* Add collection page nft search

* Add filter button component

* Add nft and collection breadcrumbs

* Fix rerenders

* Add start sale form validation

* Add auction duration selection up to 30 days

* Add auction form validation

* Add smart form component

* Add make bid validation

* Fix mint button display for collections with limit

* Migrate to indexer (#12)

* Add indexer address

* Migrate collections to indexer

* Fix mint nft button display

* Prepare fix for nft action buttons display

* Drop collection and nft contexts

* Drop local marketplace meta

* Fix codegen types

* Fix nft actions display

* Drop optional codegen types

* Fix collection query redudant entries

* Migrate to subscriptions

* Fix collection social links display

* Fix auction end date and price display

* Fix nfts preview display

* Add nfts preview placeholder display

* Add indexer address env to docker

* Log public envs

* Add reply subscriptions to messages (#13)

* Fix collection card logo shrink and nft card name overflow

* Add reply subscription to messages

* Return reply in onSuccess callback

* Add alerts on success replies

* Add button loadings on message submit

* Improve UX (#14)

* Add lists and collection loaders

* Fix mint button display if user mint limit is reached

* Improve reply error handling

* Fix Form nestend inputs

* Group layout components

* Require logo and banner on collection creation

* Add multiple nft images input on collection creation

* Add 404 page

* Add error boundary

* Group components

* Add nft page loaders

* Add list component (#15)

* Fix nested routes rerender

* Add list component

* Add mint permission (#16)

* Add truncated text, identicon and tag components, divide address schema

* Add mint permission field to create collection form

* Display mint nft button only for permitted users

* Fix permission to mint submit

* Fix not enough gas error

* Migrate to pinata

* Fix pinata upload

* Fetch collection types in create page (#18)

* Fix private route redirect on not ready account

* Fetch collection types from indexer

* Add fees (#20)

* Add upload fee display

* Replace metadata context with marketplace context

* Drop contract address env

* Add create collection fee submit

* Add mint and trade fees

* Add auction duration in blocks

* Drop docker contract address env

* Bump @gear-js/vara-ui

* Revert first bid validation

* Upload images to ipfs in chunks (#21)

* Change NFTs preview placeholder

* Add collection header gradient

* Add create collection nfts limit

* Add create collection countdown (#22)

* Add create collection countdown

* Fix styles

* Fix countdown display for admins and fix stale last collection

* Add account filter (#23)

* Add account filter to lists page

* Add account filter to collection page

* Change submit nfts button text on upload

* Upload image batches sequentially

---------

Co-authored-by: sergey filyanin <[email protected]>
  • Loading branch information
nikitayutanov and sergeyfilyanin authored Feb 29, 2024
1 parent 8a91d7c commit b4c53c6
Show file tree
Hide file tree
Showing 244 changed files with 9,983 additions and 2,719 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy-to-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ jobs:
tags: ${{ needs.prepair.outputs.image_name }}
build-args: |
VITE_NODE_ADDRESS=${{ secrets.VITE_NODE_ADDRESS }}
VITE_IPFS_ADDRESS=${{ secrets.VITE_IPFS_ADDRESS }}
VITE_IPFS_UPLOAD_ADDRESS=${{ secrets.VITE_IPFS_UPLOAD_ADDRESS }}
VITE_IPFS_GATEWAY_ADDRESS=${{ secrets.VITE_IPFS_GATEWAY_ADDRESS }}
VITE_CONTRACT_ADDRESS=${{ secrets.VITE_CONTRACT_ADDRESS }}
VITE_INDEXER_ADDRESS=${{ secrets.VITE_INDEXER_ADDRESS }}
VITE_INDEXER_WS_ADDRESS=${{ secrets.VITE_INDEXER_WS_ADDRESS }}
deploy-to-k8s:
needs: [prepair, build-and-push-image]
Expand Down
6 changes: 4 additions & 2 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
VITE_NODE_ADDRESS=
VITE_IPFS_ADDRESS=
VITE_CONTRACT_ADDRESS=
VITE_IPFS_UPLOAD_ADDRESS=
VITE_IPFS_GATEWAY_ADDRESS=
VITE_INDEXER_ADDRESS=
VITE_INDEXER_WS_ADDRESS=
1 change: 1 addition & 0 deletions frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graphql
32 changes: 32 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM node:18-alpine
MAINTAINER GEAR

COPY ./frontend /opt

RUN apk update

RUN apk add xsel

RUN npm install -g pnpm

ARG VITE_NODE_ADDRESS \
VITE_IPFS_UPLOAD_ADDRESS \
VITE_IPFS_GATEWAY_ADDRESS \
VITE_INDEXER_ADDRESS \
VITE_INDEXER_WS_ADDRESS
ENV VITE_NODE_ADDRESS=${VITE_NODE_ADDRESS} \
VITE_IPFS_UPLOAD_ADDRESS=${VITE_IPFS_UPLOAD_ADDRESS} \
VITE_IPFS_GATEWAY_ADDRESS=${VITE_IPFS_GATEWAY_ADDRESS} \
VITE_INDEXER_ADDRESS=${VITE_INDEXER_ADDRESS} \
VITE_INDEXER_WS_ADDRESS=${VITE_INDEXER_WS_ADDRESS} \
DISABLE_ESLINT_PLUGIN=true

WORKDIR /opt

RUN pnpm install

RUN pnpm build

RUN npm install --global serve

CMD ["serve", "-s", "/opt/dist"]
23 changes: 23 additions & 0 deletions frontend/codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { CodegenConfig } from '@graphql-codegen/cli';
import { loadEnv } from 'vite';

const config: CodegenConfig = {
schema: loadEnv('', process.cwd(), '').VITE_INDEXER_ADDRESS,
documents: ['src/**/*.{ts,tsx}'],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
'./src/graphql/': {
preset: 'client',
plugins: [],
config: {
scalars: {
DateTime: 'string',
BigInt: 'string',
},
avoidOptionals: true,
},
},
},
};

export default config;
23 changes: 14 additions & 9 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,32 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"start": "vite --open",
"start": "vite --open --port 3000",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"codegen": "graphql-codegen"
},
"dependencies": {
"@gear-js/api": "0.35.2",
"@gear-js/react-hooks": "0.9.5",
"@gear-js/vara-ui": "0.0.6",
"@gear-js/api": "0.36.3",
"@gear-js/react-hooks": "0.10.3",
"@gear-js/vara-ui": "0.0.7",
"@hookform/resolvers": "3.3.3",
"@polkadot/api": "10.10.1",
"@polkadot/api-derive": "10.10.1",
"@polkadot/api": "10.11.2",
"@polkadot/react-identicon": "3.6.4",
"@polkadot/types": "10.10.1",
"kubo-rpc-client": "3.0.2",
"graphql-ws": "5.14.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "7.49.2",
"react-router-dom": "6.21.0",
"urql": "4.0.6",
"zod": "3.22.4"
},
"devDependencies": {
"@graphql-codegen/cli": "5.0.0",
"@graphql-codegen/client-preset": "4.1.0",
"@graphql-typed-document-node/core": "3.2.0",
"@polkadot/types": "10.11.2",
"@types/react": "18.2.43",
"@types/react-dom": "18.2.17",
"@typescript-eslint/eslint-plugin": "6.14.0",
Expand All @@ -39,6 +43,7 @@
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-refresh": "0.4.5",
"graphql": "16.8.1",
"sass": "1.69.5",
"typescript": "5.2.2",
"vite": "5.0.8",
Expand Down
Loading

0 comments on commit b4c53c6

Please sign in to comment.