Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front end of ccd claim rewards pushed by FISTA #108

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions compliant-reward-distribution/frontend/.eslintignore

This file was deleted.

32 changes: 0 additions & 32 deletions compliant-reward-distribution/frontend/.eslintrc.cjs

This file was deleted.

6 changes: 6 additions & 0 deletions compliant-reward-distribution/frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["next/core-web-vitals", "next/typescript"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
}
61 changes: 33 additions & 28 deletions compliant-reward-distribution/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
# Logs
logs
*.log
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
node_modules

dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
1 change: 0 additions & 1 deletion compliant-reward-distribution/frontend/.prettierignore

This file was deleted.

1 change: 0 additions & 1 deletion compliant-reward-distribution/frontend/.yarnrc.yml

This file was deleted.

5 changes: 0 additions & 5 deletions compliant-reward-distribution/frontend/CHANGELOG.md

This file was deleted.

72 changes: 20 additions & 52 deletions compliant-reward-distribution/frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,36 @@
# Front end
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Setup
## Getting Started

Make sure to have the following installed:

- [NodeJs](https://nodejs.org).
- [yarn](https://yarnpkg.com/getting-started/install) or a similar package manager.
- Rust and cargo (Recommended to install using [rustup](https://rustup.rs)).

## Frontend

To setup and install dependencies for the frontend navigate to the `frontend` directory and run:

```bash
yarn install
```

### Development

Set the environment variable `NETWORK` and `CONCORDIUM_NODE`, or prefix it before the `yarn dev` call.
Not setting the environment variables will run the frontend with the default `testnet` configuration.
First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

or
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

```bash
NETWORK="mainnet" CONCORDIUM_NODE="https://grpc.mainnet.concordium.software:20000" yarn dev
```
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This will launch a development server with hot module replacement enabled.
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

_Please note that calls to the backend server do not work in the development setup._
## Learn More

If you want to set up the whole project together with running the backend services so that the endpoints work. Follow the instructions in the project's [README.md](../indexer-and-server/README.md).
To learn more about Next.js, take a look at the following resources:

This frontend calls following backend endpoints:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

- `api/setClaimed`
- `api/getPendingApprovals`
- `api/getAccountData`
- `api/getZKProofStatements`
- `api/postTweet`
- `api/postZKProof`
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

from the [backend server](../indexer-and-server)
## Deploy on Vercel

### Environment variables

These environment variables are available in the frontend.

When hosting the frontend via the [backend server](../indexer-and-server), the values of the environment variables are passed in via the server.

```bash
NETWORK=testnet # The network to use mainnet/testnet (defaults to 'testnet')
CONCORDIUM_NODE=https://grpc.testnet.concordium.com:20000 # The gRPC endpoint of a node in the chosen network (defaults to 'https://grpc.testnet.concordium.com:20000')
```

### Build

```bash
yarn build
```
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 will bundle the project into `frontend/dist` directory which should be hosted by the [backend server](../indexer-and-server).
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
25 changes: 0 additions & 25 deletions compliant-reward-distribution/frontend/global.d.ts

This file was deleted.

16 changes: 0 additions & 16 deletions compliant-reward-distribution/frontend/index.html

This file was deleted.

4 changes: 4 additions & 0 deletions compliant-reward-distribution/frontend/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
Loading