Giter Site home page Giter Site logo

pony-unicorn / web3-framework Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 2.0 6.27 MB

Web3 App framework built using Next.js, RainbowKit and more!

Home Page: https://hexagon.testbug.cc/

JavaScript 1.73% TypeScript 96.92% CSS 1.35%
dapp ethereum-dapp nextjs wallet web3

web3-framework's Introduction

Hexagon - Web3 App Starter Kit

Getting Started

nodeJs:使用 .nvmrc 文件进行管理,版本为 lts/iron , 建议使用 fnm 作为版本管理

依赖包管理:必须使用 pnpm,版本为 9.1.4

Use

npx degit Pony-Unicorn/web3-framework my-project

cd my-project

pnpm install

Development

pnpm dev

错误处理

  • 推荐使用 [err, res] first error 形式进行错误处理,外部 throw 进行封装
const [err, res] = getUserInfo()
if(err){
  // Left code
}
// Right code

Core Dependencies

  • Wagmi - Wagmi Reactivity for Ethereum apps
  • viem - Ethereum library
  • web3modal - Wallet connection manager
  • Vercel - App Infrastructure

User Interface

  • TailwindCSS – Utility-first CSS framework for rapid UI development
  • Radix – Primitives like modal, popover, etc. to build a stellar user experience
  • shadcn-ui-theme-generator - theme generator
  • ui.shadcn.com components are included in the /components/ui folder
  • Framer Motion – Motion library for React to animate components with ease
  • React Icons – Beautifully simple, pixel-perfect icons

Developer Experience

  • TypeScript – Static type checker for end-to-end typesafety
  • Prettier – Opinionated code formatter for consistent code style
  • ESLint – Pluggable linter for Next.js and TypeScript
  • AssetPack – AssetPack is a tool for optimising assets for the web. It can be used to transform, combine, compress assets. Any asset that you want to transform or optimise into something else can be done with AssetPack.

目录结构

命名:

  • 组件名字使用大驼峰,组件的文件名使用连字符
  • 基础变量使用匈牙利命名规范,变量名 = 前缀(类型) + 描述(首字母大写)。例如 const iMyAge: number = 18
前缀 描述
a 数组 Array
b 布尔值 Boolean
cr 颜色参考值 Color Ref
fn 函数 Function
h 句柄 Handle
i 整形 Int
s 字符串 String

Color

  • background 背景色
  • foreground 前景色
  • popover 弹出窗色
  • card 卡片色
  • border 边框色
  • input 输入框色
  • muted 柔和色
  • primary 重要色
  • secondary 次要色
  • accent 强调色
  • destructive 警告、破坏性的
  • ring

Todo

  • 布局组件 flex、box、grid
  • 面板弹窗管理
  • 框架优化
    • 合约调用返回错误,框架中没有友好的提示 viem 的错误处理
      • console.log("error message >>>", error?.message.split("\n")[2])

bug

多语言注意事项

  • 配置多语言后,需要使用src/navigation 中的 Link, redirect, usePathname, useRouter

web3-framework's People

Contributors

pony-unicorn avatar ymj1078524201 avatar

Stargazers

 avatar  avatar kai avatar  avatar  avatar Thomas avatar

Watchers

 avatar

Forkers

boyquotes jw6223

web3-framework's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.