A full-stack AI-powered web application for finding and visualizing guitar chord progressions. Features intelligent song search using Google's Gemini AI, custom SVG chord diagrams, music theory analysis, and PDF export capabilities.
- π€ AI-Powered Search - Uses Gemini 2.0 Flash for intelligent chord extraction from web sources
- π¨ Custom SVG Chord Diagrams - 200+ chord library with professional finger positioning
- π΅ Music Theory Analysis - Automatic key detection and scale analysis
- π¬ Natural Language Interface - Chat-based query system for intuitive song searches
- π PDF Export - Generate printable chord sheets with diagrams
- π Dark/Light Theme - Beautiful pastel-themed UI with theme switching
- π Report System - Report incorrect results for improved accuracy
- π± Responsive Design - Works seamlessly on desktop and mobile devices
- π Multiple Fallbacks - Ensures high success rate with layered approach
Fret./
βββ backend/ # Flask API server
β βββ app.py # Main Flask application with API endpoints
β βββ scraper.py # Ultimate Guitar web scraping
β βββ parser.py # Chord analysis and music theory algorithms
β βββ cli.py # Command line interface
β βββ requirements.txt # Python dependencies
β βββ GEMINI_SETUP.md # Gemini AI setup guide
β βββ README.md # Backend documentation
β βββ logs/ # Application logs
βββ frontend/ # Vue.js web application
β βββ src/
β β βββ components/ # Vue components
β β β βββ ChatInterface.vue # Main chat interface
β β β βββ ChordDiagram.vue # Individual chord diagram
β β β βββ ChordDiagramGrid.vue # Chord grid layout
β β β βββ PdfExport.vue # PDF export functionality
β β β βββ ThemeToggle.vue # Theme switcher
β β β βββ ResultsDisplay.vue # Results presentation
β β βββ assets/ # Styles and assets
β β βββ App.vue # Root component
β β βββ main.js # Application entry point
β βββ package.json # Node.js dependencies
β βββ README.md # Frontend documentation
βββ .gitignore # Git ignore rules
βββ README.md # This file
- Python 3.8+
- Node.js 14+ and npm
- Google Gemini API key (optional but recommended)
- Get one from Google AI Studio
git clone <repository-url>
cd Fret.cd backend
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
# .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set Gemini API key (optional but recommended)
export GEMINI_API_KEY="your_api_key_here"
# Or create a .env file in the project root:
# echo "GEMINI_API_KEY=your_api_key_here" > ../.env
# Start the server
python app.pyThe backend will run on http://localhost:5000
Open a new terminal:
cd frontend
# Install dependencies
npm install
# Start development server
npm run serveThe frontend will run on http://localhost:8080
Open your browser and navigate to http://localhost:8080
- User Query - Enter a natural language query like "Wonderwall by Oasis" in the chat interface
- AI Processing - Backend uses Gemini AI to search the web and extract chord data
- Music Theory Analysis - System analyzes chord progression to detect key and scale
- Visualization - Custom SVG engine renders professional chord diagrams
- Display - Results show song info, chord progression, music theory analysis, and interactive diagrams
- Export - Users can export chord sheets as PDF for offline use
-
POST
/chat- Main chat interface for song queriesRequest: { "message": "Wonderwall by Oasis" } Response: { "title": "...", "artist": "...", "chords": "...", "music_theory": {...} }
-
POST
/report- Report incorrect song and retry searchRequest: { "original_query": "...", "returned_title": "...", "returned_artist": "..." } -
POST
/export-pdf- Generate PDF from chord dataRequest: { "title": "...", "artist": "...", "chords": [...] } Response: PDF file binary
- GET
/healthz- Health check endpoint - GET
/chords?query=song_name- Legacy chord search endpoint - GET
/test-gemini?query=song_name- Test Gemini AI functionality
The system uses Google's Gemini 2.0 Flash model to intelligently search the web and extract chord progressions. It can handle various query formats and automatically finds the correct song from multiple sources.
- 200+ Chord Library - Comprehensive collection of common chords
- Professional Rendering - SVG-based diagrams with accurate finger positioning
- Interactive Modal - View all chord diagrams in a popup modal
- Finger Numbers - Shows proper finger placement (1-4) instead of fret numbers
- Barre Chord Detection - Automatically detects and renders barre chords correctly
- Key Detection - Analyzes chord progression to determine musical key
- Scale Identification - Identifies major or minor scale
- Confidence Levels - Provides high/medium/low confidence ratings
- Scale Notes Display - Shows all notes in the detected key's scale
- Chat-Based Interface - Natural conversation flow for queries
- Split-Panel Layout - Chat on left, results on right
- Dark/Light Themes - Beautiful pastel color palette
- Responsive Design - Works on all screen sizes
- Real-Time Feedback - Loading indicators and error messages
- Backend Documentation - Detailed backend API and setup
- Frontend Documentation - Frontend component details
- Gemini AI Setup Guide - Step-by-step AI integration
cd backend
source .venv/bin/activate # Activate virtual environment
python app.py # Run Flask servercd frontend
npm run serve # Start development server with hot reloadcd frontend
npm run build # Build optimized production bundleThe built files will be in frontend/dist/
- Flask - Lightweight web framework
- Google Gemini AI - AI model for intelligent search
- BeautifulSoup4 - HTML parsing
- Playwright - Browser automation
- Flask-CORS - Cross-origin resource sharing
- Vue.js 3 - Progressive JavaScript framework
- Tailwind CSS - Utility-first CSS framework
- Axios - HTTP client
- jsPDF - PDF generation
- API keys are stored as environment variables (never hardcoded)
.gitignoreconfigured to exclude sensitive files- CORS properly configured for development
- No credentials committed to repository
"GEMINI_API_KEY not found"
- Set the environment variable:
export GEMINI_API_KEY="your_key" - Or create a
.envfile in the project root - See Gemini Setup Guide for details
"No chord results found"
- Try different song names or include artist name
- Check if Gemini API key is set correctly
- Verify backend server is running on port 5000
"Failed to contact backend"
- Ensure backend server is running on http://localhost:5000
- Check browser console for CORS errors
- Verify API endpoint URLs in code
Chord diagrams not showing
- Check browser console for errors
- Verify chord names are in the supported format
- Try refreshing the page
This project is for educational purposes. Please respect Ultimate Guitar's terms of service when using web scraping features.
This is a personal project, but suggestions and feedback are welcome!
- The application works without a Gemini API key but with limited functionality
- Chord diagrams support standard 6-string guitar tuning only
- Music theory analysis currently supports major and natural minor scales
- PDF export includes all chord diagrams and song metadata
Happy chord hunting! πΈβ¨