{"id":26013372,"url":"https://github.com/abacoding/cryptokazakh","last_synced_at":"2025-03-06T01:37:27.576Z","repository":{"id":197637546,"uuid":"699031208","full_name":"aBacoding/CryptoKazakh","owner":"aBacoding","description":"Welcome to the GitHub repository of CryptoKazakh, a unique digital marketplace designed to foster global appreciation and preservation of Kazakh culture. This decentralized application (dApp) leverages blockchain technology to provide a platform for artists and cultural enthusiasts to buy, sell, and explore Kazakh-themed Non-Fungible Tokens (NFTs).","archived":false,"fork":false,"pushed_at":"2024-07-28T12:40:36.000Z","size":27268,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-07-28T14:04:34.679Z","etag":null,"topics":["css","dapp","decentralized-applications","hardhat","nft","nft-marketplace","react","smart-contracts","solidity","ts","typescript","vercel"],"latest_commit_sha":null,"homepage":"https://crypto-kazakh.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aBacoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-01T18:04:32.000Z","updated_at":"2024-07-28T12:40:40.000Z","dependencies_parsed_at":"2023-10-28T07:27:24.246Z","dependency_job_id":"a88cc643-aa9e-449c-af8f-a86e3341c262","html_url":"https://github.com/aBacoding/CryptoKazakh","commit_stats":null,"previous_names":["abacoding/cryptokazakh"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aBacoding%2FCryptoKazakh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aBacoding%2FCryptoKazakh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aBacoding%2FCryptoKazakh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aBacoding%2FCryptoKazakh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aBacoding","download_url":"https://codeload.github.com/aBacoding/CryptoKazakh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242133275,"owners_count":20077095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","dapp","decentralized-applications","hardhat","nft","nft-marketplace","react","smart-contracts","solidity","ts","typescript","vercel"],"created_at":"2025-03-06T01:37:26.889Z","updated_at":"2025-03-06T01:37:27.563Z","avatar_url":"https://github.com/aBacoding.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CryptoKazakh NFT Marketplace\nWelcome to the GitHub repository of CryptoKazakh, a unique digital marketplace designed to foster global appreciation and preservation of Kazakh culture. This decentralized application (dApp) leverages blockchain technology to provide a platform for artists and cultural enthusiasts to create, buy and explore Kazakh-themed Non-Fungible Tokens (NFTs).\n\n## Table of Contents\n- [How to run the DApp?](#how-to-run-the-dapp)\n- [Smartcontract Explanation](#smartcontract-explanation)\n- [Financial Analysis](#financial-analysis)\n- [Interfaces](#interfaces)\n  - [Homepage](#homepage)\n  - [Create New NFT](#create-new-nft)\n  - [Explore Page](#explore-page)\n  - [My NFTs](#my-nfts)\n  - [404 Error Page](#404-error-page)\n- [Designs](#designs)\n- [Developers](#developers)\n- [Contributing](#contributing)\n\n## How to run the DApp?\n\nTo set up the repository and run the marketplace locally, run the below\n```bash\ngit clone https://github.com/aBacoding/CryptoKazakh\ncd frontend\nnpm install\nnpm start\n```\n\nTo set up and run the smartcontracts, run the below\n```bash\ngit clone https://github.com/aBacoding/CryptoKazakh\ncd hardhat\nnpx hardhat compile\nnpx hardhat run --network sepolia scripts/deploy.ts\n```\n\n## Smartcontract Explanation\n```bash\n// SPDX-License-Identifier: Unlicense\npragma solidity ^0.8.0;\n\n// Importing OpenZeppelin's ERC721URIStorage and Counters contracts.\n// ERC721URIStorage is an ERC721 token with storage for a URI.\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// Contract declaration for ArtCollectiveMarket, inheriting from ERC721URIStorage.\ncontract ArtCollectiveMarket is ERC721URIStorage {\n    using Counters for Counters.Counter;\n    Counters.Counter private _tokenIds; // Counter for token IDs.\n    Counters.Counter private _itemsSold; // Counter for items sold.\n\n    address payable owner; // Address of the contract owner.\n    uint256 listingFee = 0.01 ether; // Listing fee for minting an artwork.\n\n    // Struct to represent an artwork.\n    struct Artwork {\n        uint256 tokenId; // Unique ID of the artwork.\n        address payable owner; // Owner of the artwork.\n        address payable seller; // Seller of the artwork.\n        uint256 price; // Price of the artwork.\n        bool currentlyListed; // Whether the artwork is listed for sale.\n    }\n\n    // Mapping from token ID to its respective Artwork.\n    mapping(uint256 =\u003e Artwork) private idToArtwork;\n\n    // Constructor sets the name and symbol of the token and initializes the contract owner.\n    constructor() ERC721(\"ArtCollective\", \"ARTC\") {\n        owner = payable(msg.sender);\n    }\n\n    // Function to retrieve the listing fee.\n    function getListingFee() public view returns (uint256) {\n        return listingFee;\n    }\n\n    // Function to mint new artwork. Requires the payment of listing fee.\n    function mintArtwork(string memory tokenURI, uint256 price) public payable returns (uint) {\n        require(msg.value == listingFee, \"You gotta pay the gallery fee to list your artwork.\");\n        require(price \u003e 0, \"This piece of art must have value!\");\n        _tokenIds.increment(); // Incrementing the token ID counter.\n        uint256 newTokenId = _tokenIds.current(); // Getting the new token ID.\n        _safeMint(msg.sender, newTokenId); // Minting the token.\n        _setTokenURI(newTokenId, tokenURI); // Setting the token URI.\n        // Creating and mapping the new Artwork struct.\n        idToArtwork[newTokenId] = Artwork(newTokenId, payable(address(this)), payable(msg.sender), price, true);\n        _transfer(msg.sender, address(this), newTokenId); // Transferring the token.\n        return newTokenId;\n    }\n\n    // Function to browse listed artworks in the gallery.\n    function browseGallery() public view returns (Artwork[] memory) {\n        uint itemCount = _tokenIds.current(); // Total number of items minted.\n        uint listedItemCount = _tokenIds.current() - _itemsSold.current(); // Number of items currently listed.\n        Artwork[] memory items = new Artwork[](listedItemCount); // Array to store listed items.\n        uint currentIndex = 0;\n\n        for (uint i = 0; i \u003c itemCount; i++) {\n            if (idToArtwork[i + 1].currentlyListed) {\n                uint currentId = i + 1;\n                Artwork storage currentItem = idToArtwork[currentId];\n                items[currentIndex] = currentItem; // Adding the item to the array.\n                currentIndex++;\n            }\n        }\n        return items; // Returning the array of listed items.\n    }\n\n    // Function to purchase an artwork.\n    function purchaseArtwork(uint256 tokenId) public payable {\n        uint price = idToArtwork[tokenId].price; // Price of the artwork.\n        require(msg.value == price, \"The price must be equal to the artwork's listed price.\");\n        address seller = idToArtwork[tokenId].seller; // Seller's address.\n        idToArtwork[tokenId].currentlyListed = false; // Marking the artwork as not listed.\n        idToArtwork[tokenId].owner = payable(msg.sender); // Setting the new owner.\n        _itemsSold.increment(); // Incrementing the sold items counter.\n        _transfer(address(this), msg.sender, tokenId); // Transferring the token to the buyer.\n        payable(owner).transfer(listingFee); // Transferring the listing fee to the owner.\n        payable(seller).transfer(msg.value); // Transferring the payment to the seller.\n    }\n\n    // Function to view the user's collection (both owned and sold items).\n    function myCollection() public view returns (Artwork[] memory) {\n        uint totalItemCount = _tokenIds.current(); // Total number of items minted.\n        uint itemCount = 0; // Counter for items belonging to the user.\n        uint currentIndex = 0;\n\n        // Counting items belonging to the user.\n        for (uint i = 0; i \u003c totalItemCount; i++) {\n            if (idToArtwork[i + 1].owner == msg.sender || idToArtwork[i + 1].seller == msg.sender) {\n                itemCount++;\n            }\n        }\n\n        Artwork[] memory items = new Artwork[](itemCount); // Array to store the user's items.\n        for (uint i = 0; i \u003c totalItemCount; i++) {\n            if (idToArtwork[i + 1].owner == msg.sender || idToArtwork[i + 1].seller == msg.sender) {\n                uint currentId = i + 1;\n                Artwork storage currentItem = idToArtwork[currentId];\n                items[currentIndex] = currentItem; // Adding the item to the array.\n                currentIndex++;\n            }\n        }\n        return items; // Returning the user's collection.\n    }\n}\n\n```\n\n## Financial Analysis\n\n### Costs for Clients (Users)\n\n1. #### Minting Artwork (`mintArtwork` Function)\n\n- **Cost:** The cost for a client to mint a new artwork is the `listingFee`, set at `0.01 ether`. This fee is mandatory to list the artwork in the gallery. Additionally, users should consider the gas fees required for executing this function on the Ethereum network.\n\n2. #### Purchasing Artwork (`purchaseArtwork` Function)\n\n- **Cost:** The buyer must pay the price of the artwork, as determined by the seller at the time of minting. This price is a fixed amount for each artwork. Gas fees are also applicable for the transaction.\n\n### Potential Earnings or Losses for the Owner\n\n1. #### Minting Artwork\n\n- **Earnings:** The owner earns the `listingFee` (0.01 ether) for each artwork minted and listed. This represents a direct income source.\n- **Losses:** There are no direct losses from this function for the owner. However, costs associated with deploying and maintaining the smart contract should be considered.\n\n2. #### Purchasing Artwork\n\n- **Earnings:** For each artwork purchased, the owner earns the `listingFee` again. These fees are the primary revenue source for the owner.\n- **Losses:** There are no direct losses from artwork purchases. However, ongoing maintenance and potential updates to the smart contract may incur costs.\n\n3. #### Additional Considerations\n\n- The owner does not receive a percentage of the artwork's sale price; their earnings are solely from the listing fees.\n- The contract currently lacks a mechanism for secondary sales or royalties, which could be a potential revenue stream in other NFT platforms.\n\n## Interfaces\n\n### Homepage\n\n![FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/278bb6e5-2cbd-4abd-b8f2-2ad8ba6b4f72)\n\n- **Purpose:** The primary landing page for users to engage with the NFT marketplace.\n- **Interactions:** \n  - Explore available NFTs\n  - Create new NFTs\n  - Connect to MetaMask wallet\n  - Subscribe to NFT drop notifications\n- **Navigation:** Users can move from the homepage to explore, create, or manage their NFTs and wallet.\n\n### Create New NFT\n\n![Create New NFT FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/cfbc5f39-2ec1-47ee-9ace-238ada7e4785)\n\n- **Purpose:** Allows users to mint new NFTs by providing necessary details.\n- **Interactions:** \n  - Input NFT details (title, image, price)\n  - Submit to create the NFT\n- **Navigation:** Post-creation, users may view their NFTs or return to the marketplace to browse.\n\n### Explore Page\n\n![Explore FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/f704ac15-c705-4570-ad64-f7b96334bd41)\n\n- **Purpose:** Enables users to browse and purchase NFTs in the marketplace.\n- **Interactions:** \n  - Place bids or purchase NFTs\n- **Navigation:** Users can go on to purchase NFTs or return to the homepage.\n\n### My NFTs\n\n![MyNFTs FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/20a01941-8371-4e16-a583-5117d113ac4d)\n\n- **Purpose:** A personal dashboard for users to view their owned NFTs.\n- **Interactions:** \n  - View owned NFTs\n- **Navigation:** Access detailed views of owned NFTs or navigate back to explore more NFTs.\n\n### 404 Error Page\n\n![404 FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/3ffb65a2-ed92-49c1-8ae8-a50d4c24839d)\n\n- **Purpose:** Informs users that the page they are trying to access does not exist.\n- **Interactions:** \n  - Link to return to the homepage\n- **Navigation:** Redirects users back to a functioning part of the website.\n\n## Designs\n\n### Design FullHD\n![FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/278bb6e5-2cbd-4abd-b8f2-2ad8ba6b4f72)\n\n### Design for Phone\n![Mobile](https://github.com/aBacoding/CryptoKazakh/assets/97093590/b11c1b91-07f8-4a78-bc04-47ba767fa9f3)\n\n### Hamburger menu\n![Hamburger Menu](https://github.com/aBacoding/CryptoKazakh/assets/97093590/fca0672f-f922-433a-aeb8-0b20c34a98db)\n\n### Create New NFT FullHD\n![Create New NFT FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/cfbc5f39-2ec1-47ee-9ace-238ada7e4785)\n\n### Create New NFT for Phone\n![Create New NFT Phone](https://github.com/aBacoding/CryptoKazakh/assets/97093590/fca3b956-9729-4d5c-9097-b734441361d1)\n\n### Explore page FullHD\n![Explore FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/f704ac15-c705-4570-ad64-f7b96334bd41)\n\n### Explore page for Phone\n![Explore Phone](https://github.com/aBacoding/CryptoKazakh/assets/97093590/7e7b50ea-ec1d-4943-91ae-09bc07d0efec)\n\n### MyNFTs page FullHD\n![MyNFTs FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/20a01941-8371-4e16-a583-5117d113ac4d)\n\n### MyNFTs page for Phone\n![MyNFTs Phone](https://github.com/aBacoding/CryptoKazakh/assets/97093590/9366f158-5c15-4c7b-87ba-7d91cd6fcb65)\n\n### 404 page FullHD\n![404 FullHD](https://github.com/aBacoding/CryptoKazakh/assets/97093590/3ffb65a2-ed92-49c1-8ae8-a50d4c24839d)\n\n### 404 page for Phone\n![404 Phone](https://github.com/aBacoding/CryptoKazakh/assets/97093590/6229ca77-316d-4132-a59a-aa1e6fa04ddc)\n\n## Developers\n\n- Abdurakhim Bakytzhan\n  - main frontend developer\n  - main blockchain developer \n- Temirlan Torebekov\n  - main blockchain developer \n- Azat Bekturganov\n  - secondary blockchain developer\n- Nursultan Tynyshbay\n  - secondary frontend developer\n\n## Contributing\n\nInterested in contributing to the CryptoKazakh NFT Marketplace? We welcome contributions of all kinds.\n\nDeveloped with ❤️ by `Abdurakhim Bakytzhan, Temirlan Torebekov, Azat Bekturganov, Nursultan Tynyshbay/CryptoKazakh Developers Team`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabacoding%2Fcryptokazakh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabacoding%2Fcryptokazakh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabacoding%2Fcryptokazakh/lists"}