Skip to content

Commit d4259ca

Browse files
authored
Merge pull request #3 from gear-foundation/vt-digit-recognition-frontend
digit-recognition frontend
2 parents 90add8e + 8970124 commit d4259ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+7225
-4
lines changed

.github/workflows/CI-CD_digit-recognition-frontend.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ jobs:
7575
push: true
7676
build-args: |
7777
NODE_ENV=${{ env.NODE_ENV }}
78-
VITE_WALLET_CONNECT_PROJECT_ID=${{ env.VITE_WALLET_CONNECT_PROJECT_ID }}
79-
VITE_GEAR_API_NODE=${{ env.VITE_GEAR_API_NODE }}
80-
VITE_ETH_NODE_ADDRESS=${{ env.VITE_ETH_NODE_ADDRESS }}
81-
VITE_CONTRACT_ADDRESS=${{ env.VITE_CONTRACT_ADDRESS }}
78+
VITE_WALLET_CONNECT_PROJECT_ID=${{ secrets.VITE_WALLET_CONNECT_PROJECT_ID_DIGIT_RECOGNITION }}
79+
VITE_GEAR_API_NODE=${{ secrets.VITE_GEAR_API_NODE }}
80+
VITE_ETH_NODE_ADDRESS=${{ secrets.VITE_ETH_NODE_ADDRESS }}
81+
VITE_CONTRACT_ADDRESS_DIGIT_RECOGNITION=${{ secrets.VITE_CONTRACT_ADDRESS_DIGIT_RECOGNITION }}
8282
tags: ${{ needs.prepair.outputs.image_name }}
8383

8484
deploy-to-k8s:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
VITE_WALLET_CONNECT_PROJECT_ID=
2+
VITE_GEAR_API_NODE=
3+
VITE_ETH_NODE_ADDRESS=
4+
VITE_CONTRACT_ADDRESS_DIGIT_RECOGNITION=
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
.env
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM node:18-alpine
2+
3+
WORKDIR /opt
4+
5+
RUN apk add --no-cache xsel
6+
7+
COPY package.json yarn.lock ./
8+
9+
RUN yarn install --frozen-lockfile
10+
11+
COPY . .
12+
13+
ARG VITE_WALLET_CONNECT_PROJECT_ID \
14+
VITE_GEAR_API_NODE \
15+
VITE_ETH_NODE_ADDRESS \
16+
VITE_CONTRACT_ADDRESS_DIGIT_RECOGNITION
17+
18+
ENV VITE_WALLET_CONNECT_PROJECT_ID=${VITE_WALLET_CONNECT_PROJECT_ID} \
19+
VITE_CONTRACT_ADDRESS_DIGIT_RECOGNITION=${VITE_CONTRACT_ADDRESS_DIGIT_RECOGNITION} \
20+
VITE_GEAR_API_NODE=${VITE_GEAR_API_NODE} \
21+
VITE_ETH_NODE_ADDRESS=${VITE_ETH_NODE_ADDRESS} \
22+
DISABLE_ESLINT_PLUGIN=true
23+
24+
RUN yarn build
25+
26+
RUN npm install --global serve
27+
28+
EXPOSE 4173
29+
30+
CMD ["serve", "-s", "/opt/dist"]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# AI Image Recognition
2+
3+
## Description
4+
5+
React application of AI Image Recognition.
6+
7+
## Getting started
8+
9+
### Install packages:
10+
11+
```sh
12+
yarn install
13+
```
14+
15+
### Declare environment variables:
16+
17+
Create `.env` file, `.env.example` will let you know what variables are expected.
18+
19+
### Run the app:
20+
21+
```sh
22+
yarn start
23+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)
636 Bytes
Loading
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en" class="dark">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/png" href="/favicon.png" sizes="any" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>AI Image Recognition</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "distributed-computation",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"lint": "eslint .",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"@polkadot/types": "14.3.1",
14+
"@reown/appkit": "^1.6.0",
15+
"@reown/appkit-adapter-wagmi": "^1.6.0",
16+
"@tanstack/react-query": "^5.59.20",
17+
"react": "^18.3.1",
18+
"react-dom": "^18.3.1",
19+
"wagmi": "^2.12.29"
20+
},
21+
"devDependencies": {
22+
"@eslint/js": "^9.13.0",
23+
"@types/react": "^18.3.12",
24+
"@types/react-dom": "^18.3.1",
25+
"@vitejs/plugin-react": "^4.3.3",
26+
"eslint": "^9.13.0",
27+
"eslint-plugin-react-hooks": "^5.0.0",
28+
"eslint-plugin-react-refresh": "^0.4.14",
29+
"globals": "^15.11.0",
30+
"typescript": "~5.6.2",
31+
"typescript-eslint": "^8.11.0",
32+
"vite": "^5.4.10",
33+
"vite-plugin-checker": "0.8.0",
34+
"vite-plugin-svgr": "^4.3.0",
35+
"sass": "1.62.0"
36+
}
37+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.connectionWrapper {
2+
display: flex;
3+
flex-direction: column;
4+
justify-content: center;
5+
align-items: center;
6+
gap: 48px;
7+
padding-top: 0;
8+
min-height: calc(100vh - 78px);
9+
}

0 commit comments

Comments
 (0)