This application provides tools for managing and displaying NFT collections for the Wallace Museum.
The wallet management system allows you to:
- Add multiple blockchain wallet addresses (Ethereum, Tezos, Polygon, Solana)
- Assign aliases to wallet addresses for easy identification
- Delete wallet addresses when no longer needed
- View all registered wallet addresses in one place
The indexing system automatically:
- Fetches NFTs from registered wallet addresses
- Normalizes data across different blockchains
- Stores metadata in a searchable index
- Updates the index daily via a scheduled cron job
-
Set the
INDEXER_API_KEYenvironment variable in your.envfile:INDEXER_API_KEY=your_secure_key_here -
Set up a cron job to run the indexer daily:
0 2 * * * curl https://your-domain.com/api/admin/index-wallets?key=your_secure_key_here -
You can also run the indexer manually from the admin interface.
The import system allows you to:
- Search indexed NFTs by name, description, token ID, etc.
- Filter by blockchain, artist, or collection
- Select multiple NFTs to import at once
- Import NFTs into your official collection
The application includes a comprehensive Redis caching system to improve performance:
- Automatic Query Caching: Database read queries are automatically cached
- Environment-Based Control: Cache can be enabled/disabled per environment
- Smart Invalidation: Cache is automatically invalidated when data changes
- Admin Controls: API endpoints for cache management and monitoring
- Sitewide Prefixing: All cache keys use
wallace-collection:prefix
See REDIS_CACHE_SETUP.md for detailed configuration and usage.
-
Install dependencies:
npm install -
Set up environment variables in
.env:DATABASE_URL=your_database_connection_string OPENSEA_API_KEY=your_opensea_api_key INDEXER_API_KEY=your_secure_key_here IPFS_API_KEY=your_ipfs_api_key REDISCLOUD_URL=redis://username:password@host:port # For caching -
Run the development server:
npm run dev -
Access the admin interface at
http://localhost:5173/admin
GET /api/admin/index-wallets?key=[INDEXER_API_KEY]- Run the indexer to fetch NFTs from all registered wallets
GET /api/admin/search- Search indexed NFTs with various filters- Parameters:
q- Search termblockchain- Filter by blockchainartist- Filter by artist IDcollection- Filter by collection IDlimit- Number of results per page (default: 50)offset- Pagination offset (default: 0)
- Parameters:
GET /api/admin/cache- Get cache status and statisticsDELETE /api/admin/cache- Clear all cache entriesDELETE /api/admin/cache?pattern=artworks:*- Clear specific cache patternPOST /api/admin/cache- Invalidate cache patterns
GET /api/health- System health check including cache status
The system uses the following key tables:
Artwork- Stores imported NFTsArtworkIndex- Stores indexed NFT data for searchArtist- Stores artist informationCollection- Stores collection informationSettings- Stores system settings, including wallet addresses
Test the caching system with the included test script:
node test-cache.jsThis will verify cache functionality, hit/miss rates, and API responses.
- Fork the repository
- Create a feature branch
- Submit a pull request
This app uses the Wallace Museum IPFS microservice for IPFS content delivery with authentication. You'll need to set up the following environment variable:
# IPFS Microservice Configuration
IPFS_API_KEY=your_api_key # Your IPFS microservice API key- All IPFS URLs in your app will be automatically routed through
https://ipfs.wallacemuseum.com - The microservice uses your API key for authentication
- Supports path-based IPFS URLs (e.g.,
ipfs://Qm.../metadata.json) - Falls back to public IPFS gateways if the microservice is unavailable