Giter Site home page Giter Site logo

ndodson / interface Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neodaoist/interface

0.0 0.0 0.0 21.55 MB

๐Ÿฐ An interface to interact with Slice protocol

Home Page: https://slice.so

Shell 0.07% JavaScript 0.49% TypeScript 98.88% CSS 0.01% SCSS 0.55%

interface's Introduction

Slice Interface

Slice frontend application.

Development

Installation

  1. Create a fork of this repository.

  2. Clone your fork and navigate to the root directory.

  3. Install project dependencies.

    npm install
  4. Create a .env file in the root directory which mirrors the .example.env file. Learn how to define each field in the .env file in Setup.

Setup

Slice-interface relies on a number of services for development. A separate set of contracts on Goerli was appositely created for development purposes.

The following sections describe how to set up each service for local development.

A shared staging environment has also been set up on https://dev.slice.so. The shared environment uses the same contracts and subgraphs as the ones used for local development, so the slicers and products created locally will also appear there.

Alchemy

Slice uses Alchemy to connect to an Ethereum network (mainnet, or one of the testnets).

Follow these steps to create an Alchemy key:

  1. Create an account on Alchemy
  2. Create a new App, specifying Goerli as network
  3. Enter the app and click on View Key
  4. Copy the HTTP key and paste it into the NEXT_PUBLIC_NETWORK_URL in your .env file

Pinata

Slice uses Pinata to store products metadata.

Follow these steps to create a Pinata key

  1. Create or log into your account on Pinata by clicking on Login
  2. On the top left corner, open the user menu and click on API Keys
  3. Create a new API key with admin permissions and copy the JWT secret access token into PINATA_JWT in your .env file

Web3Storage

Slice uses Web3Storage to store encrypted product metadata.

Follow these steps to create a web3Storage key

  1. Create or log into your account on Web3Storage by clicking on Login
  2. Create an API token and copy it in WEB3STORAGE_KEY in your .env file

Supabase

Slice uses Supabase as its database and storage solution. The database is used for optimizing performance and to store slicers metadata, product metadata, list reverted products, as well as to support interface-only features.

The database represents the source of truth when it comes to slicer metadata.

Follow these steps to set up your db and storage:

  1. Create or log into your account on Supabase by clicking on Start your project
  2. Create an organization and create a New project (take note of the password you choose)
  3. Copy the following values into your .env file
    • anon key -> ANON_SUPABASE_KEY
    • secret key -> BACKEND_SUPABASE_KEY
    • project configuration url -> NEXT_PUBLIC_SUPABASE_URL
  4. Create a storage
    • Click on storage on the left sidebar and click on create a new bucket
    • (Important) Name it slicer-images and make it public
    • Click on policies in the left menu and create a new policy from scratch for the new bucket. You can name it "allow anon users to upload to slicer-images"
    • Check INSERT as the allowed operations and paste the following snippet in the policy definition
   ((bucket_id = 'slicer-images'::text) AND (role() = 'anon'::text))
  1. Link the database to your app

    • Click on settings on the left sidebar and select database under project settings
    • Copy the connection string at the bottom of the page and paste it into DATABASE_URL in your .env, and add the string ?pgbouncer=true at the end
    • Substitute [YOUR-PASSWORD] in the string with your project password
  2. Navigate to the root directory and run the following command in your terminal to initiate your db

       npx prisma generate && npx prisma migrate deploy

The interface uses incremental static regeneration to populate the db, so once you start the app you will see any slicer that other devs have created in their own local environments, but without their images or metadata.

CoinMarketCap

Slice uses CoinMarketCap API to get and store currencies prices.

Follow these steps to create a Coin Market Cap API key

  1. Create or log into your account on CoinMarketCap by clicking on Login
  2. Create an API token and copy it in COIN_MARKET_CAP_KEY in your .env file

Usage

  1. Start the app.

    npm run dev

If you use a different port than 3000 for local development, update the NEXT_PUBLIC_APP_URL in your .env file accordingly

Deployment

Frontend application(s) is hosted on Vercel and new versions are automatically deployed when pushed to master, testnet or staging.

interface's People

Contributors

jjranalli avatar dom-mac 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.