Implement NFT Count and Display Feature in Candy Machine v3

Hello, everyone.

I’m currently working with a repository based on the Candy Machine UI from Metaplex. I’m trying to add a feature that not only counts the remaining NFTs but also displays the ones that have been minted in a dedicated section. I’ve been seeking guidance or available documentation to help me achieve this functionality. I reviewed several repositories for reference; however, each one seems to fetch data in a different way, making it quite challenging to follow. Any insights or resources would be greatly appreciated. Thank you!

Working on this project, I discovered that the key is to integrate an event-driven architecture with periodic status updates. Rather than solely relying on a single fetch operation, it’s effective to have your code listen for mint events to update the counter in real time while also using scheduled queries to verify data consistency. I found that implementing a lightweight caching mechanism for metadata reduces unnecessary requests. This balance between event handling and polling ensures that the NFT count remains accurate and that the display of minted items updates smoothly, providing a better user experience overall.

i found a mix of realtime event listenrs and periodic queries worked for me. sometimes the tx events got delayed, so adding a refresh fixed it. might need some tuning in your case tho.