Coder Social home page Coder Social logo

ever0de / kitty-items Goto Github PK

View Code? Open in Web Editor NEW

This project forked from onflow/kitty-items

0.0 0.0 0.0 24.98 MB

Based on CryptoKitties, Kitty Items is an example of a full-stack dapp built on Flow.

Home Page: http://kitty-items-flow-testnet-prod.herokuapp.com/

License: Apache License 2.0

TypeScript 20.47% JavaScript 77.11% CSS 2.42%

kitty-items's Introduction

๐Ÿ‘‹ Welcome! This demo app is designed to help you learn to build on Flow.

  • Kitty Items is a complete NFT marketplace built with Cadence, Flow's resource-oriented smart contract programming language.
  • Learn how to deploy contracts, mint NFTs, and integrate user wallets with the Flow Client Library (FCL).

๐ŸŽฌ Live Demo

Check out the live demo of Kitty Items, deployed on the Flow Testnet.

If you'd like to deploy your own version, see the deploy to Heroku instructions near the bottom to this setup guide.

โœจ Getting Started

1. Install Dependencies

๐Ÿ›  This project requires Docker. See: Docker installation instructions
๐Ÿ›  This project requires NodeJS v14.x or above. See: Node installation instructions
๐Ÿ›  This project requires flow-cli v0.28.0 or above. See: Flow CLI installation instructions

2. Clone the project

git clone https://github.com/onflow/kitty-items.git

3. Install dependencies

  • Run npm install in the root of the project.
  • Run npx lerna exec npm install to install project dependencies.

4. Start the project

Continue reading the sections below for instructions on how to start the project for local development, or testnet development.

Local development

  1. Run npm run start:dev

  2. Run flow project deploy --network emulator

    • All contracts are deployed to the emulator.
  3. Visit http://localhost:3001 and follow the instructions "Initialize the Service Account to mint Kitty Items" at the top of the webpage.

Thats it! ๐Ÿ

Testnet development

Create a Flow Testnet account

You'll need a Testnet account to work on this project. Here's how to make one:

Generate a key pair

Generate a new key pair with the Flow CLI:

flow keys generate

โš ๏ธ Make sure to save these keys in a safe place, you'll need them later.

Create your account

Go to the Flow Testnet Faucet to create a new account. Use the public key from the previous step.

Save your keys

After your account has been created, export the following environment variables to your shell:

# Replace these values with the address returned from the faucet and the
# private key you generated in the first step!

export FLOW_ADDRESS=address
export FLOW_PRIVATE_KEY=xxxxxxxxxxxx
export FLOW_PUBLIC_KEY=xxxxxxxxxxxx

โš ๏ธ Note: It's important that these variables are exported in each shell where you're running any of the commands in this walkthrough.

  1. Run: npm run start:testnet

    • Testnet development will connect the application to Flow's testnet
  2. Run: flow project deploy --network testnet -f flow.json -f flow.testnet.json

    • All contracts are deployed to the Flow testnet.
  3. Select "Blocto" to log in.

Thats it! ๐Ÿ

Visit http://localhost:3001 to interact with your new instance of Kitty Items!


(Optional) Heroku Deployment

If you'd like to deploy a version of this app to Heroku for testing, you can use this button!

Deploy

You'll need to supply the following configuration variables when prompted:

# The Flow address and private key you generated above

MINTER_ADDRESS
MINTER_PRIVATE_KEY

# The Flow address where you have deployed your Kitty Items contract.
# (usually the same Flow address as above)

NEXT_PIBLIC_CONTRACT_KITTY_ITEMS
NEXT_PUBLIC_CONTRACT_NFT_STOREFRONT

Project Overview

Project Overview

๐Ÿ”Ž Legend

Above is a basic diagram of the parts of this project contained in each folder, and how each part interacts with the others.

1. Web App (Static website) | kitty-items/web

A true dapp, client-only web app. This is a complete web application built with React that demonstrates how to build a static website that can be deployed to an environment like IPFS and connects directly to the Flow blockchain using @onflow/fcl. No servers required. @onflow/fcl handles authentication and authorization of Flow accounts, signing transactions, and querying data using using Cadence scripts.

2. Look Ma, a Web Server! | kitty-items/api

We love decentralization, but servers are still very useful, and this one's no exception. The code in this project demonstrates how to connect to Flow using Flow JavaScript SDK from a Node JS backend. It's also chalk-full of handy patterns you'll probably want to use for more complex and feature-rich blockchain applications, like storing and querying events using a SQL database (Postgres). The API demonstrates how to send transactions to the Flow blockchain, specifically for minting Kitty Items (non-fungible tokens).

3. Cadence Code | kitty-items/cadence

Cadence smart contracts, scripts & transactions for your viewing pleasure. This folder contains all of the blockchain logic for the marketplace application. Here you will find examples of fungible token and non-fungible token (NFT) smart contract implementations, as well as the scripts and transactions that interact with them. It also contains examples of how to test your Cadence code (tests written in Golang).

๐Ÿ˜บ What are Kitty Items?

Items are hats for your cats, but under the hood they're non-fungible tokens (NFTs) stored on the Flow blockchain.

Items can be purchased from the marketplace with fungible tokens. In the future you'll be able to add them to Ethereum CryptoKitties with ownership validated by an oracle.

โ“ More Questions?


๐Ÿš€ Happy Hacking!

kitty-items's People

Contributors

0xjayshen avatar 10thfloor avatar alse avatar amritrau avatar comtechnet avatar fkenji avatar jordankitty avatar jordanpublic avatar joshuahannan avatar kerrywei avatar kulame avatar laynelafrance avatar makcanca avatar maxstalker avatar olegggatttor avatar orodio avatar phi-line avatar psiemens avatar redakhyatti avatar sideninja avatar smeyerzu avatar srinjoyc avatar sschulz-t 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.