A next-generation learning experience platform (LXP) that transforms students into researchers through challenge-based learning, distributed research, and collaborative knowledge building.
Unlike traditional course-based LMS platforms, NextGen LMS is designed as a distributed research and knowledge platform that:
- Starts with real problems: Challenge-based learning with scientific problems from beginner to frontier research
- Builds knowledge networks: Graph-based organization instead of linear courses
- Enables collaboration: Real-time editing, team research, and peer review
- Motivates through gamification: XP, badges, streaks, and leaderboards
- Supports hybrid learning: Online-Merge-Offline (OMO) with events and mentor sessions
- Ensures long-term retention: Spaced repetition micro-learning system
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 15.1.0 | React framework with App Router & Turbopack |
| TypeScript | 5.7.2 | Type-safe development (strict mode) |
| Tailwind CSS | 3.4.16 | Utility-first styling |
| shadcn/ui | - | Radix UI-based components |
| Tiptap | 2.11.0 | Rich text editor with 14+ extensions |
| @xyflow/react | 12.3.0 | Knowledge graph visualization |
| KaTeX | 0.16.11 | Math rendering |
| Lucide React | 0.468.0 | Icons |
| Technology | Version | Purpose |
|---|---|---|
| Convex | 1.29.3 | Real-time database, auth, functions |
| @convex-dev/auth | 0.0.90 | Authentication with OAuth providers |
Note: This project was migrated from Supabase to Convex. Legacy Supabase files remain in the repository for reference but are deprecated.
| Technology | Version | Purpose |
|---|---|---|
| Vercel AI SDK | 4.0.0 | AI integration framework |
| Zustand | 5.0.2 | State management |
| Zod | 3.24.0 | Schema validation |
- Challenge-Based Learning: Scientific problems with 5 difficulty levels (beginner → frontier)
- Gamification System: XP, levels (1 per 1000 XP), 15+ badge types, streaks, leaderboards
- Research Nodes: 8 types (hypothesis, experiment, data, analysis, synthesis, literature, note, question)
- Knowledge Graph Foundation: Bidirectional links with 8+ link types
- Version Control: Node versions with snapshots, change tracking, diff support
- Publication Workflow: Draft → Submit → Review → Publish
- Peer Review System: Review assignments, notes, scores, AI review results
- Real-time Collaboration: Editing sessions, cursor tracking via Convex real-time
- AI Research Copilot: Conflict detection, similar research discovery, methodology suggestions
- Vector Search: pgvector embeddings for semantic search
- Events Management: 11 event types, 4 delivery modes, QR check-in, capacity management
- Mentor System: Availability slots, student-mentor booking, session scheduling
- Micro-learning: 9 unit types, SM-2 spaced repetition, mastery levels, learning paths
- Visual Knowledge Graph: Interactive React Flow visualization with d3-force layout
- Enhanced Graph: Semantic edges, strength metrics, graph traversal functions
- i18n Infrastructure: Multi-language support (en/zh)
- Theme System: Technical Minimalism design with dark mode
- Node.js 18+
- npm or yarn
- Convex account (https://convex.dev)
- Clone the repository:
git clone https://github.com/openwisdomlab/lms.git
cd lms- Install dependencies:
npm install- Set up environment variables:
cp .env.local.example .env.localEdit .env.local with your credentials:
# Convex (Required)
NEXT_PUBLIC_CONVEX_URL=your_convex_deployment_url
CONVEX_DEPLOY_KEY=your_convex_deploy_key
# OAuth (Optional)
AUTH_GITHUB_ID=your_github_client_id
AUTH_GITHUB_SECRET=your_github_client_secret
# OpenAI (for AI features)
OPENAI_API_KEY=your_openai_api_key
NEXT_PUBLIC_APP_URL=http://localhost:3000-
Set up Convex:
- Create a new Convex project at https://dashboard.convex.dev
- Run
npx convex devto initialize and sync the schema - The schema is defined in
convex/schema.ts
-
Run the development server:
npm run devOpen http://localhost:3000 to see the app.
| Command | Description |
|---|---|
npm run dev |
Start development server (Turbopack) |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
lms/
├── convex/ # Convex backend (PRIMARY)
│ ├── schema.ts # Database schema definition
│ ├── profiles.ts # User profile functions
│ ├── challenges.ts # Challenge functions
│ ├── researchNodes.ts # Research node functions
│ ├── knowledgeGraph.ts # Knowledge graph functions
│ ├── gamification.ts # XP, badges, progress
│ ├── collaboration.ts # Teams & real-time collaboration
│ ├── events.ts # OMO events management
│ ├── microlearning.ts # Learning units & paths
│ ├── auth.ts # Authentication config
│ └── http.ts # HTTP routes for auth
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── [locale]/(lab)/ # Authenticated routes (route group)
│ │ │ ├── layout.tsx # Lab layout with sidebar
│ │ │ ├── page.tsx # Mission Control dashboard
│ │ │ ├── missions/ # Challenge Hub
│ │ │ ├── workspace/ # Research workspace
│ │ │ ├── knowledge/ # Knowledge base & graph
│ │ │ ├── teams/ # Team collaboration
│ │ │ ├── events/ # OMO events management
│ │ │ ├── learn/ # Micro-learning interface
│ │ │ └── research/[nodeId]/ # Research node editor
│ │ ├── [locale]/page.tsx # Public landing page
│ │ └── [locale]/layout.tsx # Locale layout with providers
│ ├── components/
│ │ ├── editor/ # Tiptap editor system
│ │ ├── ui/ # shadcn/ui components (17+)
│ │ ├── layout/ # Header, sidebar, panels
│ │ ├── providers/ # React providers (Convex, Theme)
│ │ ├── research/ # Collaboration components
│ │ ├── knowledge/ # Knowledge graph visualization
│ │ └── events/ # Event management UI
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities and configs
│ │ └── utils.ts # Utility functions (cn, etc.)
│ └── types/ # TypeScript definitions
│ ├── database.ts # v1 base types (legacy reference)
│ ├── database-v2.ts # v2 Git-Lite types
│ └── database-v3.ts # v3 OMO/Micro-learning types
├── supabase/ # [DEPRECATED] Legacy SQL schemas
├── public/ # Static assets
└── docs/ # Documentation
- Intelligent Writing Assistant: Context-aware suggestions while editing research nodes
- Automated Literature Review: AI-powered paper summarization and relevance scoring
- Research Gap Detection: Identify unexplored areas based on knowledge graph analysis
- Hypothesis Generation: AI-assisted hypothesis formulation from existing data
- Citation Recommendation: Smart citation suggestions based on content
- Cross-Team Research Networks: Connect research across multiple teams
- Research Lineage Tracking: Visual ancestry of forked/evolved research
- Conflict Resolution Workflow: Structured process for resolving contradicting findings
- External Collaboration: Invite external researchers with limited access
- Research Milestone Tracking: Goal-based progress visualization
- Learning Analytics Dashboard: Comprehensive progress visualization
- Research Impact Metrics: Citation counts, influence scores, contribution graphs
- Team Performance Analytics: Collaboration health indicators
- Knowledge Graph Analytics: Centrality, clustering, gap analysis
- Personalized Learning Recommendations: AI-driven content suggestions
- Mobile Application: React Native app for learning on-the-go
- API for External Integrations: REST/GraphQL API for third-party tools
- Plugin System: Extensible architecture for custom extensions
- Multi-tenant Support: Organization-level deployments
- Advanced Export: Export research to LaTeX, academic formats
- Public Research Repository: Share research publicly with DOI assignment
- Peer Review Marketplace: Cross-organization peer review system
- Research Funding Integration: Connect with funding bodies
- Academic Institution Integration: LTI support for university systems
- Research Conferences: Virtual conference hosting within platform
- Blockchain-based research verification
- AR/VR lab simulations
- Real-time collaborative experimentation
- Integration with scientific instruments/IoT
- Components: PascalCase (
ScienceEditor.tsx) - Utilities/hooks: kebab-case (
use-research-copilot.ts) - Types: kebab-case (
database-v2.ts)
// Client Component with Convex (most common pattern)
"use client"
import { useQuery, useMutation } from "convex/react";
import { api } from "@/convex/_generated/api";
export function ResearchNodeViewer({ nodeId }: { nodeId: Id<"researchNodes"> }) {
// Data automatically updates in real-time
const node = useQuery(api.researchNodes.getById, { id: nodeId });
const updateNode = useMutation(api.researchNodes.update);
if (!node) return <Loading />;
return <div>{node.title}</div>
}
// Server Component (for static content)
export default async function StaticPage() {
return <div>{/* static content */}</div>
}These rules ensure development consistency across all contributors.
- Server Components by default: Only use
"use client"when client-side interactivity is required - Colocate related files: Keep component, types, and tests together
- Use path aliases: Always use
@/*for imports fromsrc/ - Feature folders: Group related components in feature directories
- Schema definition: Add new tables to
convex/schema.ts - Define indexes: Add indexes in table definitions for efficient queries
- Authorization: Add function-level auth checks in Convex functions
- Types auto-generated: Types are automatically generated by Convex in
convex/_generated/
- Tailwind utilities only: No custom CSS unless absolutely necessary
- Use CSS variables: For theming and dark mode support
- Use
cn()utility: For conditional class composition - Consistent spacing: Follow Tailwind's spacing scale (4, 8, 12, 16, etc.)
- Never commit secrets: Use
.env.localfor sensitive values - Validate all input: Use Zod schemas for user input validation
- Convex validators: Use Convex's built-in argument validators in functions
- Check permissions: Verify user authorization with
ctx.auth.getUserIdentity()
- Conventional commits:
feat:,fix:,docs:,refactor:,test: - Branch naming:
feature/description,fix/description,claude/description-sessionid - PR requirements: All PRs need description, test plan, and review
- Test critical paths: Auth flows, data mutations, complex calculations
- Mock external services: Convex, OpenAI calls should be mocked
- Component testing: Use React Testing Library for UI tests
- Lazy load heavy components: Use
dynamic()for knowledge graph, editor - Optimize images: Use Next.js Image component
- Minimize client bundles: Keep client components small
- Cache API responses: Use React Query or SWR patterns
The Tiptap-based Science Editor has specific patterns:
// Adding a new extension
// 1. Create extension in src/components/editor/extensions/
// 2. Register in science-editor.tsx extensions array
// 3. Add slash command if applicable
// 4. Create node-view if custom rendering needed// Adding a new table in convex/schema.ts:
export const newTable = defineTable({
field1: v.string(),
field2: v.number(),
userId: v.id("profiles"),
})
.index("by_user", ["userId"]) // Add indexes for queries
.searchIndex("search_field", { // Optional: search index
searchField: "field1",
});
// Create functions in convex/newTable.ts
// with authorization checks using ctx.authContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Follow development guidelines above
- Commit your changes:
git commit -m 'feat: add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Code follows project conventions
- TypeScript types generated via
npx convex dev - Authorization checks added in Convex functions (if new tables)
- Tests added/updated
- Documentation updated
-
npm run lintpasses
MIT License - see LICENSE for details.
- Next.js - React framework
- Convex - Real-time backend platform
- Tiptap - Rich text editor
- shadcn/ui - UI components
- React Flow - Graph visualization
Built with care by OpenWisdomLab