Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_PREFIX = bridge
NEXT_PUBLIC_APP_NAME = bridge
NEXT_PUBLIC_APP_ENV = testnet
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID = 5c5740c548328b21cf14472d580f3e2a
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NEXT_PUBLIC_PREFIX = bridge
NEXT_PUBLIC_APP_NAME = bridge
# NEXT_PUBLIC_SENTRY_DNS = https://example.ingest.sentry.io/0000000
# NEXT_PUBLIC_ANALYTICS_ID = G-XXXXXXXXX
# NEXT_PUBLIC_APP_ENV = testnet

NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID = 5c5740c548328b21cf14472d580f3e2a
31 changes: 31 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"eslint-config-prettier",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/ban-ts-comment": 0,
"react-hooks/exhaustive-deps": [
"warn",
{
"additionalHooks": "^use(LockCallback|Interval|ThrottleCallback|DebounceCallback)$"
}
]
},
"env": {
"browser": true,
"node": true
}
}
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: 👾 Bug Report
about: Report a bug or issue with the project.
title: ''
labels: 'bug'
assignees: ''

---

### Description
A clear and concise description of what the bug is.

### Steps To Reproduce
1. Log in...
2. Ensure that...
3. Allow a long period of inactivity to pass...
4. Observe that...
5. Attempt to log in...

### Current Behavior
- After the period of inactivity...
- When the user tries to log in using another method...
- This causes a bug due to...

### Expected Behavior
- After a long period of inactivity...
- When a user logs in successfully...
- This ensures that only...

### Environment
- Platform: PC
- Node: v18.18.0
- Browser: Chrome 126.0.6478.56
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
blank_issues_enabled: false
issue_template:
- name: 👾 Bug Report
description: Report a bug or issue with the project.
labels: ["bug"]
template: bug_report.md
- name: 💡 Feature Request
description: Create a new ticket for a new feature request.
labels: ["enhancement"]
template: feature_request.md
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: 💡 Feature Request
about: Create a new ticket for a new feature request
title: ''
labels: 'enhancement'
assignees: ''

---

### Expected Behavior
Describe the expected behavior here.

### Specifications
As a `user`, I would like to `action` so that `reason`.

**Features:**
- describe feature details here.

**Development Tasks:**
- [ ] Task 1
- [ ] Task 2

### Dependencies
List any dependencies that are required for this feature by providing links to the issues or repositories.

### References
List any references that are related to this feature request.
21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup
runs:
using: composite
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: yarn

- uses: actions/cache@v3
id: install-cache
with:
path: node_modules/
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}

- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts
shell: bash
41 changes: 41 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run tests and upload coverage

on:
push:
branches:
- dev
- master
# - release/*
- feature/ut
pull_request:
branches:
- master

jobs:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20.18.2'

- name: Install dependencies
run: yarn

- name: Run tests
run: yarn vitest run --coverage

- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
flags: unittests
name: codecov-umbrella
43 changes: 43 additions & 0 deletions .github/workflows/mainnet-package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push Image
on:
push:
tags:
- 'v*.*.*'
jobs:
build-and-push-image:
runs-on: eBridge-runner
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create image tag
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/ebridge-web # change this to your project frontend name
tags: |
type=ref,event=tag
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
env:
NEXT_PUBLIC_SENTRY_DNS: ${{ secrets.MAINNET_NEXT_PUBLIC_SENTRY_DNS }} # testnet mainnet
NEXT_PUBLIC_ANALYTICS_ID: ${{ secrets.MAINNET_NEXT_NEXT_PUBLIC_ANALYTICS_ID }}
NEXT_PUBLIC_APP_ENV: mainnet
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.MAINNET_NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID }}
NEXT_PUBLIC_TON_API_KEY: ${{ secrets.MAINNET_NEXT_PUBLIC_TON_API_KEY }}
with:
context: .
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
NEXT_PUBLIC_SENTRY_DNS=${{ secrets.MAINNET_NEXT_PUBLIC_SENTRY_DNS }}
NEXT_PUBLIC_ANALYTICS_ID=${{ secrets.MAINNET_NEXT_NEXT_PUBLIC_ANALYTICS_ID }}
NEXT_PUBLIC_APP_ENV=mainnet
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=${{ secrets.MAINNET_NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID }}
NEXT_PUBLIC_TON_API_KEY=${{ secrets.MAINNET_NEXT_PUBLIC_TON_API_KEY }}
ENV_NAME=mainnet
33 changes: 33 additions & 0 deletions .github/workflows/nextLint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Next Lint Check
#

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '20' # Your node version, default 20 in 2024

- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Install Dependencies
run: yarn

- name: Run ESLint
run: yarn lint
23 changes: 23 additions & 0 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Security Review

permissions:
pull-requests: write
contents: read

on:
pull_request:

jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 2

- uses: Portkey-Wallet/claude-code-security-review@main
with:
comment-pr: true
claude-api-key: ${{ secrets.CLAUDE_API_KEY }}
run-every-commit: true
21 changes: 21 additions & 0 deletions .github/workflows/sonarqube.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
pull_request:
types: [opened, synchronize, reopened]

name: PR Static Code Analysis
jobs:
static-code-analysis:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@v2.1.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
with:
args: >
-Dsonar.projectKey=ebridge-web
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Test

on:
push:
branches: ['dev', 'master']
pull_request:
branches: ['dev', 'master']

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: yarn lint
67 changes: 67 additions & 0 deletions .github/workflows/testnet-package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

name: Build and Push Image
on:
push:
branches: ['release/*']
jobs:
build-and-push-image:
runs-on: eBridge-runner
permissions:
contents: read
outputs:
short_sha: ${{ steps.vars.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "short_sha=$calculatedSha" >> "$GITHUB_OUTPUT"
- name: Create image tag
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/ebridge-web # change this to your project frontend name
tags: |
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
env:
NEXT_PUBLIC_SENTRY_DNS: ${{ secrets.TESTNET_NEXT_PUBLIC_SENTRY_DNS }} # testnet mainnet
NEXT_PUBLIC_ANALYTICS_ID: ${{ secrets.TESTNET_NEXT_NEXT_PUBLIC_ANALYTICS_ID }}
NEXT_PUBLIC_APP_ENV: testnet
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.TESTNET_NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID }}
with:
context: .
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
NEXT_PUBLIC_SENTRY_DNS=${{ secrets.TESTNET_NEXT_PUBLIC_SENTRY_DNS }}
NEXT_PUBLIC_ANALYTICS_ID=${{ secrets.TESTNET_NEXT_NEXT_PUBLIC_ANALYTICS_ID }}
NEXT_PUBLIC_APP_ENV=testnet
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=${{ secrets.TESTNET_NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID }}
ENV_NAME=testnet
dispatch:
runs-on: eBridge-runner
needs: build-and-push-image
steps:
- name: Deploy
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TOK }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'eBridgeCrosschain',
repo: 'devops',
workflow_id: 'deployment_testnet.yaml',
ref: 'main',
inputs: {
appName: 'ebridge-web-server',
commit_sha: 'sha-${{ needs.build-and-push-image.outputs.short_sha }}',
}
})
Loading