Decentralized Data Marketplace for Ethical AI Training
Synapse Ledger revolutionizes the data economy by enabling individuals to monetize anonymized data while providing AI developers access to ethically-sourced, verified datasets. Our platform uses blockchain-based smart contracts for transparent royalty distribution, IPFS for decentralized storage, and advanced privacy-preserving mechanisms.
To create a transparent, fair, and decentralized data marketplace that empowers data contributors while accelerating ethical AI development.
- π€ Data Upload & Anonymization - Securely upload photos, text, code repositories
- π° Real-time Royalty Tracking - Monitor earnings and payment distribution
- π Privacy Controls - Maintain anonymity with advanced privacy mechanisms
- π― Stake Management - Participate in targeted data pools for higher rewards
- π Dataset Marketplace - Browse, filter, and purchase verified datasets
- π Quality Metrics - Access metadata, quality scores, and provenance verification
- π API Integration - Seamless data access with comprehensive APIs
- π Usage Analytics - Track data usage and compliance metrics
- β Regulatory Compliance - Built-in compliance checks and documentation
- β‘ Smart Contract Automation - Automated royalty distribution
- π Community Quality Scoring - Decentralized data quality assessment
- π³οΈ DAO Governance - Community-driven platform decisions
- π Federated Learning Compatible - On-device preprocessing support
| Layer | Technologies |
|---|---|
| Frontend | Next.js 15, React 19, TypeScript, Tailwind CSS |
| Backend | Node.js, Express, TypeScript, Drizzle ORM |
| Smart Contracts | Solidity, Hardhat, OpenZeppelin, Ethereum |
| Storage | Pinata, IPFS |
| Web3 | Ethers.js v6 |
| Database | PostgreSQL with Drizzle ORM |
| UI Components | Radix UI, shadcn/ui, Lucide Icons |
| Deployment | Docker, Vercel |
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β Smart Contracts β
β (Next.js) βββββΊβ (Node.js) βββββΊβ (Solidity) β
β β β β β β
β β’ Wallet UI β β β’ REST API β β β’ DataRegistry β
β β’ Marketplace β β β’ Express β β β’ RoyaltyDist β
β β’ Data Upload β β β’ Drizzle ORM β β β’ SynTK Token β
β β’ Dashboard β β β’ IPFS Service β β β’ Marketplace β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βββββββββββββββββββ
β Storage β
β (IPFS/Pinata) β
β β
β β’ File Storage β
β β’ PostgreSQL β
β β’ Access Controlβ
βββββββββββββββββββ
- Node.js 18+
- PostgreSQL 15+
- MetaMask or compatible Web3 wallet
- Docker (optional, for database)
git clone https://github.com/Soundcreates/Synapse.git
cd Synapsecd backend2
npm install
cp .env.example .env
# Configure your environment variables
# Option 1: Use Docker for PostgreSQL
docker-compose up -d
# Option 2: Use local PostgreSQL
# Make sure PostgreSQL is running locally
# Generate and run migrations
npm run db:generate
npm run migrate
# Start development server
npm run devcd client3
npm install
cp .env.example .env
# Configure your environment variables
npm run devcd hardhat
npm install
cp .env.example .env
# Configure your environment variables
npx hardhat test
npx hardhat run scripts/deploy.js --network mumbaiCreate .env files in each directory:
# Database Configuration
DATABASE_URL=postgresql://postgres:synapse@localhost:5432/SynapseDB
# Pinata IPFS Configuration
PINATA_API_KEY=your-pinata-api-key
PINATA_SECRET_API_KEY=your-pinata-secret-key
# Port Configuration
PORT=5000
# Blockchain Configuration
ETHEREUM_RPC_URL=https://sepolia.infura.io/v3/your-key# API Configuration
NEXT_PUBLIC_API_BASE_URL=http://localhost:5000
# Smart Contract Addresses
NEXT_PUBLIC_DATA_REGISTRY_ADDRESS=0x...
NEXT_PUBLIC_TOKEN_MARKETPLACE_ADDRESS=0x...
NEXT_PUBLIC_SYNTK_TOKEN_ADDRESS=0x...
NEXT_PUBLIC_ROYALTY_DISTRIBUTION_ADDRESS=0x...
# Pinata Configuration
NEXT_PUBLIC_PINATA_GATEWAY=https://gateway.pinata.cloud
# Network Configuration
NEXT_PUBLIC_CHAIN_ID=11155111
NEXT_PUBLIC_NETWORK_NAME=sepoliaPRIVATE_KEY=your-private-key
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/your-key
ETHERSCAN_API_KEY=your-etherscan-keyFor easy development setup, you can use Docker for the PostgreSQL database:
cd backend2
docker-compose up -dThis will start a PostgreSQL container with the default configuration.
- Start the database:
cd backend2 && docker-compose up -d - Run migrations:
npm run migrate - Start backend:
npm run dev(runs on port 5000) - Start frontend:
cd ../client3 && npm run dev(runs on port 3000) - Deploy contracts:
cd ../hardhat && npx hardhat run scripts/deploy.ts --network sepolia
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Database Studio:
npm run db:studio(Drizzle Studio) - PostgreSQL: localhost:5432
- DataRegistry.sol - Core marketplace functionality for dataset registration
- RoyaltyDistribution.sol - Automated royalty payment management
- SynTK.sol - ERC-20 token for platform transactions and governance
- TokenMarketplace.sol - Marketplace for trading data access tokens
- Express API - RESTful endpoints for all platform operations
- Drizzle ORM - Type-safe database operations with PostgreSQL
- Pinata Service - IPFS file upload and retrieval management
- Data Controllers - Dataset management and validation
- Multer Middleware - File upload handling and processing
- Next.js 15 - Modern React framework with App Router
- Wallet Integration - Seamless Web3 wallet connection with MetaMask
- Data Upload - Intuitive file upload with progress tracking
- Marketplace - Advanced search and filtering capabilities
- Dashboard - Real-time analytics and earnings tracking
- Responsive Design - Mobile-first design with Tailwind CSS
- Component Library - Radix UI components with shadcn/ui styling
cd hardhat
npx hardhat test
npx hardhat coveragecd backend2
npm test
npm run buildcd client3
npm run lint
npm run build- Smart Contracts: >95% coverage
- Backend: >85% coverage
- Frontend: >80% coverage
# Build the application
cd backend2
npm run build
# Deploy using Docker
docker build -t synapse-backend .
docker run -p 5000:5000 synapse-backend# Deploy to Vercel
cd client3
npm run build
vercel --prodcd hardhat
npx hardhat run scripts/deploy.ts --network sepolia
npx hardhat verify --network sepolia <contract-address>- Backend: Docker containers (Railway, AWS, or self-hosted)
- Frontend: Vercel (Static site generation)
- Database: PostgreSQL (Docker, Railway, or AWS RDS)
- Storage: Pinata IPFS for decentralized file storage
- Blockchain: Ethereum Sepolia Testnet / Ethereum Mainnet
- Backend: Health endpoints at
/health - Database: PostgreSQL connection monitoring
- Smart Contracts: Event monitoring and gas tracking
- IPFS: File availability checks via Pinata
- API response times and throughput
- Database query performance
- IPFS upload/download speeds
- Smart contract gas optimization
- User engagement metrics
- Transaction volume and fees
- Data quality scores
- Revenue distribution
Synapse/
βββ backend2/ # Node.js/Express backend
β βββ config/ # Database configuration
β βββ controller/ # API controllers
β βββ middleware/ # Express middleware
β βββ migrations/ # Database migrations
β βββ models/ # Drizzle ORM models
β βββ routes/ # API routes
β βββ service/ # Business logic services
β βββ docker-compose.yml # PostgreSQL container
β βββ main.ts # Application entry point
β
βββ client3/ # Next.js frontend
β βββ app/ # Next.js App Router pages
β βββ components/ # React components
β βββ contractData/ # Smart contract ABIs
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility functions
β βββ public/ # Static assets
β βββ utils/ # Helper utilities
β
βββ hardhat/ # Smart contracts
β βββ contracts/ # Solidity contracts
β βββ scripts/ # Deployment scripts
β βββ test/ # Contract tests
β βββ typechain-types/ # Generated TypeScript types
β
βββ docs/ # Documentation files
- Smart contract development (DataRegistry, TokenMarketplace, SynTK, RoyaltyDistribution)
- Backend API with Express and TypeScript
- PostgreSQL database with Drizzle ORM
- IPFS integration with Pinata
- Next.js frontend with Web3 integration
- Advanced search and filtering in marketplace
- User authentication and profiles
- Dataset quality scoring system
- Royalty distribution automation
- Mobile-responsive design improvements
- DAO governance implementation
- Community-driven quality assessment
- Staking and reward mechanisms
- Advanced privacy features
- Multi-chain support (Polygon, Arbitrum)
- Enterprise API packages
- Advanced analytics dashboard
- Regulatory compliance tools
# Check if PostgreSQL is running
docker ps
# Restart the database container
cd backend2
docker-compose down
docker-compose up -d
# Check database logs
docker-compose logs postgres# Reset migrations (development only)
npm run clear-db
npm run db:generate
npm run migrate# Clear Next.js cache
cd client3
rm -rf .next
npm run build# Check network configuration
cd hardhat
npx hardhat verify --list-networks
# Check gas prices and account balance
npx hardhat balance --account <your-address>Make sure you have configured:
- β Database connection string
- β Pinata API keys
- β Smart contract addresses
- β RPC endpoints
- β Private keys (for deployment)
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style and conventions
- Write comprehensive tests for new features
- Update documentation for API changes
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License - see the LICENSE file for details.
- Repository: GitHub - Synapse
- Issues: Report bugs and feature requests
- Discussions: GitHub Discussions
- Releases: Latest releases
- GitHub Issues: Report bugs and feature requests
- GitHub Discussions: Technical discussions and questions
- Email: Contact the development team through GitHub
Built with β€οΈ by the Synapse Ledger Team
Empowering ethical AI through decentralized data markets