Transform your study materials into catchy songs that stick in your memory forever. SongStudy uses AI to convert notes, PDFs, and images into memorable educational songs.
- AI-Powered Song Generation: Convert study materials into catchy songs using GPT-4 and Suno
- Multi-Format Support: Upload text, PDFs, DOCX files, or images with OCR
- Smart Content Analysis: Automatic topic extraction and complexity assessment
- News Sensitivity Gate: Automatically detects sensitive content and switches to narration mode
- Interactive Learning: Quizzes and spaced repetition for better retention
- Beautiful UI: Modern, responsive design with smooth animations
- Frontend: Next.js 14, TypeScript, Tailwind CSS, Framer Motion
- Backend: Next.js API Routes, Prisma ORM, PostgreSQL
- AI Services: OpenAI GPT-4, Suno API, Tesseract OCR
- Authentication: NextAuth.js with Google/Email providers
- Storage: MinIO (S3-compatible) for file storage
- Queue: BullMQ with Redis for background jobs
- Search: OpenSearch for content discovery
- Node.js 18+ and pnpm
- PostgreSQL database
- Redis server
- MinIO (S3-compatible storage)
- OpenAI API key
- Suno HackMIT API token
-
Clone and install dependencies
git clone <repository-url> cd songstudy pnpm install
-
Set up environment variables
cp .env.example .env.local
Fill in your API keys and database URLs in
.env.local:# OpenAI OPENAI_API_KEY=sk-proj-your-key-here # Suno HackMIT SUNO_HACKMIT_TOKEN=your-suno-token-here # Database DATABASE_URL=postgres://user:password@localhost:5432/songstudy REDIS_URL=redis://localhost:6379 # Storage OBJECT_STORE_BUCKET=songstudy OBJECT_STORE_PUBLIC_BASE_URL=http://localhost:9000
-
Start development services
# Start PostgreSQL, Redis, MinIO, and OpenSearch docker-compose -f docker-compose.dev.yml up -d -
Set up database
pnpm db:push pnpm db:seed
-
Start development server
pnpm dev
-
Open your browser Navigate to http://localhost:3000
src/
├── app/ # Next.js 14 app router
│ ├── api/ # API routes
│ ├── discover/ # Discover page
│ ├── create/ # Create song page
│ ├── my-songs/ # User's songs
│ ├── quizzes/ # Quiz interface
│ └── dashboard/ # Analytics dashboard
├── components/ # React components
│ ├── ui/ # Reusable UI components
│ └── layout.tsx # Main layout
├── lib/ # Utilities and configurations
│ ├── auth.ts # NextAuth configuration
│ ├── prisma.ts # Database client
│ └── utils.ts # Helper functions
├── services/ # Business logic services
│ ├── llm-orchestrator.ts # GPT-4 integration
│ ├── suno-adapter.ts # Suno API integration
│ └── ingestion-service.ts # File processing & OCR
└── types/ # TypeScript type definitions
# Development
pnpm dev # Start development server
pnpm build # Build for production
pnpm start # Start production server
# Database
pnpm db:generate # Generate Prisma client
pnpm db:push # Push schema changes
pnpm db:migrate # Run migrations
pnpm db:seed # Seed database
# Testing
pnpm test # Run unit tests
pnpm test:e2e # Run E2E tests
pnpm test:coverage # Run tests with coverage
# Code Quality
pnpm lint # Run ESLint
pnpm type-check # Run TypeScript checks- Upload files (PDF, DOCX, images) or paste text
- OCR extracts text from images and PDFs
- AI analyzes content for topics and complexity
- GPT-4 extracts key facts and creates lyrics
- News sensitivity gate checks for appropriate content
- Suno API generates music with the lyrics
- Fallback to instrumental + TTS for sensitive content
- Interactive player with captions
- Spaced repetition quizzes
- Progress tracking and analytics
- Personalized recommendations
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key for GPT-4 | Yes |
SUNO_HACKMIT_TOKEN |
Suno HackMIT API token | Yes |
DATABASE_URL |
PostgreSQL connection string | Yes |
REDIS_URL |
Redis connection string | Yes |
OBJECT_STORE_BUCKET |
MinIO bucket name | Yes |
JWT_SECRET |
JWT signing secret | Yes |
NEXTAUTH_SECRET |
NextAuth secret | Yes |
GOOGLE_CLIENT_ID |
Google OAuth client ID | No |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret | No |
# Run all tests
pnpm test
# Run specific test suites
pnpm test -- --grep "LLM Orchestrator"
pnpm test -- --grep "Suno Adapter"
# Run E2E tests
pnpm test:e2e
# Run with coverage
pnpm test:coveragepnpm build
pnpm start# Build Docker image
docker build -t songstudy .
# Run with docker-compose
docker-compose up -d- Set up production database (PostgreSQL)
- Configure Redis instance
- Set up MinIO or S3-compatible storage
- Configure environment variables
- Run database migrations
- Deploy application
The application includes:
- OpenTelemetry tracing
- Prometheus metrics
- Error tracking
- Performance monitoring
- Cost estimation for AI services
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- 📧 Email: support@songstudy.app
- 💬 Discord: Join our community
- 📖 Documentation: docs.songstudy.app
- 🐛 Issues: GitHub Issues
- OpenAI for GPT-4 API
- Suno for music generation API
- Next.js team for the amazing framework
- Prisma team for the excellent ORM
- All contributors and users
Made with ❤️ by the SongStudy team