Giter Site home page Giter Site logo

generationsoftware / pooltogether-client-monorepo Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 9.0 12.09 MB

Apps and packages for the PoolTogether Hyperstructure.

Home Page: https://cabana.fi

License: MIT License

JavaScript 0.36% TypeScript 99.00% CSS 0.64%
ethereum nextjs rainbowkit react tailwind tailwindcss turborepo typescript viem wagmi

pooltogether-client-monorepo's Introduction

PoolTogether Brand


๐Ÿ’ป ย  PoolTogether Client Monorepo

This monorepo includes many of PoolTogether's apps and packages in order to facilitate code sharing and maintainability.

๐Ÿ’พ ย  Installation

Make sure you have pnpm installed, as it is the package manager used throughout this monorepo.

pnpm i

๐ŸŽ๏ธ ย  Quickstart

Development

pnpm dev

Each app is already setup with its own port through its package.json dev script.


Apps

  • app: App w/ core PoolTogether Hyperstructure functionality.
  • landing-page: Landing page for the many interfaces in this monorepo.
  • vault-factory: App to create and manage 4626 vaults.
  • vaultlist-creator: App to create, edit and distribute vault lists.
  • analytics: App to visualize analytics and general health metrics of the PoolTogether protocol.
  • swaps: Simple app to guide users to swap into PoolTogether vaults.
  • rewards-builder: App to create and manage TWAB reward promotions for any prize vault.
  • flash-liquidator: App to flash liquidate yield from any PoolTogether liquidation pair linked to a prize vault.
  • migrations: App to facilitate migrations from old protocol versions.
  • incentives: App to present the protocol's many onchain and offchain incentives for contributors.

All apps above are Next.js apps with Tailwind CSS support, written in TypeScript.

Repo Links: App | Landing Page | Vault Factory | VaultList Creator | Analytics | Swaps | Rewards Builder | Flash Liquidator | Migrations | Incentives


Packages

  • hyperstructure-client-js: Protocol-specific functions to easily interact with onchain Hyperstructure data, using Viem.
  • hyperstructure-react-hooks: Shared React hooks specific to Hyperstructure functionality, using WAGMI.

Prize pool and auxiliary contract addresses are included in the hyperstructure-client-js package. If you'd like to use older protocol deployments, refer to the versions below:

Repo Links: Hyperstructure Client JS | Hyperstructure React Hooks


Shared Library

  • config: Shared config for TypeScript, Tailwind, etc.
  • generic-react-hooks: Shared React hooks.
  • react-components: React component library utilizing some simpler components from ui, using WAGMI.
  • types: Shared Typescript types.
  • ui: Stub React component library with Tailwind used throughout many apps, using Flowbite.
  • utilities: Shared Typescript utilities.

The dependencies for these libraries are picked up from the root package.json file of the monorepo!

Repo Links: Config | Generic React Hooks | React Components | Types | UI | Utilities


Workers

  • protocol-stats-worker: Caching basic stats about the PoolTogether protocol.
  • token-prices-worker: Caching token prices.

Repo Links: Protocol Stats | Token Prices


Utilities

This Turborepo has some additional tools already setup:


Adding New Network

  1. Update the constants.ts file in utilities with values and addresses for the new network.
  2. Make sure the usePublicClients and usePublicClientsByChain hooks in hyperstructure-react-hooks include the new network.
  3. Update the config.ts file and ENVs for any app you want to use this new network on.
  4. Optionally add any token logo overrides in the constants.ts file in the react-components package.

Wallet Support

Want your wallet in any of our apps? We rely on RainbowKit and WAGMI for wallet connection. If you have a suitable wallet connector we can add your wallet and give you a custom link to highlight your wallet for your users.

Append ?wallet=<wallet key> to any app's links to highlight your wallet. Keys are visible on each app's config.ts file. Example: App Config.


Known Issues / Fixes

When adding/updating apps and/or packages, duplicate dependencies may be created, creating versioning issues. This can be resolved through running pnpm up -r as described here, or just looking through pnpm-lock.yaml to identify version discrepancies.

The biggest culprit of the above is @tanstack/react-query, which sometimes is installed as two different versions and apps can no longer utilize hooks from the hooks package. This has been solved through the method described here.

If editing component themes in ui, having the Tailwind CSS IntelliSense plugin for VSCode is recommended. In order to enable it for custom Flowbite themes and string class names, add theme and .*ClassName* to the Class Attributes setting.

pooltogether-client-monorepo's People

Contributors

chuckbergeron avatar ncookiez avatar trmid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.