Skip to content

Commit

Permalink
Release ghostnet ✨ 🚀 (#401)
Browse files Browse the repository at this point in the history
* edit pipeline to create a docker image for beta version.  [skip ci]

* Upgrade Batcher UI (#388)

* 🚧 💥 init migration to NextJS

* 🚧 🎨 💄 rewriting style without less & antd

* 🚧 add redux & redux-loop to manage wallet connection

* 🔧 update react-GA due to merge

* 🔧 fix husky

* 💥 organize global state with redux and write some types to represent smart contract types

* 🚧

* 🚧 use both context and redux to manage wallet and tzkt instance

* 💄 review choose pair component

* cleaning...

* 🚧 deposit token

* 🚧 rework batcher infos ✨

* 🚧 impl oracle price

* 🚧 trying to deploy with NextJS

* 🚧 🔧 make nextjs/tailwind working in Docker

* 🚧 test deploying

* 🚧 run nextjs server on port 80

* 🚧 volumes

* 🔥 clean code and add metadata

* 🚧 websocket improvments

* 🚧 fix warning

* 🚧

* 💄 review styling

* 💄 update style with feedbacks

* ✨ volumes & holdings

* ♻️ review some items && change contract address for ghostnet

* 🐛 fix bugs on swap component

* ♻️ change pair selecting

* 🐛 fix some bugs

* 🔥 remove useless files and clean ✨

* 🔧 fix issue with images

* 🔥 move folders into src

* ✨ add Copy & Tooltip component from tzsafe-ui

* 🚧

* 🔥 remove useless file

* 🐛 fix user balance fetching

---------

Co-authored-by: Quentin <[email protected]>
Co-authored-by: Quentin Burg <[email protected]>

* 🔧 update github workflow with staging branch instead of feature branch && 🐛 fix bug with oracle price

* 🐛 fix volumes update when received an event from bigmap

* Improve requests (#398)

* ⚡ improve number of requests to tzkt API && 🏷️ add types for contract

* ⚡ decrease requests number to smart contract

---------

Co-authored-by: Quentin Burg <[email protected]>

* ♻️ remove tzkt SDK

* 🐛 get fees amount from storage before deposit tokens

* ♻️ improve check status from http request

* 🔍 write open graph metadata

* ✨ add token icon in swap selector

* 🍱 add tzbtc icon in local

* 🚧 test og metadata

* :sparkles add tooltip on price strategy

* ✨ select tokens both side

* ✨ add toasts for error and info

* 💚 try to fix CI failure

* 🔧 choose the right network depending on network targeted

* 🚧 try to fix CI

* 🐛 fix issues with holdings and improve other things

* ♻️ upgrade taquito

* favicon is missing

---------

Co-authored-by: Cyril B <[email protected]>
Co-authored-by: Quentin <[email protected]>
Co-authored-by: Quentin Burg <[email protected]>
  • Loading branch information
4 people authored Sep 13, 2023
1 parent ed3aa21 commit 7e94bdf
Show file tree
Hide file tree
Showing 116 changed files with 12,894 additions and 4,457 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/docker-ghostnet-front-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Docker ghostnet front staging

on:
push:
branches:
- 'release-ghostnet-staging'
- 'release-ghostnet-beta'
pull_request:
branches:
- 'release-ghostnet-staging'
- 'release-ghostnet-beta'
types:
- closed
workflow_dispatch:

jobs:
ui:
strategy:
matrix:
network: [ghostnet]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
submodules: true

- name: Set outputs
id: vars
run: |
echo "date=$(date +%Y-%m-%dT%H-%M-%S)" >> "${GITHUB_OUTPUT}"
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
- name: Set up Docker Buildx
uses: docker/Setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push ui version release-ghostnet-staging
if: github.ref == 'refs/heads/release-ghostnet-staging'
uses: docker/build-push-action@v3
with:
file: ./batcher-ui/Dockerfile.${{ matrix.network }}
context: ./batcher-ui/
push: ${{ github.ref == 'refs/heads/release-ghostnet-staging' }}
tags: |
ghcr.io/marigold-dev/batcher-${{ matrix.network }}:staging
ghcr.io/marigold-dev/batcher-${{ matrix.network }}:${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.sha_short }}-staging
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push ui version on release-ghostnet-beta
if: github.ref == 'refs/heads/release-ghostnet-beta'
uses: docker/build-push-action@v3
with:
file: ./batcher-ui/Dockerfile.${{ matrix.network }}
context: ./batcher-ui/
push: ${{ github.ref == 'refs/heads/release-ghostnet-beta' }}
tags: |
ghcr.io/marigold-dev/batcher-${{ matrix.network }}:beta
ghcr.io/marigold-dev/batcher-${{ matrix.network }}:${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.sha_short }}-beta
cache-from: type=gha
cache-to: type=gha,mode=max
8 changes: 0 additions & 8 deletions batcher-ui/.eslintrc.js

This file was deleted.

24 changes: 24 additions & 0 deletions batcher-ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": [
"eslint:recommended",
"next",
"prettier"
],
// For more informations, see https://github.com/vercel/next.js/issues/40687#issuecomment-1378845989
"overrides": [
{
// Adapt to your needs (e.g. some might want to only override "next.config.js")
"files": [
"*.js"
],
// This is the default parser of ESLint
"parser": "espree",
"parserOptions": {
"ecmaVersion": 2020
}
}
],
"rules": {
"no-unused-vars": "off"
}
}
6 changes: 1 addition & 5 deletions batcher-ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ yarn-error.log
/coverage
.idea
yarn.lock
package-lock.json
pnpm-lock.yaml
*bak

Expand All @@ -28,13 +27,10 @@ pnpm-lock.yaml
functions/*
.temp/**

# umi
.umi
.umi-production

# screenshot
screenshot
.firebase
.eslintcache

build
.next
1 change: 0 additions & 1 deletion batcher-ui/.husky/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions batcher-ui/.husky/commit-msg

This file was deleted.

2 changes: 1 addition & 1 deletion batcher-ui/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
npx lint-staged
10 changes: 10 additions & 0 deletions batcher-ui/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const path = require('path');

const buildEslintCommand = filenames =>
`next lint --fix --file ${filenames
.map(f => path.relative(process.cwd(), f))
.join(' --file ')}`;

module.exports = {
'*.{js,jsx,ts,tsx}': [buildEslintCommand],
};
2 changes: 0 additions & 2 deletions batcher-ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
**/*.svg
package.json
.umi
.umi-production
/dist
.dockerignore
.DS_Store
Expand Down
5 changes: 0 additions & 5 deletions batcher-ui/.prettierrc.js

This file was deleted.

7 changes: 7 additions & 0 deletions batcher-ui/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "es5",
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"tabWidth": 2
}
3 changes: 0 additions & 3 deletions batcher-ui/.stylelintrc.js

This file was deleted.

17 changes: 12 additions & 5 deletions batcher-ui/Dockerfile.ghostnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ FROM node:latest as builder

WORKDIR /app

# ENV ENV=ghostnet

COPY ./package.json ./

RUN npm install

COPY ./tsconfig.json ./jsconfig.json ./
COPY ./pages ./pages
COPY ./src ./src
COPY ./styles ./styles
COPY ./public ./public
COPY ./img ./img
COPY ./config ./config
COPY ./postcss.config.js ./postcss.config.js
COPY ./next.config.js ./next.config.js
COPY ./tailwind.config.js ./tailwind.config.js


RUN npm run build:ghostnet

RUN npm run build:ghostnet-ci
EXPOSE 80

FROM nginx:latest
CMD ["npm", "run", "start:ghostnet"]

COPY --from=builder /app/dist /usr/share/nginx/html
26 changes: 26 additions & 0 deletions batcher-ui/Dockerfile.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:latest as builder

WORKDIR /app

# ENV ENV=ghostnet

COPY ./package.json ./

RUN npm install

COPY ./tsconfig.json ./jsconfig.json ./
COPY ./pages ./pages
COPY ./src ./src
COPY ./styles ./styles
COPY ./public ./public
COPY ./postcss.config.js ./postcss.config.js
COPY ./next.config.js ./next.config.js
COPY ./tailwind.config.js ./tailwind.config.js


RUN npm run build:staging

EXPOSE 80

CMD ["npm", "run", "start:staging"]

44 changes: 18 additions & 26 deletions batcher-ui/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Ant Design Pro
# Batcher User Interface


This project is built with React ecosystem. Follow is the quick guide for how to use.

This project is initialized with [Ant Design Pro](https://pro.ant.design). Follow is the quick guide for how to use.

## Environment Prepare

Expand All @@ -10,48 +12,38 @@ Install `node_modules`:
npm install
```

or
### Run project in development mode

```bash
yarn
```

## Provided Scripts
:warning: For now, Batcher in development runs onto Ghostnet Smart Contract.

Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.

Scripts provided in `package.json`. It's safe to modify or add additional script:

### Start project

```bash
npm start
```

### Build project

```bash
npm run build
```

### Check code style

```bash
npm run lint
npm run dev

```

You can also use script to auto fix some lint error:
### Start project on GHOSTNET


```bash
npm run lint:fix
npm run build:ghostnet && npm run start:ghostnet

```

### Test code
### Build project on MAINNET




```bash
npm test
```
npm run build && npm start

## More
```

You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro).
15 changes: 0 additions & 15 deletions batcher-ui/config/config.dev.ts

This file was deleted.

Loading

0 comments on commit 7e94bdf

Please sign in to comment.