This example shows how to build a fullstack backend using Ponder with support for offchain database tables and background tasks. It builds on Ponder's ERC721 indexing example which uses the Smol Brains NFT contract on Arbitrum (Link).
By default Ponder doesn't export CommonJS and Drizzle Kit can't be run in ESM mode (as explained in this longstanding issue). This causes all Drizzle Kit commands to fail when importing tables or column types from Ponder. As a sketchy workaround, this example patches Ponder to export it's ESM bundle as a CommonJS bundle. Since the CommonJS import is only used inside Drizzle Kit commands this seems to work fine.
It is also important that the drizzle-orm version installed is the same as the one used by Ponder (otherwise you will run into type issues).