Skip to content

openwisdomlab/lms

Repository files navigation

NextGen LMS - Distributed Research & Learning Platform

Version License Status Next.js TypeScript

A next-generation learning experience platform (LXP) that transforms students into researchers through challenge-based learning, distributed research, and collaborative knowledge building.

Getting Started | Features | Roadmap | Contributing


Overview

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

Tech Stack

Frontend

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

Backend & Database

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.

AI & State Management

Technology Version Purpose
Vercel AI SDK 4.0.0 AI integration framework
Zustand 5.0.2 State management
Zod 3.24.0 Schema validation

Implemented Features

Phase 1: Core LMS Foundation

  • 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

Phase 2: Git-Lite Versioning & Scientific Workbench

  • 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

Phase 3: OMO (Online-Merge-Offline) & Micro-learning

  • 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

Phase 4: Git for Science & Knowledge Graph Visualization

  • 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

Getting Started

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/openwisdomlab/lms.git
cd lms
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.local.example .env.local

Edit .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
  1. Set up Convex:

    • Create a new Convex project at https://dashboard.convex.dev
    • Run npx convex dev to initialize and sync the schema
    • The schema is defined in convex/schema.ts
  2. Run the development server:

npm run dev

Open http://localhost:3000 to see the app.

Available Scripts

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

Project Structure

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

Roadmap

Phase 5: AI-Powered Research Assistant (Q1 2025)

  • 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

Phase 6: Advanced Collaboration (Q1-Q2 2025)

  • 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

Phase 7: Analytics & Insights (Q2 2025)

  • 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

Phase 8: Platform Expansion (Q2-Q3 2025)

  • 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

Phase 9: Community & Scale (Q3 2025)

  • 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

Future Considerations

  • Blockchain-based research verification
  • AR/VR lab simulations
  • Real-time collaborative experimentation
  • Integration with scientific instruments/IoT

Development Guidelines

Code Conventions

File Naming

  • Components: PascalCase (ScienceEditor.tsx)
  • Utilities/hooks: kebab-case (use-research-copilot.ts)
  • Types: kebab-case (database-v2.ts)

Component Structure

// 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>
}

System Rules

These rules ensure development consistency across all contributors.

1. Architecture Rules

  • 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 from src/
  • Feature folders: Group related components in feature directories

2. Database Rules

  • 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/

3. Styling Rules

  • 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.)

4. API & Security Rules

  • Never commit secrets: Use .env.local for 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()

5. Git Workflow Rules

  • 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

6. Testing Rules

  • 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

7. Performance Rules

  • 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

Editor Development

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

Database Schema Changes

// 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.auth

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Follow development guidelines above
  4. Commit your changes: git commit -m 'feat: add amazing feature'
  5. Push to the branch: git push origin feature/amazing-feature
  6. Open a Pull Request

PR Checklist

  • 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 lint passes

License

MIT License - see LICENSE for details.


Acknowledgments


Built with care by OpenWisdomLab

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •