Sing Lang is a modern web application that breaks down language barriers in music. Search for any song, get its lyrics, and translate them into any language using advanced AI translation models. Whether you're learning a new language, exploring international music, or just curious about what your favorite foreign songs mean, Sing Lang has you covered.
Note: This is a development project showcasing AI-powered lyrics translation. The application is not currently deployed but can be run locally for testing and development purposes.
- π Smart Song Search: Search for songs using the Genius API with comprehensive results
- π Multi-Language Translation: Translate lyrics to any language using Meta's Llama 3.3 70B model
- π€ User Accounts: Save your favorite translations with Supabase authentication
- π± Responsive Design: Optimized for both desktop and mobile devices
- β‘ Fast & Efficient: Built with Next.js 15 for optimal performance
- π¨ Beautiful UI: Modern design with Tailwind CSS and Lucide icons
- πΎ Translation History: Save and manage your translation history
sing-lang/
βββ app/ # Next.js App Router
β βββ api/ # API Routes
β β βββ genius/ # Genius API integration
β β β βββ songs/ # Song search endpoints
β β β βββ [id]/ # Individual song data
β β β βββ search/ # Search functionality
β β β βββ full/ # Full search results
β β β βββ quick/ # Quick search results
β β βββ openrouter/ # OpenRouter AI integration
β β βββ translation/ # Translation endpoint
β βββ search/ # Search page
β βββ song/ # Individual song pages
β β βββ [id]/ # Dynamic song route
β βββ translation/ # Translation pages
β β βββ [id]/ # Dynamic translation route
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
βββ components/ # React components
β βββ Background.tsx # Background component
β βββ DeleteTranslation.tsx # Translation deletion
β βββ FastResults.tsx # Quick search results
β βββ Header.tsx # Navigation header
β βββ Hero.tsx # Landing hero section
β βββ Loader.tsx # Loading animations
β βββ LyricsSection.tsx # Lyrics display
β βββ SearchBar.tsx # Search functionality
β βββ SearchResults.tsx # Search results display
β βββ SignupSignIn.tsx # Authentication forms
β βββ Song.tsx # Song component
β βββ TranslateBar.tsx # Translation interface
β βββ TranslateSection.tsx # Translation display
β βββ TranslationCardInfo.tsx # Translation cards
βββ context/ # React Context
β βββ AuthContext.tsx # Authentication context
βββ hooks/ # Custom React hooks
β βββ useApi.ts # API interaction hooks
βββ lib/ # Utility libraries
β βββ api.ts # API utilities
β βββ constants.ts # App constants
β βββ errorHandler.ts # Error handling
β βββ toast.tsx # Toast notifications
β βββ toastConfig.ts # Toast configuration
βββ public/ # Static assets
β βββ logo.png # Application logo
βββ supabase/ # Supabase integration
β βββ client.ts # Supabase client
β βββ data/ # Data layer
β βββ translations.ts # Translation data operations
βββ types/ # TypeScript definitions
β βββ api.ts # API type definitions
βββ .github/ # GitHub templates & workflows
βββ next.config.ts # Next.js configuration
βββ package.json # Dependencies & scripts
βββ postcss.config.mjs # PostCSS configuration
βββ tsconfig.json # TypeScript configuration
- Node.js 18+ and npm/yarn/pnpm
- A Genius API key (Get one here) - Note: Used for testing purposes only
- An OpenRouter API key (Get one here)
- A Supabase project (Create one here)
Create a .env.local file in the root directory:
# Genius API
GENIUS_ACCESS_TOKEN=your_genius_api_token
# OpenRouter AI
NEXT_PUBLIC_OPENROUTER_API_KEY=your_openrouter_api_key
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key-
Clone the repository
git clone https://github.com/aminammar1/lyrics-translator-ai.git cd lyrics-translator-ai -
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up your environment variables (see above)
-
Set up Supabase Database
Create the required tables and indexes in your Supabase project:
-- Enable Row Level Security ALTER DATABASE postgres SET "app.jwt_secret" TO 'your-jwt-secret'; -- Create users table (if using custom user profiles) CREATE TABLE IF NOT EXISTS public.users ( id UUID REFERENCES auth.users(id) ON DELETE CASCADE PRIMARY KEY, email TEXT UNIQUE NOT NULL, full_name TEXT, avatar_url TEXT, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Create translations table CREATE TABLE translations ( id UUID DEFAULT gen_random_uuid() PRIMARY KEY, user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE, song_id TEXT NOT NULL, title TEXT NOT NULL, artist TEXT NOT NULL, image_url TEXT, original_language TEXT NOT NULL, translation_language TEXT NOT NULL, original_lyrics TEXT NOT NULL, translated_lyrics TEXT NOT NULL, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Create indexes for better performance CREATE INDEX idx_translations_user_id ON translations(user_id); CREATE INDEX idx_translations_song_id ON translations(song_id); CREATE INDEX idx_translations_created_at ON translations(created_at DESC); CREATE INDEX idx_translations_user_created ON translations(user_id, created_at DESC); CREATE INDEX idx_users_email ON users(email); -- Enable Row Level Security ALTER TABLE users ENABLE ROW LEVEL SECURITY; ALTER TABLE translations ENABLE ROW LEVEL SECURITY; -- Create RLS policies -- Users can only see their own profile CREATE POLICY "Users can view own profile" ON users FOR SELECT USING (auth.uid() = id); CREATE POLICY "Users can update own profile" ON users FOR UPDATE USING (auth.uid() = id); CREATE POLICY "Users can insert own profile" ON users FOR INSERT WITH CHECK (auth.uid() = id); -- Users can only see their own translations CREATE POLICY "Users can view own translations" ON translations FOR SELECT USING (auth.uid() = user_id); CREATE POLICY "Users can insert own translations" ON translations FOR INSERT WITH CHECK (auth.uid() = user_id); CREATE POLICY "Users can update own translations" ON translations FOR UPDATE USING (auth.uid() = user_id); CREATE POLICY "Users can delete own translations" ON translations FOR DELETE USING (auth.uid() = user_id);
-
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
- Search for a Song: Use the search bar on the homepage to find any song
- Select a Song: Choose from the search results to view lyrics
- Translate: Select your target language and click translate
- Save (Optional): Sign up/in to save your translations for later
- Manage: View and manage your saved translations in your profile
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
- Next.js 15.4.1 - React framework with App Router
- React 19.1.0 - UI library
- TypeScript 5 - Type safety
- Tailwind CSS 4 - Styling framework
- Lucide React - Icon library
- React Hot Toast - Notifications
- Genius API - Song lyrics and metadata
- OpenRouter API - AI translation (Meta Llama 3.3 70B)
- Supabase - Authentication and database
- Axios - HTTP client
- Cheerio - Web scraping
- ISO-639-1 - Language code utilities
- React Spinners - Loading indicators
We welcome contributions from the community! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
npm run lint - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow the existing code style and conventions
- Write clear, concise commit messages
- Add tests for new features when applicable
- Update documentation as needed
- Ensure your code passes all linting checks
- π Additional language support
- π¨ UI/UX improvements
- π§ Performance optimizations
- π± Mobile experience enhancements
- π§ͺ Test coverage improvements
- π Documentation updates
- π Bug fixes
- Be respectful and inclusive
- Provide constructive feedback
- Help others learn and grow
- Follow project guidelines
Please use our GitHub issue templates:
This project is licensed under the MIT License. See the LICENSE file for details.
MIT License
Copyright (c) 2025 Amin Ammar
- Genius for providing the lyrics API (used for testing and educational purposes only)
- OpenRouter for AI translation services
- Supabase for backend services
- Next.js team for the amazing framework
- Vercel for deployment platform
- All contributors who help make this project better
- Author: Mohmed Amine Ammar
- GitHub: @aminammar1
- Project Repository: lyrics-translator-ai
β Star this repo if you like it!





