Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #167 from tqtezos/v0.1.1
Browse files Browse the repository at this point in the history
OpenMinter v0.1.1
  • Loading branch information
lambdahands authored Feb 5, 2021
2 parents 2cc9293 + 1a20522 commit d5b64e4
Show file tree
Hide file tree
Showing 52 changed files with 2,018 additions and 1,905 deletions.
41 changes: 23 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ $ yarn install
```

The installation process will fetch toplevel NPM dependences and build
the `minter-ui-dev` and `minter-api-dev` Docker images. Subsequent runs of
`yarn install` will rebuild these images without checking for cached versions.
the `minter-ui-dev` and `minter-api-dev` Docker images.

### Configuration

Expand Down Expand Up @@ -89,16 +88,16 @@ administrator during contract origination:
```
> **Note:** Since sandbox keys don't represent sensitive accounts, the `config/`
> folder includes default configurations with `admin` wallets. To configure Minter
> for the `testnet` or `mainnet` networks, update the definitions in
> folder includes default configurations with `admin` wallets. To configure
> OpenMinter for the `testnet` or `mainnet` networks, update the definitions in
> `config/minter.<network>.example.json` and copy it to the proper path for the
> application to read it. For:
> application to read it. For example:
>
> `cp config/minter.mainnet.example.json config/minter.mainnet.json`
If the `contracts` key or its children `nftFaucet` or `nftFactory` keys are not
specified, these contracts will be originated and their addresses saved in the
configuration file when starting the Minter devleopment environment.
If the `contracts` key or its child `nftFaucet` keys is not specified, a new
contract will be originated and its addresses saved in the configuration file
when starting the OpenMinter development environment.
#### Pinata
Expand All @@ -107,21 +106,27 @@ keys in order to direct all file uploads through their service. This allows for
ease of use while working with IPFS as running OpenMinter without Pinata will
rely on using and maintaining a local IPFS node.
> **Note:** The example `testnet` and `mainnet` configurations in the `config/`
> folder have placeholder Pinata API keys. If you want to use OpenMinter on
> these networks without Pinata, remove the `pinata` key from the configuration.
> ⚠️ **Note:** The example `testnet` and `mainnet` configurations in the
`config/` folder have placeholder Pinata API keys as it's the most robust way
> to easily persist data on IPFS. Using OpenMinter on these networks without
> Pinata may cause data loss as the NFT metadata and artifacts must be resolved
> over IPFS. If you want to use OpenMinter on these networks without Pinata,
> remove the `pinata` key from the configuration, but be aware that this entails
> running and maintaining your own IPFS gateway in order for your NFT data token
> remain accessible.
[pinata]: https://pinata.cloud
### Starting and Stopping
During its start process, Minter will create or update Docker services for its
specified environment and also bootstrap the required contracts if their
During its start process, OpenMinter will create or update Docker services for
its specified environment and also bootstrap the required contracts if their
addresses are not defined in the environment's configuration file.
#### Sandbox
To start Minter on a `sandbox` network, run:
To start Minter in a `sandbox` network, run:
```sh
$ yarn start:sandbox
Expand All @@ -142,7 +147,7 @@ $ yarn stop:sandbox
#### Testnet
To start Minter on a `testnet` network, run:
To start Minter on the `testnet` network, run:
```sh
$ yarn start:testnet
Expand All @@ -161,7 +166,7 @@ $ yarn stop:testnet
#### Mainnet
To start Minter on a `mainnet` network, run:
To start Minter on the `mainnet` network, run:
```sh
$ yarn start:mainnet
Expand Down Expand Up @@ -229,7 +234,7 @@ $ yarn log:api --since 5m
### Editor Environments
Docker development images are set up to reload server and web ui on source code
Docker development images are set up to reload server and web UI on source code
changes.
To setup this project for an IDE, you will want to install NPM dependencies
Expand Down Expand Up @@ -263,7 +268,7 @@ $ svc-restart(){docker service scale minter-dev-sandbox_$1=0 && docker service s

## Release Builds (WIP)

Development ui and api server builds can be swapped out for release builds:
Development UI and API server builds can be swapped out for release builds:

```sh
$ bin/build-release-images
Expand Down
6 changes: 3 additions & 3 deletions bin/build-dev-images
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -e

source ${BASH_SOURCE%/*}/setup-env

docker build --no-cache -t bashcurl -f $PROJECT_ROOT_DIR/docker/bashcurl.dockerfile $PROJECT_ROOT_DIR/docker/
docker build --no-cache -t minter-api-dev -f $PROJECT_ROOT_DIR/docker/api-dev.dockerfile $PROJECT_ROOT_DIR
docker build --no-cache -t minter-ui-dev -f $PROJECT_ROOT_DIR/docker/ui-dev.dockerfile $PROJECT_ROOT_DIR
docker build -t bashcurl -f $PROJECT_ROOT_DIR/docker/bashcurl.dockerfile $PROJECT_ROOT_DIR/docker/
docker build -t minter-api-dev -f $PROJECT_ROOT_DIR/docker/api-dev.dockerfile $PROJECT_ROOT_DIR
docker build -t minter-ui-dev -f $PROJECT_ROOT_DIR/docker/ui-dev.dockerfile $PROJECT_ROOT_DIR
29 changes: 13 additions & 16 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,40 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@airgap/beacon-sdk": "2.1.0",
"@chakra-ui/react": "1.1.2",
"@emotion/core": "10.0.28",
"@emotion/react": "11.1.4",
"@emotion/styled": "11.0.0",
"@taquito/beacon-wallet": "7.2.0-beta.2",
"@taquito/rpc": "7.2.0-beta.2",
"@taquito/signer": "7.2.0-beta.2",
"@taquito/taquito": "7.2.0-beta.2",
"@testing-library/jest-dom": "4.2.4",
"@testing-library/react": "9.3.2",
"@testing-library/user-event": "7.1.2",
"@thanos-wallet/dapp": "0.7.0",
"@types/jest": "24.0.0",
"@reduxjs/toolkit": "1.5.0",
"@taquito/beacon-wallet": "8.0.0-beta.5",
"@taquito/tzip16": "8.0.0-beta.5",
"@taquito/taquito": "8.0.0-beta.5",
"@types/lodash": "4.14.165",
"@types/node": "12.0.0",
"@types/react": "16.9.12",
"@types/react-dom": "16.9.0",
"@types/react-dropzone": "5.1.0",
"@types/react-redux": "7.1.16",
"axios-retry": "3.1.9",
"buffer": "6.0.3",
"framer-motion": "3.1.4",
"immer": "8.0.0",
"ipfs-http-client": "46.0.1",
"joi": "17.3.0",
"lodash": "4.17.20",
"prettier": "2.1.1",
"react": "16.13.1",
"react-awesome-reveal": "3.0.0",
"react-dom": "16.13.1",
"react-dropzone": "11.2.4",
"react-feather": "2.0.9",
"react-scripts": "3.4.1",
"react-redux": "7.2.2",
"typescript": "4.1.3",
"wouter": "2.5.1"
},
"devDependencies": {},
"devDependencies": {
"@types/jest": "24.0.0",
"@testing-library/jest-dom": "4.2.4",
"@testing-library/react": "9.3.2",
"@testing-library/user-event": "7.1.2",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
Expand Down
59 changes: 38 additions & 21 deletions client/public/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono&family=Roboto:wght@400;700&display=swap"
rel="stylesheet"
/>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -24,13 +29,26 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Minter</title>
</head>
<title>OpenMinter</title>
<script>
window.addEventListener('error', function (e) {
if (e.error.code === 8) {
e.stopImmediatePropagation();
console.warn(
'[OpenMinter] A BeaconSDK issue causes this error when using custom event types:\n' +
' > ' +
e.message
);
e.preventDefault();
}
});
</script>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -40,6 +58,5 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>

</body>
</html>
16 changes: 14 additions & 2 deletions client/src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';
import { Switch, Route } from 'wouter';
import SplashPage from '../SplashPage';
import CreateNonFungiblePage from '../CreateNonFungiblePage';
import Collections from '../Collections';
import CollectionsCatalog from '../Collections/Catalog';
import CollectionsTokenDetail from '../Collections/TokenDetail';
import Header from '../common/Header';
import { Flex } from '@chakra-ui/react';

Expand All @@ -11,14 +12,25 @@ export default function App() {
<Flex pos="absolute" w="100%" h="100%">
<Flex justifyContent="space-between" width="100%" flexDir="column">
<Header />

<Switch>
<Route path="/">
<SplashPage />
</Route>
<Route path="/create">
<CreateNonFungiblePage />
</Route>
<Collections />
<Route path="/collections">
<CollectionsCatalog />
</Route>
<Route path="/collection/:contractAddress/token/:tokenId">
{({ contractAddress, tokenId }) => (
<CollectionsTokenDetail
contractAddress={contractAddress}
tokenId={parseInt(tokenId)}
/>
)}
</Route>
</Switch>
</Flex>
</Flex>
Expand Down
29 changes: 14 additions & 15 deletions client/src/components/Collections/Catalog/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import React from 'react';
import { Flex, Heading, Text } from '@chakra-ui/react';
import { CreateCollectionButton } from '../../common/CreateCollection';
import { State, Action, Collection } from '../reducer';
import { useSelector, useDispatch } from '../../../reducer';
import {
selectCollection,
Collection
} from '../../../reducer/slices/collections';

interface CollectionTabProps extends Collection {
selected: boolean;
dispatch: React.Dispatch<Action>;
onSelect: (address: string) => void;
}

function CollectionTab({
address,
metadata,
selected,
dispatch
onSelect
}: CollectionTabProps) {
return (
<Flex
Expand All @@ -25,9 +29,7 @@ function CollectionTab({
cursor: 'pointer',
color: selected ? 'black' : 'gray.800'
}}
onClick={() =>
dispatch({ type: 'select_collection', payload: { address } })
}
onClick={() => onSelect(address)}
role="group"
>
<Flex
Expand All @@ -52,12 +54,9 @@ function CollectionTab({
);
}

interface SidebarProps {
state: State;
dispatch: React.Dispatch<Action>;
}

export default function Sidebar({ state, dispatch }: SidebarProps) {
export default function Sidebar() {
const state = useSelector(s => s.collections);
const dispatch = useDispatch();
return (
<>
<Heading px={4} pt={6} pb={4} size="md" color="brand.darkGray">
Expand All @@ -75,7 +74,7 @@ export default function Sidebar({ state, dispatch }: SidebarProps) {
<CollectionTab
key={state.globalCollection}
selected={state.globalCollection === state.selectedCollection}
dispatch={dispatch}
onSelect={address => dispatch(selectCollection(address))}
{...state.collections[state.globalCollection]}
/>
<Heading
Expand All @@ -94,11 +93,11 @@ export default function Sidebar({ state, dispatch }: SidebarProps) {
<CollectionTab
key={address}
selected={address === state.selectedCollection}
dispatch={dispatch}
onSelect={address => dispatch(selectCollection(address))}
{...state.collections[address]}
/>
))}
<Flex px={2} pt={2} justify="center">
<Flex px={2} pt={4} justify="center" pb={8}>
<CreateCollectionButton />
</Flex>
</>
Expand Down
7 changes: 4 additions & 3 deletions client/src/components/Collections/Catalog/TokenGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { useState } from 'react';
import { useLocation } from 'wouter';
import { AspectRatio, Box, Flex, Grid, Image, Text } from '@chakra-ui/react';
import { Token, State } from '../reducer';
import { Wind, HelpCircle } from 'react-feather';
import { Token, CollectionsState } from '../../../reducer/slices/collections';
import { ipfsUriToGatewayUrl } from '../../../lib/util/ipfs';

interface TokenTileProps extends Token {
selectedCollection: string;
Expand Down Expand Up @@ -60,7 +61,7 @@ function TokenTile(props: TokenTileProps) {
>
<AspectRatio ratio={3 / 2}>
<Box p={4}>
<TokenImage src={props.artifactUri} />
<TokenImage src={ipfsUriToGatewayUrl(props.artifactUri)} />
</Box>
</AspectRatio>
<Flex
Expand All @@ -78,7 +79,7 @@ function TokenTile(props: TokenTileProps) {
}

interface TokenGridProps {
state: State;
state: CollectionsState;
walletAddress: string;
}

Expand Down
Loading

0 comments on commit d5b64e4

Please sign in to comment.