A music discovery and streaming application built with Next.js, featuring intelligent caching systems and SearchContext integration.
- 🎵 Music discovery and browsing
- 🔍 Advanced search with no-token support
- 💾 Smart caching system with hash-based change detection
- 📑 Discovery index caching for multiple content types
- 🎨 Dark mode support
- 📱 Responsive design
- Framework: Next.js 15.5.10
- Language: TypeScript / JavaScript
- Styling: Tailwind CSS
- Authentication: NextAuth.js
- State Management: React Context (SearchContext, PlayerContext)
app/
├── components/ # React components
├── context/ # React contexts (Search, Player, Theme)
├── lib/ # Utilities and types
├── (Main)/ # Main application pages
└── api/ # API routes
services/
├── singnifyApi.service.ts # API client
├── singnifyApi.actions.ts # Server actions
├── discoverCache.service.ts # Single discover caching
└── discoverIndexCache.service.ts # Multi-type discover caching
Global search state management allowing search across the application.
- Single Cache: Caches full discover response (24hr TTL)
- Index Cache: Caches and organizes discover data by types
- Hash-based change detection
- Automatic 24-hour updates
- Fallback mechanisms
- Background data fetching
# Install dependencies
npm install
# Build the project
npm run build
# Run the development server
npm run devsearchContentAction(query, token?)- Search with optional tokensearchContentActionNoToken(query)- Unauthenticated search
fetchDiscoveryCachedAction(token?)- Cached full discoverfetchDiscoveryCachedActionNoToken()- Cached discover without authfetchDiscoveryCachedIndexAction(token?)- Indexed discover with tokenfetchDiscoveryCachedIndexActionNoToken()- Indexed discover no tokengetDiscoverTypeCachedAction(type)- Get specific type from cachegetDiscoverAvailableTypesAction()- List available cached typesgetDiscoverIndexStatsAction()- Cache statistics
.cache/
├── discover-cache.json # Full response
└── discover-cache-meta.json # Metadata
.cache/
├── discover-index-cache.json # Indexed by type
└── discover-index-meta.json # Metadata
The application integrates with the Singnify API:
- Base URL: https://singnify.com
- Authentication: Token-based (optional)
Create .env.local:
NEXT_PUBLIC_API_URL=https://singnify.com
NEXTAUTH_SECRET=your_secret_here
- All API calls are server-side to avoid CORS issues
- Caching reduces server load by ~90% compared to direct API calls
- Search works with and without authentication tokens