Coder Social home page Coder Social logo

dappcenter / frontend-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hermes-defi/hermes-defi-frontend

0.0 1.0 1.0 9.43 MB

Front-end website for using our contracts

Home Page: hermesfrontend.vercel.app

License: MIT License

TypeScript 99.27% Shell 0.01% JavaScript 0.73%

frontend-1's Introduction

Hermes DEFI

Getting Started

This project was built using nextjs, chakra-ui, web3-react and react-query

To setup the project, you need the following:

Pre setup

  • cp .env.example .env.local
  • REDIS_URL - from upstash.com for caching homepage and tvl historical data (if you have a better idea how to get the tvl history, feel free to implement)
  • Add the URL to the .env.local in the HERMES_REDIS_URL key

Setup

  • run yarn install to install all packages
  • run yarn dev to start the development server

Project Structure

This is the way the project is structured

  • ./src this is the main folder containing all source files
  • ./public this is the folder containing all images, fonts and static files
  • .github/workflows this sets to cron job on github actions to run calculate the tvl data on intervals (currently set to 60 mins)
Src folder
  • ./src/pages this contains all pages, for almost all the pages the components and are all stored in the same file, except for the pools, farms and balancers which uses the PoolCard component (stored in the components folder)

  • ./src/wallet this contains all wallet related files, mostly for web3-react this included the connectors and the setup hooks

  • ./src/web3-functions this contains all functions that sends request to the blockchain, this is mostly for actions, prices and APR calculations which are used outside of the frontend

  • ./src/hooks this contains all 'major' hooks used in the application, from data fetching in the home page to queries and actions for pools, and also prices and contracts.

  • ./src/config this contains all ABIS, contract addresses, pool/farms/balancers configurations and also constants used in the app.

  • ./src/component this container all components, for layout, modals, wallet interations, pool-card and web3-manager.

Extra Notes on architecture

This application doesn't use redux for state management, therefore all data are fetched when the page loads. For the farm related pages (pool, farms, balancers) the data is fetched in the page and are passed down using reducers and context, this is to make action side-effects easier to do. All 3 farm related pages all share the same component "PoolCard" and all use the same queries and methods. So becareful of changes made in that file.

P.S

You're smarter, if you have any suggestions about how to make it better please don't hestitate to tear it all down and make it better. <3.

frontend-1's People

Contributors

marvinkome avatar

Watchers

James Cloos avatar

Forkers

beingakashyadav

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.