"Discover the best podcasts, videos, and articles to learn anything — personalized to your learning style."
LearnFlow is an AI-powered learning resource curation platform that uses Cloudflare Workers AI (Llama 3.3) to intelligently rank and recommend educational content from YouTube, Spotify, and NewsData.io based on your preferred learning style.
The Internet is overflowing with educational content, but finding high-quality, relevant resources is time-consuming. LearnFlow solves this by:
- Searching multiple content sources simultaneously (YouTube videos, Spotify podcasts, articles)
- AI-powered ranking using Llama 3.3 to identify the most valuable resources
- Personalized recommendations tailored to your learning style (Visual 🎥, Listener 🎧, or Reader 📖)
- Explainable AI - each recommendation includes a brief explanation of why it was recommended
- 🔍 Topic Search - Search any subject you want to learn about
- 🎨 Learning Style Selection - Choose between Visual, Listener, or Reader preferences
- 🤖 AI-Powered Curation - Intelligent ranking using Cloudflare Workers AI (Llama 3.3)
- 💡 Explainable Recommendations - Each resource includes "Why this was recommended"
- ⭐ Favorites - Save resources to localStorage for later access
- 📱 Responsive Design - Works seamlessly on mobile and desktop
- ⚡ Edge Computing - Powered by Cloudflare Workers for global performance
- 🚀 Serverless Architecture - Fully serverless with Cloudflare Pages + Workers
- 🔒 Type-Safe - Built with TypeScript for better developer experience
- 🎨 Modern UI - Built with Next.js 14, Tailwind CSS, and responsive design
Frontend (Next.js + Tailwind)
│
├── /search → topic + style input
├── /favorites → localStorage bookmarks
│
└── Cloudflare Worker (Backend API)
├── Fetch YouTube videos
├── Fetch Spotify podcasts
├── Fetch NewsData.io articles
├── Merge + normalize JSON
├── Send to Workers AI (Llama 3.3) for reasoning
└── Return top N recommendations
Deployment:
- Frontend → Cloudflare Pages
- Backend → Cloudflare Workers
- Memory/State → Cloudflare KV (optional, for trending topics)
- Next.js 14 (App Router) - React framework with SSR
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- CSS Transitions - Native animations
- Cloudflare Workers - Serverless edge functions
- TypeScript - Type-safe backend code
- Wrangler 3 - Development and deployment CLI
- Cloudflare Workers AI - Llama 3.3 8B Instruct model
- YouTube Data API v3 - Video content
- Spotify Web API - Podcast content
- NewsData.io API - Article content
- LocalStorage - Client-side favorites persistence
- Cloudflare KV - Optional server-side state (trending topics)
Before you begin, ensure you have:
- Node.js 18.x or later
- npm or yarn package manager
- Cloudflare account with Workers AI enabled
- API Keys for:
- YouTube Data API v3
- Spotify Web API (Client ID and Secret)
- NewsData.io API
git clone https://github.com/yourusername/cf_ai_learnflow.git
cd cf_ai_learnflownpm install
# or
yarn installcd worker
npm install
# or
yarn installNEXT_PUBLIC_WORKER_URL=https://your-worker.your-subdomain.workers.dev[vars]
YOUTUBE_API_KEY=your_youtube_api_key
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
NEWSDATA_API_KEY=your_newsdata_api_keyOr set them in Cloudflare Dashboard:
- Go to Workers & Pages → Your Worker → Settings → Variables
- Add each variable as a secret
- Go to Google Cloud Console
- Create a new project or select existing
- Enable YouTube Data API v3
- Create credentials (API Key)
- Copy the API key
- Go to Spotify Developer Dashboard
- Create a new app
- Copy Client ID and Client Secret
- Note: You'll use Client Credentials flow for authentication
- Go to NewsData.io
- Sign up for a free account
- Get your API key from the dashboard
- Log in to Cloudflare Dashboard
- Go to Workers & Pages → AI
- Enable Workers AI for your account
- Note your Account ID (needed for
wrangler.toml)
name = "learnflow-worker"
main = "src/index.ts"
compatibility_date = "2024-01-01"
account_id = "your-cloudflare-account-id"
[ai]
binding = "AI"npm run dev
# or
yarn devcd worker
npm run dev
# or
wrangler devcf_ai_learnflow/
├── Docs/ # Project documentation
│ ├── Implementation.md # Implementation plan
│ ├── project_structure.md # Project structure details
│ └── UI_UX_doc.md # UI/UX guidelines
├── src/ # Frontend source (Next.js)
│ ├── app/ # App Router pages
│ ├── components/ # React components
│ ├── lib/ # Utilities and helpers
│ └── hooks/ # Custom React hooks
├── worker/ # Cloudflare Worker backend
│ ├── src/
│ │ ├── index.ts # Worker entry point
│ │ ├── api/ # API integration functions
│ │ └── ai/ # AI prompt templates
│ └── wrangler.toml # Worker configuration
├── public/ # Static assets
├── .env.example # Example environment variables
├── README.md # This file
└── PROMPTS.md # AI prompts documentation
For detailed structure, see Docs/project_structure.md
-
Via GitHub Integration (Recommended)
- Push your code to GitHub
- Go to Cloudflare Dashboard → Workers & Pages → Create Application
- Select Pages → Connect to Git
- Select your repository
- Build settings:
- Framework preset: Next.js
- Build command:
npm run build - Build output directory:
.next
-
Via Wrangler CLI
npm run build npx wrangler pages deploy .next
cd worker
npm run deploy
# or
wrangler publish- Go to Cloudflare Dashboard → Workers & Pages → Your Worker
- Settings → Variables and Secrets
- Add all required API keys as secrets
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
npm run dev- Start local development servernpm run deploy- Deploy to Cloudflarenpm run type-check- Type check TypeScript
- Start both servers (frontend and worker)
- Make changes to frontend or worker code
- Test locally before deploying
- Deploy worker first, then frontend
- Update frontend env variable with worker URL if needed
- Manual testing with various topics
- Test all three learning styles
- Verify favorites persistence
- Test error scenarios
- Cross-browser testing (Chrome, Firefox, Safari)
- Implementation Plan - Detailed implementation stages
- Project Structure - File organization
- UI/UX Documentation - Design system and guidelines
- PROMPTS.md - AI prompts used for ranking
- ✅ Deployed demo on Cloudflare Pages + Workers
- ✅ 5+ working recommendations per search
- ✅ Functional favorites persistence via localStorage
- ✅ README & PROMPTS files clear and complete
- ✅ All API integrations working correctly
- ✅ Responsive design works on mobile and desktop
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is created for the Cloudflare AI application submission.
- Built for Cloudflare's AI application challenge
- Uses Cloudflare Workers AI with Meta's Llama 3.3 model
- Powered by Cloudflare's edge network
For questions or issues, please open an issue on GitHub.
Built with ❤️ using Cloudflare Workers AI