From d907e47d45ac37fedff11a04b52d2690283ca199 Mon Sep 17 00:00:00 2001 From: Alejandro Cremades Date: Wed, 18 Jan 2023 18:33:17 +0900 Subject: [PATCH 1/2] Updated README.md with info about environment variables and more --- .env.sample | 6 +++--- README.md | 35 +++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.env.sample b/.env.sample index bcb9fa3..965c44f 100644 --- a/.env.sample +++ b/.env.sample @@ -1,6 +1,6 @@ -NEXT_PUBLIC_IPFS_API_KEY="" -NEXT_PUBLIC_IPFS_API_SECRET="" -NEXT_PUBLIC_IPFS_API_ENDPOINT="https://api.pinata.cloud" +IPFS_API_KEY="" +IPFS_API_SECRET="" +IPFS_API_ENDPOINT="https://api.pinata.cloud" NEXT_PUBLIC_IPFS_GATEWAY_BASEURL"https://gateway.pinata.cloud" NEXT_PUBLIC_CHAIN_ID="" NEXT_PUBLIC_CONTRACT_HENKAKUV2_ADDRESS="" diff --git a/README.md b/README.md index abd3e54..200d97b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). +# henkaku-nengajo-frontend -## Getting Started +This is the frontend for [HENKAKU Nengajo](https://nengajo.henkaku.org/). It is a [Next.js](https://nextjs.org/) project. -First,install dependencies +## How to run the project locally + +First, install the dependencies: ```bash yarn install @@ -14,15 +16,11 @@ Second, run the development server: yarn dev ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. +Open [http://localhost:3000](http://localhost:3000) with your browser to see the site. -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. +For some features, you will need to provide environment variables to Next. Please see below. -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. - -## Learn More +### Next.js resources To learn more about Next.js, take a look at the following resources: @@ -31,8 +29,21 @@ To learn more about Next.js, take a look at the following resources: You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! -## Deploy on Vercel +## Environment variables + +Create a copy of `.env.sample`, name it `.env.local`, and replace the information as needed. Note that not all variables need to be populated. + +- `NEXT_PUBLIC_CHAIN_ID`: use 137 for MATIC (Polygon), 80001 for the Mumbai testnet, or 1337 if you are testing locally with Hardhat +- `NEXT_PUBLIC_CONTRACT_HENKAKUV2_ADDRESS` and `NEXT_PUBLIC_CONTRACT_NENGAJO_ADDRESS`: these are only used when the chain is set to Hardhat (deploy) +- `NEXT_PUBLIC_IPFS_API_KEY` and `NEXT_PUBLIC_IPFS_API_SECRET`: get your own keys at [Pinata](https://app.pinata.cloud/) to be able to create Nengajos from a locally served frontend +- `NEXT_PUBLIC_IPFS_API_ENDPOINT`: please use "https://api.pinata.cloud" +- `NEXT_PUBLIC_IPFS_GATEWAY_BASEURL`: feel free to use a custom one if you have one +- `NEXT_PUBLIC_JSONRPC_HTTP` and `NEXT_PUBLIC_JSONRPC_WS`: get your own at [alchemy](https://www.alchemy.com/) + +## On collaborating + +Henkaku is not a completely open community and, while this is an open source project, many communications about the project as well as the tokens to operate it are only shared among community members. -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. +This site is hosted on [Vercel](https://vercel.com/), and preview sites are automatically created for each new pull request. However, if the PR comes from a forked repo, the preview deployment will need to be approved by a maintainer. Please wait for us to notice the PR or talk to us over Discord. Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. From 05de3aa23584a58ee678afa2cb977d01483a1fe5 Mon Sep 17 00:00:00 2001 From: Alejandro Cremades Date: Thu, 19 Jan 2023 05:09:01 +0900 Subject: [PATCH 2/2] Corrected yarn instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 200d97b..45886e5 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is the frontend for [HENKAKU Nengajo](https://nengajo.henkaku.org/). It is First, install the dependencies: ```bash -yarn install +yarn ``` Second, run the development server: