GithubHelp home page GithubHelp logo

nft_marketplace's Introduction

ChainGem logo

ChainGem


This project aims to create an NFT Marketplace with focus on best practices and scalability.

Table of content

Introduction

The problem of counterfeit jewelry is a significant issue in the market, which leads to buyers being scammed into purchasing products that are not authentic. In this projet, I propose a solution to this problem through the use of non-fungible tokens (NFTs) in a jewelry marketplace. My approach involves creating a platform that connects jewelry manufacturers, owners, and buyers through the use of NFTs, which would ensure the authenticity of the jewelry and create a more secure marketplace for buyers.

Project sections

This solution consists of three main sections:

  1. A manufacturer section for minting NFTs
  2. An owner section for selling authentic jewelry with accompanying NFTs
  3. A marketplace for buyers to purchase authentic jewelry.

The manufacturer section will use a signature-based validation process to ensure that only authentic jewelry manufacturers are able to mint NFTs on our platform. Owners will then be able to sell their authentic jewelry with accompanying NFTs in the owner section, and buyers can purchase authentic jewelry with confidence on the marketplace.

Project structure

The repository is a monorepo, which means that it contains multiple projects. Currently contains 3 projects:

  1. The blockchain project, that uses Hardhat as a development environment, testing framework and deployment tool for Ethereum smart contracts. It has 3 smart contracts:
    • The ChainGems contract, which is a ERC1155 contract, that is used to mint the NFTs and the native token.
    • The ChainGemsExchange contract, which is a decentralized exchange that is used to exchange the native token for a stablecoin.
    • The USDToken contract, which is a ERC20 contract, that is used as a stablecoin.
  2. The frontend project, which is a React application that interacts with smart contracts and is based on the Model View Presenter architecture and Atomic Design methodology.
  3. The backend project, which is a NodeJS that upload files to IPFS.

Principles

The project is based on the following principles:

  • SOLID
  • Separation of Concerns (SOC)
  • Don't Repeat Yourself (DRY)
  • You Aren't Gonna Need It (YAGNI)
  • Keep It Simple, Silly (KISS)

Architecture

Methodologies

The items in this section are not strictly related to methodologies, but are concepts that I applied to the project and helped me to maintain an organized, structured and testable code.

  • Atomic Design

  • GitFlow

  • Monorepo

  • Continous Integration

  • Conventionnal Commits

  • Semantic Versioning

  • Linting and Formatting

  • Unit Testing


Technologies

The most relevant technologies used in this project are:

Back Front General
  • Solidity
  • Hardhat
  • OpenZeppelin
  • Chainlink
  • Ethers.js
  • Slither
  • Chai
  • ReactJS
  • NextJS
  • Storybook
  • Zustand
  • Jest
  • React Testing Library
  • Tailwind CSS
  • Typescript
  • Lerna
  • Yarn Workspaces
  • ESLint
  • Prettier
  • Lint Staged
  • CodeQL (on CI)
  • Docker
  • ACT (Run GitHub Actions locally)

Run project

To run the project, you need to have Yarn installed, Node and Metamask .

  1. Clone the repository

  2. Install dependencies

yarn install
  1. Run the blockchain project

Inside the Blockchain folder, run:

yarn hardhat node
  1. Run the frontend project

Inside the Frontend folder, run:

yarn dev
  1. If you want to use Metamask, remember to connect to the local network

Run Tools

Because of the monorepo structure, some tools need to be run from the root of the project and others in their own packages(Backend/Frontend).
The context for executing each each tool is clarified in parentheses.

  • Slither (Blockchain)
    For running these tools, I use a docker image, you can run this command to get the image:

    docker pull trailofbits/eth-security-toolbox


    Then you need to run the following command:

    yarn toolbox


    And inside the container, you can run slither as follows:\

    slither /src/Blockchain/contracts/ --solc-remaps '@openzeppelin=/src/node_modules/@openzeppelin @chainlink=/src/node_modules/@chainlink' --exclude naming-convention,external-function,low-level-calls
  • Mythril (Blockchain)
    To run mythril, you can do it with docker. First, you need to get the image:

    docker pull mythril/myth


    Then you can run it (one contract at a time) as follows:

    docker run -v ${PWD%/*}:/src mythril/myth analyze --solc-json /src/Blockchain/mythril-config.json /src/Blockchain/contracts/{contract_name}.sol
  • Storybook (Frontend)
    To run storybook, you need to run the following command:

    yarn storybook

nft_marketplace's People

Contributors

dario13 avatar

Watchers

 avatar

nft_marketplace's Issues

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.