Giter VIP home page Giter VIP logo

coordinape's Introduction

Welcome to the code for Coordinape! If you're new to the project, check out our docs.

Contributing

Stack: React, Hasura graphql server & vercel serverless functions

Quick Start

  • yarn install
  • yarn setup
    • init git submodules & link hardhat
  • cp .env.example .env
    • Set HARDHAT_OWNER_ADDRESS and LOCAL_SEED_ADDRESS to your local dev wallet
  • yarn docker:start - Start Hasura and postgres
    • Clear the data stored in the docker volumes: yarn docker:clean
  • yarn db-seed-fresh - Seed the db w/ dummy data
  • vercel dev
    • If you're creating a new Vercel project, use these custom settings:
      • Build Command: ./scripts/link_hardhat.sh && yarn build
      • Development Command: craco start
    • Runs React and the serverless functions in api/
  • Go to http://localhost:3000 and start giving!

Frontend

More detailed guidelines coming soon.

When writing new frontend components, please use Stitches instead of Material-UI. See:

Key libraries

Hasura

Hasura automagically creates a GraphQL API atop our postgres db. We use it to apply migrations and manage metadata. Perhaps, the easiest way to get a feel is start the app and run yarn hasura console.

Working with the schema

  • yarn hasura console to modify and explore the database
  • yarn generate after schema changes to codegen zeus & react-query libs
    • Requires vercel dev to be running

Updating migrations / metadata

If you pull in any new changes to the schema, your local Hasura instance might start complaining about metadata inconsistency. In order to apply the new migrations / metadata to your local instance, run the following commands:

yarn hasura migrate apply
yarn hasura metadata apply

Alternately, you can just run yarn docker:stop && yarn docker:start and Hasura will apply the migrations/metadata automatically.

Previewing changes

Any changes you make in yarn hasura console will be reflected in your local hasura directory as migrations or metadata. In the feature branch a clone of the staging database will be created with the changes.

These will be applied to the production instance once the PR is merged.

Hardhat

Hardhat is used with typechain to generate TypeScript bindings for the smart contracts, which are in this repo as a git submodule at hardhat/contracts.

  • Set ETHEREUM_RPC_URL in .env
    • From Infura project id: Infura & create new project
    • Needs to have access to archive data
  • ./scripts/setup.sh - link the react app generated code
  • ./scripts/rebuild-hardhat.sh - Rebuild the generated code
  • yarn test - Run tests
    • make sure HARDHAT_FORK_BLOCK is set (13500000 is a good value) and ETHEREUM_RPC_URL points to an archive node

Troubleshooting

  • Cannot start service app: error while creating mount source path Try restarting Docker Desktop

  • TypeError: Cannot read properties of undefined (reading 'replace') You need to configure a local .env file with some private variables. Ask someone for these.

  • error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv' Probably related to node-sass versions. Node v16 only works with node-sass 6.0.1 or newer. sass/node-sass#3077

coordinape's People

Contributors

akkikumar72 avatar almithani avatar amrro avatar cashd avatar crabsinger avatar cryptograffe avatar davidfant avatar dependabot[bot] avatar exrhizo avatar f1lander avatar flowerornament avatar j-yw avatar jsur avatar levity avatar marcogodoyv avatar meta-dreamer avatar niraj-kamdar avatar spydermonkee avatar sshmm avatar teeolendo avatar thenerdcat avatar too-far avatar topocount avatar tsejerome avatar zashton avatar zencephalon avatar

Forkers

sethee-it-ltd

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.