Learnly - A community learning platform where learners find compatible study partners and achieve their goals together!
Get complete access to Learnly, an AI-powered learning platform that connects you with the perfect learning partners based on your goals, interests, and learning style in one intelligent matching system.
- 🚀 Next.js 16 App Router for server-side rendering, routing, and API endpoints with Server Components
- ⚛️ React 19 for building interactive user interfaces with reusable components
- 🔑 Clerk for secure authentication with Passkeys, Github, and Google Sign-in
- 🎨 ShadcN UI for accessible, customizable React components with Radix UI primitives
- 💾 PostgreSQL for reliable database storage of users, communities, goals, and conversations
- 🗄️ Drizzle ORM for type-safe database queries and migrations
- 📜 TypeScript for static typing and enhanced development experience
- 💅 TailwindCSS 4 for utility-first, responsive styling
- ✅ Zod for schema validation and form handling
- 🤖 Gemini/OpenAI GPT-4o-mini for AI-powered matching and conversation summaries
- ⚡ Hono for lightweight, fast API endpoints
- 🔄 TanStack React Query for efficient server state management
- 🤝 AI-powered semantic matching that understands learning goals beyond keywords
- 🎯 Community-based learning with goal tracking and progress management
- 💬 Real-time chat with learning partners in dedicated conversations
- 📊 AI-generated conversation summaries with action items and next steps
- 🔒 Secure authentication and protected routes
- 👨💼 Subscription tier management (FREE and PRO plans)
- 📱 Responsive design optimized for mobile and desktop
- 🔔 Real-time toast notifications for updates and actions
- 🌓 Dark/light theme support
- ✨ Smooth animations with Motion (Framer Motion)
- 🚀 Production-ready deployment
- 📈 Performance optimizations with batch queries and caching
- 🔍 Intelligent duplicate prevention and match optimization
- 🏷️ Tag-based goal categorization and filtering
To get started with this project:
- Fork the repo
- Copy the
.env.examplevariables into a separate.env.localfile - Create the required credentials:
- Clerk authentication keys
- PostgreSQL database connection string
- OpenAI or Gemini API key
- Click the "Fork" button in the top right corner of this repository to create your own copy
- Clone your forked repository to your local machine
- Install dependencies with
npm install - Set up your environment variables in
.env.local - Run database migrations with
npm db:push - Seed the database with
npm db:seed - Run the development server with
npm dev
Create a .env.local file in the root directory:
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/Learnly
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
CLERK_WEBHOOK_SECRET=whsec_...
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
# OpenAI or Gemini for AI Features
OPENAI_API_KEY=sk-...The application follows a modern full-stack architecture:
- Frontend: Server-first with Next.js App Router, client components only where needed
- API Layer: Hono framework (app/api/[[...route]]/route.ts) for lightweight, fast API
- Database: PostgreSQL with Drizzle ORM (db/schema.ts) for type-safe queries
- Authentication: Clerk handles all auth, session management, and user synchronization
- AI Services: Vercel AI SDK with OpenAI GPT-4o-mini or Gemini for matching and summaries
- State Management: React Query for server state, React hooks for local state
/api/communities/*- Community management and discovery/api/matches/*- AI-powered and manual matching system/api/conversations/*- Chat, messaging, and AI summaries/api/user/*- User profile and subscription management
All routes use Clerk authentication middleware and Hono error handling.
The AI matching system uses GPT-4o-mini or Gemini to analyze learning goals and find compatible partners:
- Understands goals beyond keyword matching (e.g., "React basics" matches with "React Hooks deep dive")
- Evaluates topic similarity, complementary skills, and learning styles
- Creates up to 3 curated matches per request
- Filters out existing matches to prevent duplicates
-
Clerk for authentication and for kindly sponsoring this build
-
PostgreSQL for the database
-
Drizzle ORM for type-safe database operations
-
OpenAI for AI-powered features
-
Zod for TypeScript runtime validations
-
ShadcN UI for components
-
Next.js for the amazing framework
-
Hono for the lightweight API framework
-
TanStack Query for data fetching
- Ensure PostgreSQL is running:
psql -U postgres -c "SELECT 1" - Check DATABASE_URL format:
postgresql://user:password@host:port/database - Verify user permissions for database operations
- Verify all Clerk environment variables are set correctly
- Ensure your Clerk account is properly configured
- User sync happens automatically through Clerk middleware
- Verify GEMINI OR OPENAI_API_KEY is valid and has credits
- Check API rate limits if getting 429 errors
- Review console logs for detailed error messages
- Real-time messaging with WebSockets or Server-Sent Events
- Video call integration for learning sessions
- Calendar integration for scheduled learning sessions
- Progress tracking and analytics dashboard
- Mobile app (React Native)
- Community recommendation system based on interests
- Gamification (badges, streaks, achievements)
- Public profile pages
- Payment integration for Pro tier subscriptions
- Email notifications for new matches and messages
