Adding metadata to token (ERC721)


I was wondering what the most efficient way to add tokenURI metadata (which contains things like an IPFS link to an image) after minting a token is. I plan on creating a dApp where I have about 10,000 NFTs and then users can see the images and buy.

Do I first upload all my images to IPFS and then copy all the links into 1 big JSON file?? If so, how would I even access it in my contract?

To put it concisely, I guess my question is how do I mint multiple ERC721 tokens and link them to distinct images.

Why not mint the IPFS file to the URI metadata of each NFT?

When you mint the NFT, use some logic to determine what image they need from a database that is accessed via a front end. Then use that logic to upload the file to IPFS, get the link, and mint the NFT with the metadata containing that IPFS link.

If you have 10,000 Unique Images that is a massive amount. If they are already in the database then you should think of a programmatic way to determine which picture goes with what NFT.