GithubHelp home page GithubHelp logo

blackeyhou / vitasensus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ufe-pr/vitasensus

0.0 0.0 0.0 1.48 MB

Home Page: https://vitasensus.vercel.app/

License: GNU General Public License v3.0

JavaScript 1.23% TypeScript 96.93% CSS 1.10% HTML 0.73%

vitasensus's Introduction

The Official Vite Dapp Template

Getting Started

npm install

# run unit test for test/*.spec.ts
npx vuilder test

# deploy contract
# edit scripts/deploy.config.json && run deploy scripts
npx ts-node scripts/deploy.ts

# stake quota for contract(by web-wallet)

Getting Started with the Frontend

A frontend created with create-react-app using React, TypeScript, and Tailwind CSS has been created under the frontend folder.

Features frontend implements out of the box:

  • Routing with react-router-dom v6
  • Global state management using a higher-order component called connect which connects the passed in component to a single context.
    • Implemented in globalContext.tsx
    • The initial global state is set in App.tsx
    • To mutate the global state, a setState function is passed to all connected components as a prop.
      • Pass an object to it and its properties will be shallow merged with the current global state
        • e.g. setState({ networkType: network })
        • To deep merge, pass a second meta object to setState like:
           setState({ a: { b: 'c' } }, { deepMerge: true });
           // { a: { d: 3 } } => { a: { d: 3, b: 'c' } }
    • Note: all non-page component that are connected go in the containers folder, else they go in the components folder.
    • The State type can be modified in types.ts
  • ViteConnect for signing transactions with the Vite Wallet iOS / Android app
    • Implemented in viteConnect.ts
      • This handles saving the ViteConnect session to a browsers localStorage to persist it after reloading the page
      • To call a contract, a callContract function is passed to all connected components as a prop.
      • Contracts should be stored in the contracts folder.
  • internationalization (i18n)
  • Light, Dark, and System themes
  • Toast alerts
    • Implemented in Toast.tsx
    • To use, call setState({ toast: 'message' }) in a connected component.

This is a fork of dapp-buymeacoffee

vitasensus's People

Contributors

ufe-pr avatar wepsree avatar

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.