Skip to content

Salvadoge is a generative AI NFT project that allows users to create and mint NFTs based on generated images using user-provided descriptions.

License

Notifications You must be signed in to change notification settings

0xsamgreen/salvadoge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Salvadoge

Salvadoge is a generative AI NFT project that allows users to create and mint NFTs based on generated images using user-provided descriptions.

demo.mov

Prerequisites

Make sure you have the following tools installed on your system:

  1. Node.js (v16.0.0): You can download and install the specific version from the official Node.js website or use a version manager like nvm to manage multiple Node.js versions on your machine. To install Node.js v16.0.0 using nvm, you can run:
nvm install 16.0.0
nvm use 16.0.0

External Services

This project relies on the following external services:

  1. Infura: Used to store NFT images on IPFS.
  2. Alchemy: Provides an RPC to connect to the Sepolia testnet.
  3. OpenAI DALL-E API: Used for image generation based on the provided description.

It is possible to modify the code to run entirely on your local machine, but that is not how it is currently configured.

API Keys

In order to use this project, you need to obtain API keys for Infura, Alchemy, and OpenAI's DALL-E. After collecting the keys, you should set them in a .env file in the project root directory.

You will also need to store your NFT project's private key on the backend. This will be used to sign the NFT metadata for the user to submit.

For example, your .env file should look like this:

CONTRACT_ADDRESS=
BACKEND_PRIVATE_KEY=
ALCHEMY_API_KEY=
ALCHEMY_RPC_URL=
INFURA_PROJECT_ID=
INFURA_PROJECT_SECRET=
OPENAI_API_KEY=

Note: Be sure to never share or expose your API keys publicly. Always keep them secure and treat them like passwords. Do not commit your .env file to the repository.

Installation

  1. Clone the repository:
git clone [email protected]:0xsamgreen/salvadoge.git
cd salvadoge
  1. Install dependencies for the backend, contract, and frontend:
cd backend
yarn install

cd ../contract
yarn install

cd ../frontend
yarn install

Running the Project

  1. Start the backend server:
cd backend
node index.mjs

The server should now be running on http://localhost:3001.

  1. Build and deploy the smart contract:

In a separate terminal, navigate to the contract directory and deploy the smart contract using Hardhat:

cd contract
npx hardhat compile
cp artifacts/contracts/AIGeneratedNFT.sol/AIGeneratedNFT.json ../frontend/src
cp artifacts/contracts/AIGeneratedNFT.sol/AIGeneratedNFT.json ../backend
npx hardhat run --network sepolia scripts/deploy.js
  1. Update the frontend and backend with the deployed contract address:

Note the contract address output after the contract deployment and update the contractAddress variable in frontend/Apps.js and the CONTRACT_ADDRESS variable in your .env file.

  1. Start the frontend development server:
cd frontend
yarn run start

The frontend should now be running on http://localhost:3000.

  1. Connect your MetaMask wallet to the app and start generating and minting NFTs!

License

This project is open-source and available under the MIT License.

Disclaimer

This project is for educational purposes only and should not be deployed or used in environments where real (non-testnet) tokens are involved. The code contains security vulnerabilities, including but not limited to:

  • Front-end users can mint their images multiple times.
  • The backend signing key is stored on the server, which is an insecure practice.

By using this project, you acknowledge that you are doing so at your own risk and will not hold the authors or contributors liable for any potential security breaches or losses that may occur as a result of using this code.

About

Salvadoge is a generative AI NFT project that allows users to create and mint NFTs based on generated images using user-provided descriptions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published