Skip to content

Commit

Permalink
Merge pull request XPRNetwork#1 from ProtonProtocol/update-readme
Browse files Browse the repository at this point in the history
Update readme with Firebase config instructions
  • Loading branch information
cindyssun5 authored May 6, 2021
2 parents 362ca30 + 3b73756 commit cacdf09
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,45 @@ npm install
npm run dev
```

### Set up a Cloud Firestore

This project uses Firebase for the dynamic configuration of homepage templates.
Please refer to the [Firebase
documentation](https://firebase.google.com/docs/firestore) to set up your
firestore.

Note you'll need to set the following environment variables:

- `FIREBASE_API_KEY`
- `FIREBASE_AUTH_DOMAIN`
- `FIREBASE_PROJECT_ID`

If you do not want to implement Firebase, remove the invocation of
`useFirebaseFeaturedTemplates` and fetch templates directly from Atomic Assets
(for example, with the
`http://proton.api.atomicassets.io/atomicassets/docs/swagger/#/templates/get_v1_templates`
endpoint).

The API response will contain an array of templates which you can pass as the
`items` prop of the `Grid` component rendered.

```js
// pages/index.tsx

const MarketPlace = (): JSX.Element => {
const featuredTemplates = useFirebaseFeaturedTemplates();
return (
<PageLayout>
<Banner modalType={MODAL_TYPES.CLAIM} />
<ExploreCard />
<HomepageStatistics />
<Title>New &amp; Noteworthy</Title>
<Grid items={featuredTemplates} />
</PageLayout>
);
};
```

## Environment

Create a copy of `.env.template` and name it `.env.local`:
Expand All @@ -43,13 +82,19 @@ For mainnet:
NEXT_PUBLIC_CHAIN_ENDPOINTS='https://proton.eoscafeblock.com, https://proton.greymass.com'
NEXT_PUBLIC_BLOCK_EXPLORER='https://proton.bloks.io/block/'
NEXT_PUBLIC_NFT_ENDPOINT='https://proton.api.atomicassets.io'
FIREBASE_API_KEY=string
FIREBASE_AUTH_DOMAIN=string
FIREBASE_PROJECT_ID=string
```

For testnet:
```
NEXT_PUBLIC_CHAIN_ENDPOINTS='https://testnet.protonchain.com'
NEXT_PUBLIC_BLOCK_EXPLORER='https://proton-test.bloks.io/block/'
NEXT_PUBLIC_NFT_ENDPOINT='https://test.proton.api.atomicassets.io'
FIREBASE_API_KEY=string
FIREBASE_AUTH_DOMAIN=string
FIREBASE_PROJECT_ID=string
```

## Marketplace
Expand Down

0 comments on commit cacdf09

Please sign in to comment.