A React application that generates NFTs based on address input.
You can view the live application here: Address NFT Generator
Here are some screenshots of the application:
Home page of the Address NFT Generator
Map view after entering an address
This project is an Address NFT Generator that allows users to input an address, view it on a map, and generate an NFT based on that address. It utilizes React, styled-components, Framer Motion, and Mapbox for a seamless and interactive user experience.
- Clone this repository.
- Ensure you have Node.js installed (version 14 or higher recommended).
- Run
npm install
to install dependencies. - Create a
.env
file in the root directory and add your Mapbox API key:- REACT_APP_MAPBOX_ACCESS_TOKEN=
- Run
npm start
to start the development server. - Open http://localhost:3000 to view the app in your browser.
npm start
: Runs the app in development mode.npm test
: Launches the test runner in interactive watch mode.npm run build
: Builds the app for production to thebuild
folder.npm run eject
: Removes the single build dependency from your project.
This project uses Hardhat for smart contract development, testing, and deployment. Here are the key Hardhat commands:
- Compile contracts: npx hardhat compile
- Deploy contracts to local network: npx hardhat run scripts/deploy.js --network sepolia
- Verify contract on Etherscan (replace with your contract address and constructor arguments):
Note: Make sure to configure your hardhat.config.js
file with the appropriate network settings and API keys before deploying to testnets or mainnet.
[Previous structure remains the same]
contracts/
: Contains Solidity smart contractsscripts/
: Contains deployment and interaction scriptstest/
: Contains test files for smart contractshardhat.config.js
: Hardhat configuration file
- Node.js: v14.0.0 or higher
- React: v17.0.2 or higher
- styled-components: v5.3.0 or higher
- framer-motion: v4.1.17 or higher
- mapbox-gl: v2.9.1 or higher
- @mapbox/mapbox-gl-geocoder: v5.0.0 or higher
Make sure to set up your Mapbox access token in the .env
file as mentioned in the instructions.
src/
components/
: Contains React componentsAddressInput.js
: Component for address input using Mapbox GeocoderMap.js
: Component for displaying the mapNFTGenerator.js
: Component for generating NFTs (includes deployed contract's address)styles/
: Contains styling-related filesGlobalStyles.js
: Global styles for the applicationTheme.js
: Theme configuration for styled-componentsApp.js
: Main application componentindex.js
: Entry point of the application
- Address input with autocomplete using Mapbox Geocoder
- Map display of the selected address
- NFT generation based on the address (uses deployed contract's address)
- Responsive design for various screen sizes
- Dark theme with customizable styling
- React
- styled-components
- Framer Motion
- Mapbox GL JS
- Mapbox GL Geocoder
- The Mapbox integration requires a valid access token. Make sure to replace the placeholder token with your own in the
.env
file. - The NFT generation feature in the NFTGenerator component uses the address of the deployed smart contract. Ensure this address is correctly set in the component.