A decentralized music streaming platform built with Next.js 15.3.1, React 19, and Tailwind CSS v4, featuring both traditional streaming and tokenized audio via a bonding curve economics model.
The SoundBase platform consists of two main components:
- SoundBase - Traditional audio streaming with S3/MinIO storage
- SoundCave - Tokenized audio platform with bonding curve economics (similar to pump.fun but for audio)
The platform combines the best of web2 streaming convenience with web3's tokenization and creator economy features.
- Framework: Next.js 15.3.1 with App Router
- UI: React 19.1 with Tailwind CSS v4 and shadcn/ui components
- State Management: React Context and Hooks
- Authentication: Wallet-based authentication with Smart Wallet support
- API Server: Elysia/Bun server running on port 4023
- Storage: MinIO object storage for traditional streaming media
- IPFS: Pinata for decentralized storage of SoundCave assets
- Smart Contracts: ERC-1155 implementation on Base chain
- Economy: Bonding curve token model with multiple curve types
- Development: Hardhat with Solidity 0.8.20
- Networks: Base Sepolia testnet with planned mainnet deployment
- Runtime: Bun v1.2.9 (with built-in S3Client, Redis)
- Frontend:
- Next.js 15.3.1
- React 19.1-beta
- Tailwind v4 with Motion extension
- shadcn/UI components
- Backend:
- Elysia 1.1 (high-performance minimalist framework)
- Blockchain:
- Solidity 0.8.20
- OpenZeppelin contracts 5.3.0
- Hardhat 2.23.0
- Storage:
- AWS S3/MinIO for regular streaming
- IPFS via Pinata for decentralized storage
- Wallet Integration:
- Base Smart Wallet (passkey-based)
- wagmi/viem for blockchain interactions
- User profiles and personalized recommendations
- High-quality audio streaming
- Artist profiles and dashboards
- Playlist creation and sharing
- Mint audio tracks as tokens with bonding curve economics
- Multiple curve types (LINEAR, EXPONENTIAL, LOGARITHMIC, SIGMOID)
- Interactive charts showing price dynamics
- Marketplace for buying/selling audio tokens
- Smart Wallet integration for gasless transactions
- IPFS integration for decentralized storage
/src/app- Next.js app router pages/src/components- React components/src/components/ui- UI components (shadcn)/src/lib- Utility libraries and services/src/lib/ipfs-storage.ts- IPFS integration via Pinata/src/lib/market-utils.ts- Bonding curve calculations/src/lib/wagmi.ts- Blockchain configuration
/src/app/api- API routes and proxies/public- Static assets
/contracts- Solidity smart contractsSoundcaveFactory.sol- Factory for deploying track contractsSoundcaveTrackBonded.sol- ERC-1155 implementation with bonding curveSoundBaseSubscription.sol- Subscription model implementation
/scripts- Deployment and testing scripts/test- Contract tests/server- API server for blockchain interaction
- Bun v1.2.9 or later
- Node.js v18.18.0 or later
- Docker (for MinIO)
- Phantom Wallet or Coinbase Wallet browser extension
-
Clone the repositories:
git clone <frontend-repo-url> next-soundbase git clone <blockchain-repo-url> blockchain-base
-
Install frontend dependencies:
cd next-soundbase bun install -
Set up environment variables:
cp .env.example .env.local # Edit .env.local with your Pinata API keys and other configurations -
Start the development server:
bun run dev
-
Install dependencies:
cd blockchain-base bun install -
Set up environment variables:
cp .env.example .env # Edit .env with your wallet private key and RPC URLs -
Compile contracts:
npx hardhat compile
-
Deploy to testnet:
bun run scripts/deploy-base-testnet.ts
For full-stack development, you'll need to run both frontend and backend services:
# Terminal 1: Start MinIO (Docker)
docker run -p 9000:9000 -p 9001:9001 minio/minio server /data --console-address ":9001"
# Terminal 2: Start API server
cd blockchain-base
bun run server/index.ts
# Terminal 3: Start frontend
cd next-soundbase
bun run devSoundCave uses IPFS for storing track files, images, and metadata:
-
Upload Flow:
- Files are uploaded to Pinata through the platform
- CIDs are stored in smart contracts for provenance
- Metadata includes track details and references to audio/image files
-
Retrieval Flow:
- Content is accessed through Pinata's gateway
- The
formatDirectIpfsUrlhelper converts IPFS URIs to HTTP URLs - Smart Wallet integration enables gasless transactions
SoundCave implements four bonding curve types to model different token economics:
- LINEAR: Price increases linearly with supply
- EXPONENTIAL: Price increases exponentially (more dramatic price growth)
- LOGARITHMIC: Price increases logarithmically (slowing price growth)
- SIGMOID: S-curve pricing model (slow, then rapid, then slow growth)
The implementation includes slippage protection and mathematically robust pricing models.
- Run
bun run fix-503to diagnose and fix common network issues - Check if the MinIO service is running
- Verify API server is operational with
bun check-backend.js
- For S3/MinIO access issues, check CORS configuration
- Ensure your S3 bucket has proper CORS rules enabled
- Use the proxy endpoints
/api/proxy/...for consistent access
- Ensure your wallet is connected to Base Sepolia testnet
- Check RPC endpoint configuration
- Verify smart contract addresses are correct in
.env.local
Configure your storage endpoints in .env.local:
NEXT_PUBLIC_MINIO_URL=http://localhost:9000
NEXT_PUBLIC_API_URL=http://localhost:4023
Set your Pinata credentials:
PINATA_API_KEY=your_api_key
PINATA_API_SECRET=your_api_secret
PINATA_JWT=your_jwt_token
Configure RPC endpoints:
NEXT_PUBLIC_BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
NEXT_PUBLIC_FACTORY_ADDRESS=0xYourFactoryAddress
- Use the API proxy for media files to avoid CORS issues
- Implement proper CORS configuration on your S3/MinIO bucket
- Set appropriate cache headers for media files
- Use next/image for optimized image loading
- Server logs in
./logsdirectory - Performance metrics available at
/api/metrics - Contract analytics on BaseScan