Skip to content

Arogancki/aimusicdetector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 AI Music Detector

The #1 Tool to Detect AI-Generated Music Online

AI Music Detector is a production-ready web application that identifies AI-generated music in your Spotify, Tidal, Apple Music, and YouTube Music libraries. Authorize your streaming accounts, analyze your liked songs, and instantly discover which tracks are AI-generated with detailed confidence scores.

🎯 Features

  • Multi-Platform Support: Connect Spotify, Tidal, Apple Music, and YouTube Music
  • Multi-Provider AI Detection: Uses 3+ detection APIs with intelligent fallback (Suno, Essentia, MusicCaps)
  • Smart Fallback: Automatically switches to next provider if one fails or hits rate limit
  • Consensus Scoring: Combines results from multiple providers for higher accuracy
  • Batch Processing: Analyze 2000+ songs efficiently with 50-song batches and smart rate limiting
  • Real-Time Animations: πŸŽ‰ Fireworks, 🎊 confetti, ✨ bucket sorting, πŸ’« progress animations
  • Privacy First: End-to-end encrypted, OAuth-only authentication
  • Beautiful UI: Modern, responsive design with stunning animations for desktop and mobile
  • Production Ready: Enterprise-grade security, error handling, and logging
  • Monetization: Built-in advertising support (Google AdSense)
  • Analytics Dashboard: Admin panel with system stats, provider monitoring, and detection metrics
  • Results Caching: MongoDB storage + 24-hour in-memory cache for fast result retrieval

πŸ—οΈ Architecture

Backend (Node.js + Express + TypeScript)

  • Express server with middleware for security (Helmet, CORS, Rate Limiting)
  • MongoDB for user data and analysis results
  • Passport.js for OAuth authentication
  • JWT for secure session management
  • Winston for logging

Frontend (React + TypeScript + Tailwind CSS)

  • React Router for navigation
  • Zustand for state management
  • Axios for API calls
  • Tailwind CSS for styling
  • Lucide Icons for UI elements
  • Vite for fast build and development

πŸ“ Project Structure

ai-music-checker/
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/      # Request handlers
β”‚   β”‚   β”œβ”€β”€ services/         # Business logic
β”‚   β”‚   β”œβ”€β”€ models/           # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ routes/           # API endpoints
β”‚   β”‚   β”œβ”€β”€ middleware/        # Auth, error handling
β”‚   β”‚   β”œβ”€β”€ config/           # Passport, database
β”‚   β”‚   └── utils/            # Logger, helpers
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   └── .env.example
β”‚
β”œβ”€β”€ client/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/       # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   β”‚   β”œβ”€β”€ services/         # API integration
β”‚   β”‚   β”œβ”€β”€ context/          # Auth context
β”‚   β”‚   β”œβ”€β”€ styles/           # Global CSS
β”‚   β”‚   β”œβ”€β”€ App.tsx
β”‚   β”‚   └── main.tsx
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ vite.config.ts
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”‚
β”œβ”€β”€ docker-compose.yml        # MongoDB setup
└── README.md

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • MongoDB
  • Spotify, Apple Music, Tidal, YouTube Music API credentials

Backend Setup

  1. Navigate to server directory

    cd server
  2. Install dependencies

    npm install
  3. Configure environment variables

    cp .env.example .env

    Fill in your API keys and database URL

  4. Start development server

    npm run dev

    Server runs on http://localhost:5000

Frontend Setup

  1. Navigate to client directory

    cd client
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev

    Frontend runs on http://localhost:3000

πŸ” Authentication Flow

  1. User clicks "Connect [Platform]" button
  2. OAuth flow redirects to streaming service
  3. User grants permission to access liked songs
  4. Token stored securely in MongoDB
  5. JWT token generated for frontend session
  6. User can analyze songs and view results

πŸ’° Monetization Strategy

1. Google AdSense Integration

  • Banner ads on homepage and dashboard
  • Sidebar ads on results page
  • Placement in footer

2. Premium Tier (Future)

  • Unlimited song analysis
  • Export results as PDF/CSV
  • Playlist-level analysis
  • Historical trends and insights

3. API Partnerships

  • Spotify for Artists integration
  • Label partnerships for music metadata
  • Licensing data to music industry

4. White-Label Solution

  • B2B offering for music platforms
  • Custom branding options
  • API access for integrations

πŸ”Œ API Endpoints

Authentication

  • GET /api/auth/spotify - Spotify OAuth
  • GET /api/auth/spotify/callback - OAuth callback
  • POST /api/auth/logout - Logout
  • GET /api/auth/me - Get current user

Music Analysis

  • POST /api/music/check-liked-songs - Analyze liked songs
  • POST /api/music/analyze - Analyze single track

User

  • GET /api/user/profile - Get user profile
  • PUT /api/user/preferences - Update preferences
  • GET /api/user/analysis-history - Get history

Admin

  • GET /api/admin/analytics - System analytics
  • GET /api/admin/system-stats - System statistics

πŸ” Security Features

  • HTTPS Only in production
  • CORS configured for origin validation
  • Helmet for HTTP headers security
  • Rate Limiting to prevent abuse
  • JWT tokens with expiration
  • Password hashing with bcrypt (ready for email auth)
  • Input validation with Joi
  • Secure session cookies

πŸ“Š AI Detection Integration

Currently using mock AI detection. To integrate a real API:

  1. Sign up for service (e.g., Suno API, MusicCaps)
  2. Update AI_DETECTION_API_URL and AI_DETECTION_API_KEY in .env
  3. Modify server/src/services/aiDetectionService.ts:
const response = await axios.post(
  `${process.env.AI_DETECTION_API_URL}/analyze`,
  { trackName, artistName },
  { headers: { Authorization: `Bearer ${process.env.AI_DETECTION_API_KEY}` } }
);

πŸ“± Mobile Responsive Design

  • Mobile-first approach with Tailwind CSS
  • Touch-friendly buttons and navigation
  • Optimized for all screen sizes
  • Performance optimized with Vite

πŸ§ͺ Testing

# Backend tests
cd server
npm test

# Frontend tests
cd client
npm test

πŸ“¦ Deployment

Using Docker

docker-compose up

Production Build

Backend:

cd server
npm run build
npm start

Frontend:

cd client
npm run build
# Serve dist folder with static hosting

Environment Variables (Production)

Update .env with production values:

MONGODB_URI=mongodb+srv://prod-user:pass@prod-cluster.mongodb.net/ai-music-checker
JWT_SECRET=long-random-production-secret
NODE_ENV=production
CLIENT_URL=https://yourdomain.com

πŸ› οΈ Tech Stack

Layer Technology
Frontend React 18, TypeScript, Tailwind CSS, Vite
Backend Node.js, Express, TypeScript
Database MongoDB with Mongoose
Auth OAuth 2.0, JWT, Passport.js
Styling Tailwind CSS, Lucide Icons
HTTP Client Axios
State Management Zustand
Logging Winston
Security Helmet, bcryptjs, Joi

πŸ“ License

MIT License - feel free to use this project for commercial purposes.

🀝 Contributing

Contributions welcome! Please open an issue or submit a PR.

πŸ“§ Support

For questions or issues, create a GitHub issue or contact support@aimusicchecker.com


Built with ❀️ for music lovers

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors