feat: new documentation

This commit is contained in:
swve
2026-03-14 12:39:57 +01:00
parent c6ffd76538
commit c0d8d90ec4
168 changed files with 11830 additions and 11996 deletions

View File

@@ -1,16 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
labels:
- "dependencies"
- "npm"
reviewers:
- "swve"
schedule:
interval: "monthly"

BIN
.github/images/learnhouse-github.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

58
README.md Normal file
View File

@@ -0,0 +1,58 @@
<p align="center">
<a href="https://docs.learnhouse.app">
<img alt="LearnHouse" src=".github/images/learnhouse-github.png" width="600" />
</a>
</p>
<p align="center">
<strong>LearnHouse Documentation</strong>
</p>
<p align="center">
Official documentation for <a href="https://learnhouse.app">LearnHouse</a>, the open-source learning management system.
</p>
<p align="center">
<a href="https://docs.learnhouse.app">docs.learnhouse.app</a>
</p>
---
## Local Development
**Prerequisites:** [Bun](https://bun.sh) installed.
```bash
# Install dependencies
bun install
# Start the dev server
bun dev
```
The site will be available at `http://localhost:3000`.
## Project Structure
```
content/ # MDX documentation pages
getting-started/
platform/
self-hosting/
developers/
enterprise/
app/ # Next.js App Router
components/ # React components
public/ # Static assets
scripts/ # Build scripts
```
## Built With
- [Next.js](https://nextjs.org)
- [Nextra](https://nextra.site)
- [Tailwind CSS](https://tailwindcss.com)
## License
MIT - see [LICENSE](LICENSE) for details.

View File

@@ -3,10 +3,18 @@ import { useMDXComponents as getMDXComponents } from '../../mdx-components'
export const generateStaticParams = generateStaticParamsFor('mdxPath')
const SITE_URL = 'https://docs.learnhouse.app'
export async function generateMetadata(props) {
const params = await props.params
const { metadata } = await importPage(params.mdxPath)
return metadata
const path = params.mdxPath ? `/${params.mdxPath.join('/')}` : ''
return {
...metadata,
alternates: {
canonical: `${SITE_URL}${path}`,
},
}
}
const Wrapper = getMDXComponents().wrapper
@@ -14,9 +22,33 @@ const Wrapper = getMDXComponents().wrapper
export default async function Page(props) {
const params = await props.params
const { default: MDXContent, toc, metadata } = await importPage(params.mdxPath)
const path = params.mdxPath ? `/${params.mdxPath.join('/')}` : ''
const articleJsonLd = {
'@context': 'https://schema.org',
'@type': 'TechArticle',
headline: metadata.title || 'LearnHouse Docs',
url: `${SITE_URL}${path}`,
publisher: {
'@type': 'Organization',
name: 'LearnHouse',
url: 'https://learnhouse.app',
},
isPartOf: {
'@type': 'WebSite',
url: SITE_URL,
},
}
return (
<Wrapper toc={toc} metadata={metadata}>
<MDXContent {...props} params={params} />
</Wrapper>
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(articleJsonLd) }}
/>
<Wrapper toc={toc} metadata={metadata}>
<MDXContent {...props} params={params} />
</Wrapper>
</>
)
}

View File

@@ -1,28 +1,54 @@
import { Footer, Layout, Navbar } from 'nextra-theme-docs'
import { Layout } from 'nextra-theme-docs'
import { Head } from 'nextra/components'
import { getPageMap } from 'nextra/page-map'
import 'nextra-theme-docs/style.css'
import '../styles.css'
import { Analytics } from '@vercel/analytics/react'
import Logo from '../components/Logo/Logo'
import CustomNavbar from '../components/Navbar/Navbar'
import CustomFooter from '../components/Footer/Footer'
import PostHogProvider from '../components/Analytics/PostHogProvider'
export const metadata = {
title: {
default: 'LearnHouse Docs',
template: '%s – LearnHouse Docs',
},
description: 'The next-gen open source learning software',
description:
'Official documentation for LearnHouse, the open-source learning management system (LMS). Guides for self-hosting, course creation, AI features, API reference, and more.',
keywords: [
'LearnHouse',
'open source LMS',
'learning management system',
'self-hosted LMS',
'course creation',
'LearnHouse documentation',
'LearnHouse docs',
],
metadataBase: new URL('https://docs.learnhouse.app'),
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
'max-video-preview': -1,
'max-image-preview': 'large',
'max-snippet': -1,
},
},
openGraph: {
type: 'website',
locale: 'en_US',
url: 'https://docs.learnhouse.app',
siteName: 'LearnHouse Docs',
description:
'Official documentation for LearnHouse, the open-source learning management system (LMS). Guides for self-hosting, course creation, AI features, API reference, and more.',
images: [
{
url: 'https://docs.learnhouse.app/img/og.png',
url: 'https://docs.learnhouse.app/img/pages/learnhouse-github.png',
alt: 'LearnHouse Docs',
width: 1512,
height: 687,
width: 2051,
height: 1016,
},
],
},
@@ -41,23 +67,49 @@ export const metadata = {
manifest: '/favicons/site.webmanifest',
}
const navbar = <Navbar logo={<Logo />} projectLink="https://github.com/learnhouse/learnhouse" chatLink="https://discord.gg/CMyZjjYZ6x" />
const footer = <Footer>MIT {new Date().getFullYear()} © LearnHouse.</Footer>
const websiteJsonLd = {
'@context': 'https://schema.org',
'@type': 'WebSite',
name: 'LearnHouse Documentation',
url: 'https://docs.learnhouse.app',
publisher: {
'@type': 'Organization',
name: 'LearnHouse',
url: 'https://learnhouse.app',
},
}
export default async function RootLayout({ children }) {
return (
<html lang="en" dir="ltr" suppressHydrationWarning>
<Head />
<Head faviconGlyph="">
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Wix+Madefor+Text:ital,wght@0,400..700;1,400..700&display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Wix+Madefor+Display:wght@600;700;800;900&display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Zilla+Slab:wght@400;500;600;700&display=swap" rel="stylesheet" />
</Head>
<body>
<Layout
navbar={navbar}
footer={footer}
pageMap={await getPageMap()}
docsRepositoryBase="https://github.com/learnhouse/docs/tree/main"
sidebar={{ defaultMenuCollapseLevel: 2 }}
>
{children}
</Layout>
<script dangerouslySetInnerHTML={{ __html: `document.documentElement.classList.remove('dark');document.documentElement.classList.add('light');document.documentElement.style.colorScheme='light';localStorage.setItem('theme','light');` }} />
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(websiteJsonLd) }}
/>
<PostHogProvider>
<CustomNavbar />
<Layout
pageMap={await getPageMap()}
docsRepositoryBase="https://github.com/learnhouse/docs/tree/main"
sidebar={{ defaultMenuCollapseLevel: 2 }}
editLink="Edit this page on GitHub"
footer={<></>}
navbar={<></>}
>
{children}
</Layout>
<CustomFooter />
</PostHogProvider>
<Analytics />
</body>
</html>

1227
bun.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,47 @@
'use client'
import posthog from 'posthog-js'
import { PostHogProvider as PHProvider, usePostHog } from 'posthog-js/react'
import { usePathname, useSearchParams } from 'next/navigation'
import { useEffect, Suspense } from 'react'
if (typeof window !== 'undefined' && process.env.NEXT_PUBLIC_POSTHOG_KEY) {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST || 'https://us.i.posthog.com',
capture_pageview: false,
capture_pageleave: true,
})
}
function PostHogPageView() {
const pathname = usePathname()
const searchParams = useSearchParams()
const posthog = usePostHog()
useEffect(() => {
if (pathname && posthog) {
let url = window.origin + pathname
if (searchParams.toString()) {
url = url + '?' + searchParams.toString()
}
posthog.capture('$pageview', { $current_url: url })
}
}, [pathname, searchParams, posthog])
return null
}
export default function PostHogProvider({ children }) {
if (!process.env.NEXT_PUBLIC_POSTHOG_KEY) {
return children
}
return (
<PHProvider client={posthog}>
<Suspense fallback={null}>
<PostHogPageView />
</Suspense>
{children}
</PHProvider>
)
}

View File

@@ -0,0 +1,159 @@
'use client'
import { ReactFlow, Background, MarkerType } from '@xyflow/react'
import '@xyflow/react/dist/style.css'
import {
SiNextdotjs,
SiFastapi,
SiPostgresql,
SiRedis,
SiStripe,
SiGooglegemini,
SiSentry,
SiUnsplash,
} from '@icons-pack/react-simple-icons'
import {
Users,
PencilSimple,
HardDrives,
Envelope,
Terminal,
Key,
ChartBar,
} from '@phosphor-icons/react/dist/ssr'
const nodeDefaults = {
draggable: false,
connectable: false,
selectable: false,
}
function NodeLabel({ icon, label, sub }) {
return (
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<span style={{ flexShrink: 0, display: 'flex' }}>{icon}</span>
<div style={{ textAlign: 'left' }}>
<div style={{ fontSize: 12, fontWeight: 600, color: '#1a1a1a', lineHeight: 1.3 }}>{label}</div>
{sub && <div style={{ fontSize: 9.5, color: '#6b7280', lineHeight: 1.3 }}>{sub}</div>}
</div>
</div>
)
}
const makeNode = (id, icon, label, sub, x, y, bg, border, width = 155) => ({
id,
position: { x, y },
data: { label: <NodeLabel icon={icon} label={label} sub={sub} /> },
style: {
background: bg,
border: `1px solid ${border}`,
borderRadius: 12,
padding: '10px 14px',
width,
},
...nodeDefaults,
})
const nodes = [
// Row 0 — Users
makeNode('users', <Users size={16} weight="fill" color="#6366f1" />, 'Users', 'Browser', 265, 0, '#f0f4ff', '#c7d2fe'),
// Row 1 — Core apps
makeNode('web', <SiNextdotjs size={14} color="#000" />, 'Web', 'Next.js 16', 30, 120, '#e0f2fe', '#93c5fd'),
makeNode('api', <SiFastapi size={14} color="#009688" />, 'API', 'FastAPI', 265, 120, '#dcfce7', '#86efac'),
makeNode('collab', <PencilSimple size={14} weight="fill" color="#db2777" />, 'Collab', 'Hocuspocus', 500, 120, '#fce7f3', '#f9a8d4'),
// Row 2 — Data layer
makeNode('pg', <SiPostgresql size={14} color="#4169E1" />, 'PostgreSQL', 'pgvector', 145, 260, '#f3e8ff', '#c4b5fd'),
makeNode('redis', <SiRedis size={14} color="#DC382D" />, 'Redis', 'Cache & Sessions', 385, 260, '#fef9c3', '#fde047'),
// Row 3 — External services (API)
makeNode('gemini', <SiGooglegemini size={13} color="#8E75B2" />, 'Google Gemini', 'AI & RAG', 0, 400, '#ecfdf5', '#6ee7b7', 145),
makeNode('s3', <HardDrives size={14} weight="fill" color="#E25D10" />, 'S3 Storage', 'Media files', 165, 400, '#fff7ed', '#fdba74', 145),
makeNode('stripe', <SiStripe size={13} color="#635BFF" />, 'Stripe', 'Payments', 330, 400, '#eef2ff', '#a5b4fc', 145),
makeNode('email', <Envelope size={14} weight="fill" color="#EF4444" />, 'Email', 'Resend / SMTP', 495, 400, '#fef2f2', '#fca5a5', 145),
// Row 4 — More services
makeNode('judge0', <Terminal size={14} weight="fill" color="#16A34A" />, 'Judge0', 'Code execution', 0, 490, '#f0fdf4', '#86efac', 145),
makeNode('workos', <Key size={14} weight="fill" color="#7C3AED" />, 'WorkOS', 'Enterprise SSO', 165, 490, '#fdf4ff', '#d8b4fe', 145),
makeNode('sentry', <SiSentry size={13} color="#362D59" />, 'Sentry', 'Error tracking', 330, 490, '#faf5ff', '#c4b5fd', 145),
makeNode('tinybird', <ChartBar size={14} weight="fill" color="#0d9488" />, 'Tinybird', 'Analytics', 495, 490, '#f0fdfa', '#5eead4', 145),
// Web → Unsplash
makeNode('unsplash', <SiUnsplash size={12} color="#000" />, 'Unsplash', 'Stock images', 30, 260, '#f5f5f4', '#d6d3d1', 105),
]
const solid = {
type: 'default',
style: { stroke: '#94a3b8', strokeWidth: 1.5 },
markerEnd: { type: MarkerType.ArrowClosed, color: '#94a3b8', width: 14, height: 14 },
}
const dashed = {
type: 'default',
style: { stroke: '#cbd5e1', strokeWidth: 1.2, strokeDasharray: '5 4' },
markerEnd: { type: MarkerType.ArrowClosed, color: '#cbd5e1', width: 12, height: 12 },
}
const edges = [
// Users → Core apps
{ id: 'u-web', source: 'users', target: 'web', label: 'HTTP', ...solid },
{ id: 'u-api', source: 'users', target: 'api', label: 'REST', ...solid },
{ id: 'u-collab', source: 'users', target: 'collab', label: 'WebSocket', ...solid },
// Inter-app
{ id: 'web-api', source: 'web', target: 'api', label: 'SSR', ...solid },
{ id: 'collab-api', source: 'collab', target: 'api', label: 'Persist', ...solid },
// Data stores
{ id: 'api-pg', source: 'api', target: 'pg', ...solid },
{ id: 'api-redis', source: 'api', target: 'redis', ...solid },
{ id: 'collab-redis', source: 'collab', target: 'redis', label: 'Cache', ...solid },
// API → External
{ id: 'api-gemini', source: 'api', target: 'gemini', ...dashed },
{ id: 'api-s3', source: 'api', target: 's3', ...dashed },
{ id: 'api-stripe', source: 'api', target: 'stripe', ...dashed },
{ id: 'api-email', source: 'api', target: 'email', ...dashed },
{ id: 'api-judge0', source: 'api', target: 'judge0', ...dashed },
{ id: 'api-workos', source: 'api', target: 'workos', ...dashed },
{ id: 'api-sentry', source: 'api', target: 'sentry', ...dashed },
{ id: 'api-tinybird', source: 'api', target: 'tinybird', ...dashed },
// Web → External
{ id: 'web-unsplash', source: 'web', target: 'unsplash', ...dashed },
{ id: 'web-sentry', source: 'web', target: 'sentry', ...dashed },
]
export default function ArchitectureDiagram() {
return (
<div style={{
border: '1px solid #e5e7eb',
borderRadius: 16,
overflow: 'hidden',
background: '#fafafa',
margin: '24px 0',
height: 620,
}}>
<ReactFlow
nodes={nodes}
edges={edges}
fitView
fitViewOptions={{ padding: 0.12 }}
panOnDrag={false}
zoomOnScroll={false}
zoomOnPinch={false}
zoomOnDoubleClick={false}
preventScrolling={false}
nodesDraggable={false}
nodesConnectable={false}
elementsSelectable={false}
proOptions={{ hideAttribution: true }}
>
<Background color="#e5e7eb" gap={20} size={1} />
</ReactFlow>
</div>
)
}

View File

@@ -0,0 +1,56 @@
'use client'
import { useState, useRef, useCallback } from 'react'
function CopyButton({ getText }) {
const [copied, setCopied] = useState(false)
const handleCopy = useCallback(async () => {
const text = getText()
if (!text) return
try {
await navigator.clipboard.writeText(text)
setCopied(true)
setTimeout(() => setCopied(false), 2000)
} catch {}
}, [getText])
return (
<button className="lh-code-copy" onClick={handleCopy} aria-label="Copy code">
{copied ? (
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
<polyline points="20 6 9 17 4 12" />
</svg>
) : (
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" />
</svg>
)}
</button>
)
}
export default function CodeBlock({ children, 'data-filename': filename, 'data-language': language, ...props }) {
const codeRef = useRef(null)
const getText = useCallback(() => {
if (!codeRef.current) return ''
return codeRef.current.textContent || ''
}, [])
return (
<div className="lh-code-block">
{filename && (
<div className="lh-code-header">
<span className="lh-code-filename">{filename}</span>
<CopyButton getText={getText} />
</div>
)}
<div className="lh-code-body" ref={codeRef}>
{!filename && <CopyButton getText={getText} />}
<pre>{children}</pre>
</div>
</div>
)
}

View File

@@ -0,0 +1,125 @@
'use client'
import Link from 'next/link'
import {
PencilSimple,
Brain,
UsersThree,
BookOpen,
ClipboardText,
Terminal,
ChatCircle,
ChalkboardSimple,
Microphone,
Certificate,
ChartBar,
CreditCard,
Buildings,
ShieldCheck,
MagnifyingGlass,
} from '@phosphor-icons/react/dist/ssr'
const features = [
// Row 1 — hero features (large)
{ icon: PencilSimple, label: 'Block Editor', desc: 'Notion-like WYSIWYG editor with rich content blocks, videos, documents, and embeds', color: '#3b82f6', size: 'large', href: '/platform/editor' },
{ icon: Brain, label: 'AI Tutoring', desc: 'Built-in AI assistant for students and teachers with RAG-powered context', color: '#a855f7', size: 'large', href: '/platform/ai' },
{ icon: UsersThree, label: 'Real-time Collaboration', desc: 'Live co-editing for course content and boards powered by Hocuspocus', color: '#ec4899', size: 'large', href: '/platform/editor/collaboration' },
// Row 2+ — standard features
{ icon: BookOpen, label: 'Courses & Trails', desc: 'Chapters, activities, collections, and learning paths', color: '#10b981', href: '/platform/courses' },
{ icon: ClipboardText, label: 'Assignments', desc: 'Automated and manual grading', color: '#f59e0b', href: '/platform/assignments' },
{ icon: Terminal, label: 'Code Execution', desc: 'Run code in 7+ languages', color: '#8b5cf6', href: '/platform/code-execution' },
{ icon: ChatCircle, label: 'Discussions', desc: 'Threaded conversations', color: '#f43f5e', href: '/platform/discussions' },
{ icon: ChalkboardSimple, label: 'Boards', desc: 'Collaborative whiteboards', color: '#f97316', href: '/platform/boards' },
{ icon: Microphone, label: 'Podcasts', desc: 'Audio content and episodes', color: '#ec4899', href: '/platform/podcasts' },
{ icon: Certificate, label: 'Certifications', desc: 'Auto-generate on completion', color: '#14b8a6', href: '/platform/certifications' },
{ icon: ChartBar, label: 'Analytics', desc: 'Track progress and engagement', color: '#d97706', href: '/platform/analytics' },
{ icon: CreditCard, label: 'Payments', desc: 'Sell courses with Stripe', color: '#6366f1', href: '/platform/payments' },
{ icon: Buildings, label: 'Multi-tenancy', desc: 'Multiple organizations', color: '#0891b2', href: '/platform/organizations/multi-tenancy' },
{ icon: ShieldCheck, label: 'Enterprise SSO', desc: 'WorkOS SAML/OIDC', color: '#475569', href: '/platform/users/authentication' },
{ icon: MagnifyingGlass, label: 'Search', desc: 'Full-text search', color: '#737373', href: '/platform/search' },
]
function FeatureCard({ icon: Icon, label, color, desc, large, href }) {
return (
<Link
href={href}
style={{
padding: large ? '24px 26px' : '18px 20px',
borderRadius: 16,
background: '#fff',
overflow: 'hidden',
position: 'relative',
display: 'flex',
flexDirection: 'column',
gap: large ? 14 : 10,
boxShadow: '0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03)',
textDecoration: 'none',
transition: 'transform 0.15s ease, box-shadow 0.15s ease',
}}
onMouseEnter={e => { e.currentTarget.style.transform = 'scale(1.02)'; e.currentTarget.style.boxShadow = '0 4px 16px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04)' }}
onMouseLeave={e => { e.currentTarget.style.transform = 'scale(1)'; e.currentTarget.style.boxShadow = '0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03)' }}
>
{/* Dot pattern */}
<div
style={{
position: 'absolute',
inset: 0,
pointerEvents: 'none',
opacity: 1,
backgroundImage: `radial-gradient(${color}30 1px, transparent 1px)`,
backgroundSize: '14px 14px',
maskImage: 'linear-gradient(to bottom, black 0%, transparent 50%)',
WebkitMaskImage: 'linear-gradient(to bottom, black 0%, transparent 50%)',
}}
/>
<div
style={{
width: large ? 40 : 34,
height: large ? 40 : 34,
borderRadius: large ? 12 : 10,
background: color + '10',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0,
}}
>
<Icon size={large ? 20 : 17} weight="duotone" style={{ color }} />
</div>
<div>
<div style={{ fontSize: large ? 15 : 13, fontWeight: 650, color: '#1a1a1a', lineHeight: 1.3, margin: 0 }}>
{label}
</div>
<div style={{ fontSize: large ? 13 : 11.5, color: '#9ca3af', lineHeight: 1.45, margin: 0, marginTop: 3 }}>
{desc}
</div>
</div>
</Link>
)
}
export default function FeaturesGrid() {
const heroFeatures = features.filter(f => f.size === 'large')
const standardFeatures = features.filter(f => !f.size)
return (
<div style={{ margin: '24px 0', display: 'flex', flexDirection: 'column', gap: 10 }}>
{/* Hero row — 3 large cards */}
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 10 }}>
{heroFeatures.map(f => (
<FeatureCard key={f.label} {...f} large />
))}
</div>
{/* Standard features — compact bento grid */}
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 10 }}>
{standardFeatures.map(f => (
<FeatureCard key={f.label} {...f} />
))}
</div>
</div>
)
}

View File

@@ -0,0 +1,36 @@
'use client'
import Link from 'next/link'
const links = [
{ label: 'Documentation', href: '/' },
{ label: 'GitHub', href: 'https://github.com/learnhouse/learnhouse' },
{ label: 'Discord', href: 'https://discord.gg/CMyZjjYZ6x' },
{ label: 'Twitter', href: 'https://twitter.com/learnhouseapp' },
]
export default function Footer() {
return (
<footer className="lh-footer">
<div className="lh-footer-container">
<p className="lh-footer-copyright">
&copy; {new Date().getFullYear()} LearnHouse
</p>
<nav className="lh-footer-nav">
{links.map((link) => {
const isExternal = link.href.startsWith('http')
const Tag = isExternal ? 'a' : Link
const props = isExternal
? { href: link.href, target: '_blank', rel: 'noopener noreferrer' }
: { href: link.href }
return (
<Tag key={link.label} {...props} className="lh-footer-link">
{link.label}
</Tag>
)
})}
</nav>
</div>
</footer>
)
}

View File

@@ -0,0 +1,111 @@
'use client'
import Link from 'next/link'
import {
RocketLaunch,
BookOpen,
Cloud,
Code,
} from '@phosphor-icons/react/dist/ssr'
const cards = [
{
href: '/getting-started',
icon: RocketLaunch,
color: '#6366f1',
title: 'Getting Started',
desc: 'Set up your first organization and course in minutes',
pattern: 'radial-gradient(circle, currentColor 1px, transparent 1px)',
patternSize: '14px 14px',
},
{
href: '/platform',
icon: BookOpen,
color: '#10b981',
title: 'Platform Guide',
desc: 'Courses, editor, AI, assignments, and more',
pattern: 'linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px)',
patternSize: '20px 20px',
},
{
href: '/self-hosting',
icon: Cloud,
color: '#f97316',
title: 'Self Hosting',
desc: 'Deploy on your own infrastructure with the CLI',
pattern: 'repeating-linear-gradient(45deg, currentColor 0px, currentColor 1px, transparent 1px, transparent 8px)',
patternSize: '12px 12px',
},
{
href: '/developers',
icon: Code,
color: '#8b5cf6',
title: 'Developers',
desc: 'Architecture, REST API, and contributing guide',
pattern: 'repeating-linear-gradient(0deg, currentColor 0px, currentColor 1px, transparent 1px, transparent 6px)',
patternSize: '6px 6px',
},
]
export default function HomeCards() {
return (
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 12, margin: '32px 0' }}>
{cards.map((card) => {
const Icon = card.icon
return (
<Link
key={card.href}
href={card.href}
className="nice-shadow"
style={{
display: 'flex', alignItems: 'center', gap: 16,
padding: '22px 24px',
borderRadius: 16,
background: '#fff',
overflow: 'hidden',
position: 'relative',
textDecoration: 'none',
transition: 'transform 0.15s ease',
}}
onMouseEnter={e => e.currentTarget.style.transform = 'scale(1.02)'}
onMouseLeave={e => e.currentTarget.style.transform = 'scale(1)'}
>
{/* Pattern */}
<div
style={{
position: 'absolute', inset: 0,
pointerEvents: 'none',
opacity: 0.05,
color: card.color,
backgroundImage: card.pattern,
backgroundSize: card.patternSize,
maskImage: 'linear-gradient(to right, black 0%, transparent 60%)',
WebkitMaskImage: 'linear-gradient(to right, black 0%, transparent 60%)',
}}
/>
{/* Icon */}
<div
style={{
position: 'relative', zIndex: 1,
flexShrink: 0,
width: 42, height: 42,
borderRadius: 12,
display: 'flex', alignItems: 'center', justifyContent: 'center',
backgroundColor: card.color + '10',
}}
>
<Icon size={20} weight="duotone" style={{ color: card.color }} />
</div>
{/* Text */}
<div style={{ position: 'relative', zIndex: 1, minWidth: 0 }}>
<div style={{ fontSize: 15, fontWeight: 650, color: '#1a1a1a', lineHeight: 1.3, margin: 0 }}>{card.title}</div>
<div style={{ fontSize: 13, color: '#9ca3af', lineHeight: 1.45, margin: 0, marginTop: 3 }}>{card.desc}</div>
</div>
</Link>
)
})}
</div>
)
}

View File

@@ -1,28 +1,11 @@
'use client'
import Image from "next/image";
import React from "react";
function Logo() {
const [colorScheme, setColorScheme] = React.useState("");
React.useEffect(() => {
const rootElement = window.document.documentElement;
const computedStyle = window.getComputedStyle(rootElement);
const colorSchemeValue = computedStyle.getPropertyValue("color-scheme").trim();
setColorScheme(colorSchemeValue);
}, []);
return (
<div>
{colorScheme === "dark" ? (
<Image style={{ paddingTop: 35, paddingBottom: 35, paddingRight: 30 }} width={185} height={35} src="/img/logos/white_logo.png" alt="Dark Logo" />
) : (
<Image style={{ paddingTop: 35, paddingBottom: 35, paddingRight: 30 }} width={185} height={35} src="/img/logos/black_logo.png" alt="Light Logo" />
)}
</div>
);
<img
src="/img/logos/learnhouse-dark.svg"
alt="LearnHouse"
style={{ height: 20, width: 'auto' }}
/>
)
}
export default Logo;
export default Logo

View File

@@ -0,0 +1,167 @@
'use client'
import { useTheme } from 'next-themes'
import { useEffect, useState } from 'react'
import Link from 'next/link'
import { Search } from 'nextra/components'
import { GithubLogo, DiscordLogo, Code, ArrowUpRight, List, X, Plug, Globe, GraduationCap } from '@phosphor-icons/react/dist/ssr'
function Navbar() {
const { resolvedTheme } = useTheme()
const [mounted, setMounted] = useState(false)
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
useEffect(() => setMounted(true), [])
// Close mobile menu on route change
useEffect(() => {
const handleRouteChange = () => setMobileMenuOpen(false)
window.addEventListener('popstate', handleRouteChange)
return () => window.removeEventListener('popstate', handleRouteChange)
}, [])
// Prevent body scroll when mobile menu is open
useEffect(() => {
if (mobileMenuOpen) {
document.body.style.overflow = 'hidden'
} else {
document.body.style.overflow = ''
}
return () => { document.body.style.overflow = '' }
}, [mobileMenuOpen])
const logoSrc = '/img/logos/learnhouse-dark.svg'
return (
<>
<div className="lh-navbar">
<div className="lh-navbar-inner">
{/* Left: logo + nav */}
<div className="lh-navbar-left">
<Link href="/" className="lh-navbar-logo">
{mounted ? (
<img src={logoSrc} alt="LearnHouse" />
) : (
<div style={{ width: 100, height: 20 }} />
)}
</Link>
<span className="lh-navbar-badge -ml-4 mt-[1px] text-[10px] font-bold tracking-wider rounded-[5px] px-1.5 py-[2.5px]" style={{ fontFamily: "'Wix Madefor Display', sans-serif" }}>Docs</span>
<nav className="lh-navbar-nav lh-hide-mobile">
<Link
href="/developers"
className="lh-navbar-nav-item"
>
<Code size={15} weight="fill" />
Developers
</Link>
<a
href="https://university.learnhouse.io"
target="_blank"
rel="noopener noreferrer"
className="lh-navbar-nav-item"
>
<GraduationCap size={15} weight="fill" />
Learn
<ArrowUpRight size={11} weight="bold" />
</a>
<a
href="https://learnhouse.app/integrations"
target="_blank"
rel="noopener noreferrer"
className="lh-navbar-nav-item"
>
<Plug size={15} weight="fill" />
Integrations
<ArrowUpRight size={11} weight="bold" />
</a>
<a
href="https://learnhouse.app"
target="_blank"
rel="noopener noreferrer"
className="lh-navbar-nav-item"
>
<Globe size={15} weight="fill" />
Website
<ArrowUpRight size={11} weight="bold" />
</a>
</nav>
</div>
{/* Right: search + links + hamburger */}
<div className="lh-navbar-right">
<Search className="lh-navbar-search" placeholder="Search docs..." />
<a
href="https://github.com/learnhouse/learnhouse"
target="_blank"
rel="noopener noreferrer"
className="lh-navbar-nav-item lh-hide-mobile"
>
<GithubLogo size={16} weight="fill" />
GitHub
</a>
<a
href="https://discord.gg/CMyZjjYZ6x"
target="_blank"
rel="noopener noreferrer"
className="lh-navbar-nav-item lh-hide-mobile"
>
<DiscordLogo size={16} weight="fill" />
Discord
</a>
{/* Mobile hamburger */}
<button
className="lh-mobile-menu-btn"
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
aria-label={mobileMenuOpen ? 'Close menu' : 'Open menu'}
>
{mobileMenuOpen ? <X size={20} weight="bold" /> : <List size={20} weight="bold" />}
</button>
</div>
</div>
</div>
{/* Mobile menu overlay */}
{mobileMenuOpen && (
<div className="lh-mobile-overlay" onClick={() => setMobileMenuOpen(false)} />
)}
{/* Mobile sidebar drawer */}
<div className={`lh-mobile-drawer ${mobileMenuOpen ? 'lh-mobile-drawer-open' : ''}`}>
<div className="lh-mobile-drawer-links">
<Link href="/developers" className="lh-mobile-drawer-link" onClick={() => setMobileMenuOpen(false)}>
<Code size={16} weight="fill" />
Developers
</Link>
<a href="https://university.learnhouse.io" target="_blank" rel="noopener noreferrer" className="lh-mobile-drawer-link">
<GraduationCap size={16} weight="fill" />
Learn
<ArrowUpRight size={12} weight="bold" />
</a>
<a href="https://learnhouse.app/integrations" target="_blank" rel="noopener noreferrer" className="lh-mobile-drawer-link">
<Plug size={16} weight="fill" />
Integrations
<ArrowUpRight size={12} weight="bold" />
</a>
<a href="https://learnhouse.app" target="_blank" rel="noopener noreferrer" className="lh-mobile-drawer-link">
<Globe size={16} weight="fill" />
Website
<ArrowUpRight size={12} weight="bold" />
</a>
<a href="https://github.com/learnhouse/learnhouse" target="_blank" rel="noopener noreferrer" className="lh-mobile-drawer-link">
<GithubLogo size={16} weight="fill" />
GitHub
</a>
<a href="https://discord.gg/CMyZjjYZ6x" target="_blank" rel="noopener noreferrer" className="lh-mobile-drawer-link">
<DiscordLogo size={16} weight="fill" />
Discord
</a>
</div>
<div className="lh-mobile-drawer-sidebar" id="mobile-sidebar-mount" />
</div>
</>
)
}
export default Navbar

View File

@@ -0,0 +1,347 @@
'use client'
import { useConfig } from 'nextra-theme-docs'
import { usePathname } from 'next/navigation'
import Link from 'next/link'
import { useState, useEffect } from 'react'
import { createPortal } from 'react-dom'
import {
House,
RocketLaunch,
Lightning,
Cloud,
AppWindow,
BookOpen,
PencilSimple,
Brain,
Users,
Buildings,
GraduationCap,
ChalkboardTeacher,
Stack,
Path,
Cube,
UsersThree,
DownloadSimple,
Gear,
Wrench,
ListChecks,
Terminal,
TreeStructure,
GitBranch,
Plug,
Browser,
Database,
HardDrives,
Key,
Envelope,
Folder,
Lock,
ArrowsClockwise,
ClockCountdown,
ChartBar,
Lifebuoy,
ShieldCheck,
Code,
BookBookmark,
SlidersHorizontal,
ClipboardText,
Trophy,
CheckCircle,
GameController,
ChatCircle,
ChatDots,
ThumbsUp,
Kanban,
ChalkboardSimple,
Microphone,
MagnifyingGlass,
Certificate,
Briefcase,
CreditCard,
Storefront,
ShoppingCart,
Receipt,
IdentificationBadge,
Package,
Scroll,
} from '@phosphor-icons/react/dist/ssr'
const ICON_SIZE = 15
const iconMap = {
// Root level
'/': House,
'/getting-started': RocketLaunch,
'/platform': AppWindow,
'/enterprise': Briefcase,
'/self-hosting': Cloud,
'/developers': Code,
// Getting Started
'/getting-started/quickstart': Lightning,
'/getting-started/cloud-vs-self-hosting': Cloud,
'/getting-started/key-concepts': BookOpen,
// Platform
'/platform/courses': BookBookmark,
'/platform/editor': PencilSimple,
'/platform/ai': Brain,
'/platform/users': Users,
'/platform/organizations': Buildings,
// Platform > Courses
'/platform/courses/chapters-and-activities': Stack,
'/platform/courses/collections': Folder,
'/platform/courses/trails': Path,
// Platform > Editor
'/platform/editor/blocks': Cube,
// Platform > AI
'/platform/ai/for-students': GraduationCap,
'/platform/ai/for-teachers': ChalkboardTeacher,
// Platform > Users
'/platform/users/roles-and-permissions': ShieldCheck,
'/platform/users/authentication': Key,
// Platform > Assignments
'/platform/assignments': ClipboardText,
'/platform/assignments/grading': CheckCircle,
// Platform > Code Execution
'/platform/code-execution': Terminal,
// Platform > Playgrounds
'/platform/playgrounds': GameController,
// Platform > Discussions
'/platform/discussions': ChatCircle,
'/platform/discussions/comments': ChatDots,
// Platform > Boards
'/platform/boards': ChalkboardSimple,
// Platform > Podcasts
'/platform/podcasts': Microphone,
// Platform > Certifications
'/platform/certifications': Certificate,
// Platform > Analytics
'/platform/analytics': ChartBar,
// Platform > Search
'/platform/search': MagnifyingGlass,
// Platform > Payments
'/platform/payments': CreditCard,
'/platform/payments/offers': Storefront,
'/platform/payments/groups': ShoppingCart,
'/platform/payments/enrollments': Receipt,
// Platform > Organizations
'/platform/organizations/multi-tenancy': TreeStructure,
'/platform/organizations/settings': SlidersHorizontal,
// Enterprise
'/enterprise/sso': IdentificationBadge,
'/enterprise/audit-logs': Scroll,
'/enterprise/scorm': Package,
// Self Hosting
'/self-hosting/installation': DownloadSimple,
'/self-hosting/configuration': Gear,
'/self-hosting/maintenance': Wrench,
// Self Hosting > Installation
'/self-hosting/installation/requirements': ListChecks,
'/self-hosting/installation/quick-install': Lightning,
'/self-hosting/installation/cli-reference': Terminal,
// Self Hosting > Configuration
'/self-hosting/configuration/environment-variables': Code,
'/self-hosting/configuration/ai-setup': Brain,
'/self-hosting/configuration/email': Envelope,
'/self-hosting/configuration/storage': HardDrives,
'/self-hosting/configuration/ssl': Lock,
// Self Hosting > Maintenance
'/self-hosting/maintenance/updates': ArrowsClockwise,
'/self-hosting/maintenance/backups': ClockCountdown,
'/self-hosting/maintenance/monitoring': ChartBar,
'/self-hosting/maintenance/troubleshooting': Lifebuoy,
// CLI
'/cli': Terminal,
'/cli/commands': ListChecks,
'/cli/setup-wizard': Lightning,
'/cli/dev-mode': Code,
'/cli/environment-variables': Gear,
// Developers
'/developers/architecture': TreeStructure,
'/developers/contributing': GitBranch,
'/developers/api': Plug,
// Developers > Architecture
'/developers/architecture/frontend': Browser,
'/developers/architecture/backend': Database,
'/developers/architecture/services': HardDrives,
// Developers > Contributing
'/developers/contributing/dev-environment': Terminal,
'/developers/contributing/guidelines': BookOpen,
// Developers > API
'/developers/api/authentication': Key,
'/developers/api/endpoints': Plug,
}
function getIcon(route) {
const Icon = iconMap[route]
if (!Icon) return null
return <Icon size={ICON_SIZE} weight="fill" />
}
function SidebarItem({ item, depth = 0, onNavigate }) {
const pathname = usePathname()
const isActive = pathname === item.route
const hasChildren = item.children && item.children.length > 0
const isChildActive = hasChildren && item.children.some(
child => pathname === child.route || pathname?.startsWith(child.route + '/')
)
const [open, setOpen] = useState(isChildActive || depth < 1)
useEffect(() => {
if (isChildActive) setOpen(true)
}, [isChildActive])
if (item.type === 'separator') {
return (
<div className="lh-sidebar-separator">
{typeof item.title === 'string' ? item.title : item.name}
</div>
)
}
if (item.display === 'hidden') return null
const title = typeof item.title === 'string'
? item.title
: typeof item.title === 'object' && item.title
? item.title
: item.name
const icon = getIcon(item.route)
if (hasChildren) {
return (
<div className="lh-sidebar-folder">
<button
className={`lh-sidebar-folder-btn ${isChildActive ? 'lh-sidebar-folder-active' : ''}`}
onClick={() => setOpen(!open)}
style={{ paddingLeft: 10 }}
>
<span className="lh-sidebar-folder-title">
{icon && <span className="lh-sidebar-icon">{icon}</span>}
{title}
</span>
<svg
className={`lh-sidebar-chevron ${open ? 'lh-sidebar-chevron-open' : ''}`}
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2.5"
strokeLinecap="round"
strokeLinejoin="round"
>
<polyline points="9 18 15 12 9 6" />
</svg>
</button>
{open && (
<div className="lh-sidebar-children">
{item.children.map((child, i) => (
<SidebarItem key={child.route || i} item={child} depth={depth + 1} onNavigate={onNavigate} />
))}
</div>
)}
</div>
)
}
return (
<Link
href={item.route || '#'}
className={`lh-sidebar-link ${isActive ? 'lh-sidebar-link-active' : ''}`}
style={{ paddingLeft: 10 }}
onClick={onNavigate}
>
{icon && <span className="lh-sidebar-icon">{icon}</span>}
{title}
</Link>
)
}
function SidebarContent({ onNavigate }) {
const config = useConfig()
const pathname = usePathname()
const { docsDirectories } = config.normalizePagesResult
const isDevSection = pathname?.startsWith('/developers') || pathname?.startsWith('/self-hosting') || pathname?.startsWith('/cli') || pathname?.startsWith('/enterprise')
const devRoutes = ['/developers', '/self-hosting', '/cli', '/enterprise']
const items = docsDirectories.filter((item) => {
const isDev = devRoutes.some(r => item.route?.startsWith(r))
return isDevSection ? isDev : !isDev
})
// Enforce sidebar order for dev section
const devOrder = ['/developers', '/cli', '/self-hosting', '/enterprise']
items.sort((a, b) => {
const aIdx = devOrder.indexOf(a.route)
const bIdx = devOrder.indexOf(b.route)
if (aIdx !== -1 && bIdx !== -1) return aIdx - bIdx
if (aIdx !== -1) return -1
if (bIdx !== -1) return 1
return 0
})
return (
<nav className="lh-sidebar-nav">
{items.map((item, i) => (
<SidebarItem key={item.route || i} item={item} depth={0} onNavigate={onNavigate} />
))}
</nav>
)
}
function MobileSidebarPortal({ onNavigate }) {
const [mountNode, setMountNode] = useState(null)
useEffect(() => {
const el = document.getElementById('mobile-sidebar-mount')
if (el) setMountNode(el)
}, [])
if (!mountNode) return null
return createPortal(<SidebarContent onNavigate={onNavigate} />, mountNode)
}
export default function Sidebar() {
return (
<>
{/* Desktop sidebar */}
<aside className="lh-sidebar">
<SidebarContent />
</aside>
{/* Portal into mobile drawer */}
<MobileSidebarPortal />
</>
)
}

62
components/TOC/TOC.jsx Normal file
View File

@@ -0,0 +1,62 @@
'use client'
import { useEffect, useState, useRef } from 'react'
export default function TOC({ headings = [] }) {
const [activeId, setActiveId] = useState('')
const observerRef = useRef(null)
useEffect(() => {
if (!headings.length) return
const handleIntersect = (entries) => {
for (const entry of entries) {
if (entry.isIntersecting) {
setActiveId(entry.target.id)
break
}
}
}
observerRef.current = new IntersectionObserver(handleIntersect, {
rootMargin: '-80px 0px -70% 0px',
threshold: 0,
})
for (const h of headings) {
const el = document.getElementById(h.id)
if (el) observerRef.current.observe(el)
}
return () => observerRef.current?.disconnect()
}, [headings])
if (!headings.length) return null
return (
<div className="lh-toc-inner">
<p className="lh-toc-title">On this page</p>
<ul className="lh-toc-list">
{headings.map((heading) => (
<li key={heading.id}>
<a
href={`#${heading.id}`}
className={`lh-toc-link ${heading.depth > 2 ? 'lh-toc-link-nested' : ''} ${activeId === heading.id ? 'lh-toc-link-active' : ''}`}
onClick={(e) => {
e.preventDefault()
const el = document.getElementById(heading.id)
if (el) {
el.scrollIntoView({ behavior: 'smooth', block: 'start' })
setActiveId(heading.id)
history.replaceState(null, '', `#${heading.id}`)
}
}}
>
{typeof heading.value === 'string' ? heading.value : heading.id}
</a>
</li>
))}
</ul>
</div>
)
}

View File

@@ -0,0 +1,29 @@
'use client'
export function Table({ children, ...props }) {
return (
<div className="lh-table-wrap">
<table className="lh-table" {...props}>{children}</table>
</div>
)
}
export function Thead({ children, ...props }) {
return <thead className="lh-table-head" {...props}>{children}</thead>
}
export function Tbody({ children, ...props }) {
return <tbody className="lh-table-body" {...props}>{children}</tbody>
}
export function Tr({ children, ...props }) {
return <tr className="lh-table-row" {...props}>{children}</tr>
}
export function Th({ children, ...props }) {
return <th className="lh-table-th" {...props}>{children}</th>
}
export function Td({ children, ...props }) {
return <td className="lh-table-td" {...props}>{children}</td>
}

View File

@@ -0,0 +1,189 @@
'use client'
import Sidebar from '../Sidebar/Sidebar'
import TOC from '../TOC/TOC'
import { useConfig } from 'nextra-theme-docs'
import { usePathname } from 'next/navigation'
import Link from 'next/link'
import { PencilSimple } from '@phosphor-icons/react/dist/ssr'
function Breadcrumb() {
const config = useConfig()
const { activePath } = config.normalizePagesResult
if (!activePath || activePath.length <= 1) return null
return (
<nav className="lh-breadcrumb" aria-label="breadcrumb">
{activePath.map((item, i) => {
const isLast = i === activePath.length - 1
const title = typeof item.title === 'string' ? item.title : item.name
return (
<span key={item.route || i} className="lh-breadcrumb-item">
{i > 0 && <span className="lh-breadcrumb-sep">/</span>}
{isLast ? (
<span className="lh-breadcrumb-current">{title}</span>
) : (
<Link href={item.route || '#'} className="lh-breadcrumb-link">
{title}
</Link>
)}
</span>
)
})}
</nav>
)
}
function Pagination() {
const config = useConfig()
const { flatDocsDirectories, activeIndex } = config.normalizePagesResult
const prev = activeIndex > 0 ? flatDocsDirectories[activeIndex - 1] : null
const next = activeIndex < flatDocsDirectories.length - 1 ? flatDocsDirectories[activeIndex + 1] : null
if (!prev && !next) return null
return (
<div className="lh-pagination">
{prev ? (
<Link href={prev.route} className="lh-pagination-link lh-pagination-prev">
<span className="lh-pagination-label">Previous</span>
<span className="lh-pagination-title">
{typeof prev.title === 'string' ? prev.title : prev.name}
</span>
</Link>
) : <div />}
{next ? (
<Link href={next.route} className="lh-pagination-link lh-pagination-next">
<span className="lh-pagination-label">Next</span>
<span className="lh-pagination-title">
{typeof next.title === 'string' ? next.title : next.name}
</span>
</Link>
) : <div />}
</div>
)
}
function EditOnGitHub() {
const pathname = usePathname()
let filePath = pathname === '/' ? '/index' : pathname
const gitHubBase = 'https://github.com/learnhouse/docs/edit/main/content'
const href = `${gitHubBase}${filePath}.mdx`
return (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
className="lh-edit-github"
>
<PencilSimple size={13} weight="bold" />
Edit on GitHub
</a>
)
}
function LastEdited({ timestamp }) {
if (!timestamp) return null
const date = new Date(timestamp).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: 'numeric',
})
return (
<div className="lh-last-edited">
Last edited on {date}
</div>
)
}
function CloudAd() {
return (
<a
href="https://learnhouse.app"
target="_blank"
rel="noopener noreferrer"
className="group block nice-shadow rounded-2xl overflow-hidden bg-white! no-underline! relative transition-transform hover:scale-[1.02]"
>
{/* Dot pattern background */}
<div
className="absolute inset-0 pointer-events-none opacity-40"
style={{
backgroundImage: 'radial-gradient(circle, #a5b4fc 1px, transparent 1px)',
backgroundSize: '14px 14px',
maskImage: 'linear-gradient(to bottom, black 20%, transparent 70%)',
WebkitMaskImage: 'linear-gradient(to bottom, black 20%, transparent 70%)',
}}
/>
<div className="relative p-4">
<div className="flex items-center gap-2.5" style={{ marginBottom: 16 }}>
<img src="/img/logos/learnhouse-dark.svg" alt="LearnHouse" className="h-3.5" />
<span
className="text-[8px] font-bold uppercase tracking-wide text-white! px-1.5 py-px rounded"
style={{
background: 'linear-gradient(180deg, #818cf8 0%, #6366f1 100%)',
boxShadow: 'inset 0 1px 0 rgba(255,255,255,0.25), 0 1px 3px rgba(99,102,241,0.4), 0 0.5px 0 rgba(99,102,241,0.2)',
border: '0.5px solid rgba(99,102,241,0.5)',
textShadow: '0 1px 1px rgba(0,0,0,0.15)',
}}
>
Cloud
</span>
</div>
<p className="text-[12px] font-semibold text-neutral-900! leading-snug m-0!">
Try LearnHouse Cloud
</p>
<p className="mt-1.5 text-[10.5px] text-neutral-400! leading-relaxed m-0!">
Managed hosting with automatic updates, backups, and scaling.
</p>
<div className="mt-3 inline-flex items-center gap-1 text-[10.5px] font-semibold text-indigo-500! group-hover:gap-2 transition-all">
Get started free
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
<line x1="5" y1="12" x2="19" y2="12" />
<polyline points="12 5 19 12 12 19" />
</svg>
</div>
</div>
</a>
)
}
export default function Wrapper({ children, toc, metadata }) {
const pathname = usePathname()
const isHome = pathname === '/'
return (
<div className="lh-page">
<Sidebar />
<div className="lh-content-area">
<article className="lh-article">
<div className="lh-article-header">
<Breadcrumb />
{!isHome && <EditOnGitHub />}
</div>
<div className="lh-prose">
{children}
</div>
{!isHome && (
<div className="lh-article-footer">
<LastEdited timestamp={metadata?.timestamp} />
</div>
)}
<Pagination />
</article>
<div className="lh-toc">
{toc && toc.length > 0 && (
<TOC headings={toc} />
)}
<CloudAd />
</div>
</div>
</div>
)
}

View File

@@ -1,19 +1,17 @@
{
"-- Overview": {
"type": "separator",
"title": "Overview"
},
"index": "Introduction",
"features": "Features",
"-- Self Hosting": {
"-- Getting Started": {
"type": "separator",
"title": "Self Hosting"
"title": "Getting Started"
},
"self-hosting": "Get started",
"-- Developers": {
"getting-started": "Getting Started",
"-- Platform": {
"type": "separator",
"title": "Developers"
"title": "Platform"
},
"setup-dev-environment": "Dev Environment",
"concepts": "Concepts"
}
"platform": "Platform",
"self-hosting": "Self Hosting",
"developers": "Developers",
"cli": "CLI",
"enterprise": "Enterprise Edition"
}

7
content/cli/_meta.json Normal file
View File

@@ -0,0 +1,7 @@
{
"index": "Overview",
"commands": "Commands",
"setup-wizard": "Setup Wizard",
"dev-mode": "Dev Mode",
"environment-variables": "Environment Variables"
}

150
content/cli/commands.mdx Normal file
View File

@@ -0,0 +1,150 @@
import { Callout } from 'nextra/components'
# Commands
Full reference for all LearnHouse CLI commands.
## `setup`
Interactive wizard that generates a complete Docker Compose deployment. See [Setup Wizard](/cli/setup-wizard) for details.
```bash
npx learnhouse@latest setup
```
## `start`
Start all Docker containers for your deployment.
```bash
npx learnhouse start
```
## `stop`
Stop all running containers.
```bash
npx learnhouse stop
```
## `logs`
Stream logs from all containers in real-time.
```bash
npx learnhouse logs
```
## `config`
Display current installation metadata — version, directory, URL, organization slug, and file locations.
```bash
npx learnhouse config
```
## `doctor`
Run comprehensive diagnostics to identify issues. Checks:
- Docker installation and daemon status
- Docker Compose v2 availability
- Container health and restart counts
- Port availability
- DNS resolution (for non-localhost domains)
- Disk space (warns below 1 GB)
- Docker volume sizes
- Log analysis (scans for errors)
- `.env` validation (required variables, secret length)
- Image freshness
```bash
npx learnhouse doctor
```
## `backup`
Create a database backup as a `.tar.gz` archive containing a `pg_dump` and optionally your `.env` file.
```bash
npx learnhouse backup
```
Backups are saved to `{installDir}/backups/learnhouse-backup-{timestamp}.tar.gz`.
### Restore
Restore a database from a backup archive. This overwrites the current database.
```bash
npx learnhouse backup --restore
npx learnhouse restore <archive.tar.gz>
```
<Callout type="warning">
Restore only works with local (Docker) databases, not external connections. Restart services after restoring.
</Callout>
## `deployments`
View and manage deployments on the current machine.
```bash
npx learnhouse deployments
```
Features:
- List all LearnHouse deployments with container status
- Scale resource limits (memory) for `learnhouse-app`, `db`, and `redis`
- View current resource usage via `docker stats`
## `shell`
Open an interactive shell (`/bin/sh`) inside a running container.
```bash
npx learnhouse shell
```
Displays a list of running containers to choose from.
## `env`
Interactive environment variable editor. Edit variables by category:
- Domain & Hosting
- Database & Redis
- Security
- AI
- Email
- S3 Storage
- OAuth
```bash
npx learnhouse env
```
Secret values are masked in the display. Optionally restart services after changes.
## `health`
Run health checks against the running deployment.
```bash
npx learnhouse health
```
Checks container status, PostgreSQL connection, Redis ping, HTTP health endpoint, disk usage, and resource consumption.
## `dev`
Start a local development environment. See [Dev Mode](/cli/dev-mode) for details.
```bash
npx learnhouse dev
```
| Flag | Description |
| --- | --- |
| `--ee` | Enable Enterprise Edition features |

79
content/cli/dev-mode.mdx Normal file
View File

@@ -0,0 +1,79 @@
import { Callout } from 'nextra/components'
# Dev Mode
The `dev` command starts a full local development environment with hot reload for all services.
```bash
npx learnhouse dev
```
## How It Works
The command splits infrastructure and application services:
- **Infrastructure** (Docker): PostgreSQL with pgvector + Redis run in containers via `.learnhouse/docker-compose.dev.yml`
- **Application** (local): API, Web, and Collab servers run directly on your machine with hot reload
## Requirements
- Docker (for database and Redis)
- [bun](https://bun.sh/) (for web and collab dependencies)
- [uv](https://docs.astral.sh/uv/) (for Python API dependencies)
The CLI auto-installs dependencies (`bun install`, `uv sync`) if `node_modules` or `.venv` are missing.
## Startup Flow
1. **Detect project root** — Looks for the monorepo structure (`apps/api`, `apps/web`, `apps/collab`)
2. **Start infrastructure** — Launches PostgreSQL and Redis containers (reuses existing ones if running)
3. **Health checks** — Waits for database and Redis to be ready
4. **Admin setup** — On first run, prompts for admin email and password. Credentials are saved and reused on subsequent runs.
5. **Install dependencies** — Runs `bun install` and `uv sync` if needed
6. **Start services** — Launches API, Web, and Collab with color-coded output
## Services
| Service | Command | Port |
| --- | --- | --- |
| API | `uv run python app.py` | 1338 |
| Web | `next dev --turbopack` | 3000 |
| Collab | `tsx watch src/index.ts` | 4000 |
## Interactive Controls
While running, you can type commands to manage services:
| Key | Action |
| --- | --- |
| `ra` | Restart API |
| `rw` | Restart Web |
| `rc` | Restart Collab |
| `rb` | Restart all services |
| `q` | Quit (graceful shutdown) |
## Enterprise Edition
Use the `--ee` flag to enable Enterprise Edition features:
```bash
npx learnhouse dev --ee
```
Without the flag, the `apps/api/ee/` directory is temporarily hidden during development.
## Shutdown
When you quit (`q` or Ctrl+C):
- Local services (API, Web, Collab) are stopped
- Docker containers (PostgreSQL, Redis) keep running for the next session
- To fully stop infrastructure:
```bash
docker compose -f .learnhouse/docker-compose.dev.yml -p learnhouse-dev down
```
<Callout type="info">
Database data persists across dev sessions via Docker volumes. Your data is safe between restarts.
</Callout>

View File

@@ -0,0 +1,89 @@
# Environment Variables
The CLI generates a `.env` file during setup with all configuration variables. These can also be edited interactively with `npx learnhouse env`.
## Domain & Hosting
| Variable | Description | Example |
| --- | --- | --- |
| `LEARNHOUSE_DOMAIN` | Hostname | `localhost` |
| `HTTP_PORT` | HTTP port for reverse proxy | `80` |
| `NEXT_PUBLIC_LEARNHOUSE_API_URL` | Public API URL | `http://localhost/api/v1/` |
| `NEXT_PUBLIC_LEARNHOUSE_BACKEND_URL` | Backend URL | `http://localhost` |
| `NEXT_PUBLIC_LEARNHOUSE_DOMAIN` | Public domain | `localhost` |
| `NEXT_PUBLIC_LEARNHOUSE_TOP_DOMAIN` | Top-level domain | `localhost` |
| `NEXT_PUBLIC_LEARNHOUSE_MULTI_ORG` | Multi-org mode | `false` |
| `NEXT_PUBLIC_LEARNHOUSE_DEFAULT_ORG` | Default org slug | `my-school` |
| `NEXT_PUBLIC_LEARNHOUSE_HTTPS` | HTTPS enabled | `false` |
## Database & Redis
| Variable | Description | Example |
| --- | --- | --- |
| `LEARNHOUSE_SQL_CONNECTION_STRING` | PostgreSQL connection | `postgresql://learnhouse:pass@db:5432/learnhouse` |
| `LEARNHOUSE_REDIS_CONNECTION_STRING` | Redis connection | `redis://redis:6379/learnhouse` |
| `LEARNHOUSE_REDIS_URL` | Redis URL | `redis://redis:6379/learnhouse` |
| `POSTGRES_USER` | Database user (local only) | `learnhouse` |
| `POSTGRES_PASSWORD` | Database password (local only) | Auto-generated |
| `POSTGRES_DB` | Database name (local only) | `learnhouse` |
## Security & Authentication
| Variable | Description | Example |
| --- | --- | --- |
| `LEARNHOUSE_AUTH_JWT_SECRET_KEY` | JWT signing key | Auto-generated |
| `LEARNHOUSE_INITIAL_ADMIN_EMAIL` | First admin email | `admin@example.com` |
| `LEARNHOUSE_INITIAL_ADMIN_PASSWORD` | First admin password | Set during setup |
| `LEARNHOUSE_COOKIE_DOMAIN` | Cookie domain | `localhost` |
| `COLLAB_INTERNAL_KEY` | Collaboration service key | Auto-generated |
| `NEXTAUTH_SECRET` | NextAuth secret | Auto-generated |
| `NEXTAUTH_URL` | NextAuth URL | `http://localhost` |
## Application
| Variable | Description | Example |
| --- | --- | --- |
| `LEARNHOUSE_PORT` | Internal API port | `9000` |
| `LEARNHOUSE_DEVELOPMENT_MODE` | Dev mode flag | `False` |
| `NEXT_PUBLIC_COLLAB_URL` | WebSocket collab URL | `ws://localhost/collab` |
## AI
| Variable | Description | Example |
| --- | --- | --- |
| `LEARNHOUSE_IS_AI_ENABLED` | Enable AI features | `True` / `False` |
| `LEARNHOUSE_GEMINI_API_KEY` | Gemini API key | Your API key |
## Email
| Variable | Description | Example |
| --- | --- | --- |
| `LEARNHOUSE_EMAIL_PROVIDER` | Email provider | `resend` / `smtp` |
| `LEARNHOUSE_SYSTEM_EMAIL_ADDRESS` | From address | `noreply@example.com` |
| `LEARNHOUSE_RESEND_API_KEY` | Resend API key | Your API key |
| `LEARNHOUSE_SMTP_HOST` | SMTP host | `smtp.gmail.com` |
| `LEARNHOUSE_SMTP_PORT` | SMTP port | `587` |
| `LEARNHOUSE_SMTP_USERNAME` | SMTP username | `user@example.com` |
| `LEARNHOUSE_SMTP_PASSWORD` | SMTP password | Your password |
| `LEARNHOUSE_SMTP_USE_TLS` | Enable TLS | `True` / `False` |
## S3 Storage
| Variable | Description | Example |
| --- | --- | --- |
| `LEARNHOUSE_CONTENT_DELIVERY_TYPE` | Storage type | `filesystem` / `s3api` |
| `LEARNHOUSE_S3_API_BUCKET_NAME` | S3 bucket name | `my-bucket` |
| `LEARNHOUSE_S3_API_ENDPOINT_URL` | S3 endpoint (optional for AWS) | `https://s3.amazonaws.com` |
## OAuth
| Variable | Description | Example |
| --- | --- | --- |
| `LEARNHOUSE_GOOGLE_CLIENT_ID` | Google OAuth client ID | Your client ID |
| `LEARNHOUSE_GOOGLE_CLIENT_SECRET` | Google OAuth client secret | Your secret |
## Unsplash
| Variable | Description | Example |
| --- | --- | --- |
| `NEXT_PUBLIC_UNSPLASH_ACCESS_KEY` | Unsplash API key | Your access key |

71
content/cli/index.mdx Normal file
View File

@@ -0,0 +1,71 @@
import { Callout } from 'nextra/components'
# CLI
The LearnHouse CLI is the primary tool for deploying, managing, and developing LearnHouse. It orchestrates Docker Compose services and provides an interactive setup wizard for production deployments, as well as a full local development environment.
<img src="/img/pages/cli/cli-screenshot.png" alt="LearnHouse CLI" style={{ borderRadius: '12px', marginTop: '1rem' }} />
**Package**: [`learnhouse`](https://www.npmjs.com/package/learnhouse) on npm
## Installation
### Quick Start (recommended)
```bash
npx learnhouse@latest setup
```
### One-line Install (macOS / Linux)
Installs Docker, Node.js, and launches the CLI:
```bash
curl -fsSL https://raw.githubusercontent.com/learnhouse/learnhouse/main/apps/cli/install.sh | bash
```
### Windows (PowerShell)
```powershell
irm https://raw.githubusercontent.com/learnhouse/learnhouse/main/apps/cli/install.ps1 | iex
```
## Requirements
- **Node.js** 18+
- **Docker** with Docker Compose v2
## What It Does
The CLI handles two main workflows:
### Production Deployment
The [setup wizard](/cli/setup-wizard) generates a complete Docker Compose deployment with:
- **LearnHouse app** container (Next.js + FastAPI)
- **PostgreSQL** database (with optional pgvector for AI)
- **Redis** cache
- **Caddy** or **Nginx** reverse proxy (with optional auto-SSL)
Each deployment gets a unique ID, allowing multiple instances on the same machine.
### Local Development
The [`dev` command](/cli/dev-mode) starts infrastructure in Docker and runs the API, web, and collaboration servers locally with hot reload.
## Quick Reference
| Command | Description |
| --- | --- |
| `npx learnhouse setup` | Interactive setup wizard |
| `npx learnhouse start` | Start all services |
| `npx learnhouse stop` | Stop all services |
| `npx learnhouse logs` | Stream container logs |
| `npx learnhouse doctor` | Run diagnostics |
| `npx learnhouse backup` | Backup database |
| `npx learnhouse dev` | Start dev environment |
<Callout type="info">
See [Commands](/cli/commands) for the full reference.
</Callout>

View File

@@ -0,0 +1,107 @@
import { Callout } from 'nextra/components'
# Setup Wizard
The setup wizard (`npx learnhouse@latest setup`) is an interactive 6-step process that generates a complete Docker Compose deployment. You can go back and edit any step before confirming.
## Step 1 — Install Directory
Choose where the deployment files will be created.
- **Default**: `./learnhouse`
- The directory is created if it doesn't exist
## Step 2 — Domain Configuration
Configure your hostname and HTTPS settings.
- **Domain**: hostname or IP address (default: `localhost`)
- **HTTPS options** (non-localhost only):
- **Automatic SSL** (recommended) — Uses Let's Encrypt via Caddy. Requires a valid domain and ports 80/443.
- **Manual SSL** — You handle the reverse proxy or Cloudflare. LearnHouse runs on HTTP internally.
- **No HTTPS** — HTTP only (not recommended for production)
- **Port**: Automatically set based on SSL choice (443 for auto SSL, 80 for HTTP)
## Step 3 — Database & Redis
Choose local Docker containers or connect to external services.
### PostgreSQL
- **Local Docker** (recommended):
- **AI-enabled** (recommended) — Uses `pgvector/pgvector:pg16` for RAG and vector search features
- **Standard** — Uses `postgres:16-alpine`, lighter footprint
- Password is auto-generated
- **External** — Provide a connection string (`postgresql://user:pass@host:5432/db`). The wizard tests connectivity before proceeding.
### Redis
- **Local Docker** (recommended) — Uses `redis:7.2.3-alpine`
- **External** — Provide a connection string. The wizard tests connectivity before proceeding.
## Step 4 — Organization
Set your organization name (e.g., "My School"). This creates the initial organization in the database.
## Step 5 — Admin Account
Create the first admin user with email and password (minimum 8 characters).
## Step 6 — Optional Features
Enable any of the following integrations:
| Feature | Required Configuration |
| --- | --- |
| **AI (Gemini)** | Gemini API key |
| **Email (Resend)** | Resend API key + system email address |
| **Email (SMTP)** | Host, port, username, password, TLS toggle + system email |
| **S3 Storage** | Bucket name, endpoint URL (optional for AWS) |
| **Google OAuth** | Client ID + Client Secret |
| **Unsplash** | Access Key |
## Confirmation
After completing all steps, the wizard shows a summary of your configuration. You can:
- **Proceed** — Generate files and optionally start the deployment
- **Edit** — Go back and change any step
- **Cancel** — Abort without generating anything
## Generated Files
After confirmation, the wizard creates:
```
{installDir}/
├── docker-compose.yml # Service definitions
├── .env # All configuration variables
├── learnhouse.config.json # CLI metadata
└── extra/
├── Caddyfile # If auto-SSL enabled
└── nginx.prod.conf # If manual SSL or HTTP
```
## Docker Services
Each deployment gets a unique 8-character ID for container and network isolation.
| Service | Image | Purpose |
| --- | --- | --- |
| `learnhouse-app-{id}` | `ghcr.io/learnhouse/app` | Next.js + FastAPI application |
| `learnhouse-db-{id}` | `pgvector:pg16` or `postgres:16-alpine` | PostgreSQL database |
| `learnhouse-redis-{id}` | `redis:7.2.3-alpine` | Redis cache |
| `learnhouse-caddy-{id}` | `caddy:2-alpine` | Reverse proxy with auto-SSL |
| `learnhouse-nginx-{id}` | `nginx:alpine` | Reverse proxy (no auto-SSL) |
<Callout type="info">
The wizard optionally starts the deployment and waits up to 3 minutes for the health check (`/api/v1/health`) to pass before showing your credentials and URL.
</Callout>
## Release Channels
During setup you choose a release channel:
- **Stable** — Recommended for production
- **Dev** — Bleeding edge, latest features
- **Custom** — Specify an exact image tag

View File

@@ -1,3 +0,0 @@
{
"infra-overview": "Infrastructure Overview"
}

View File

@@ -1,15 +0,0 @@
import { Callout } from 'nextra/components';
import Image from "next/image";
# Infrastructure Overview
LearnHouse is separated into two parts/codebases :
- **Frontend** : Web interface for the user to interact with the application, some parts are server rendered and some are client rendered, we use React Server Components enabled by Next.js 14
- **Backend** : Backend code in Python using FastAPI that handles : Storage, Authentication, Uploads, AI etc.
Here is a diagram that explains the infrastructure in a simple way to get started :
<br />
<img style={{ borderRadius: 10 }} quality={100} src="/img/schemas/infra_overview.png" alt="Hello" width={800} height={500} />

View File

@@ -0,0 +1,6 @@
{
"index": "Overview",
"architecture": "Architecture",
"contributing": "Contributing",
"api": "API Reference"
}

View File

@@ -0,0 +1,5 @@
{
"index": "Overview",
"authentication": "Authentication",
"endpoints": "Endpoints"
}

View File

@@ -0,0 +1,47 @@
import { Callout } from 'nextra/components'
# API Authentication
The LearnHouse API supports **JWT cookies** for browser sessions and **API tokens** for programmatic access.
## JWT Authentication
Login to receive a JWT access token (HS256, expires in 8 hours):
```bash
curl -X POST http://localhost:1338/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "your-password"}'
```
Then authenticate requests via the `Authorization` header:
```bash
curl http://localhost:1338/api/v1/users/me \
-H "Authorization: Bearer <access_token>"
```
The token is also set as an `access_token_cookie` for browser-based sessions. Use `/api/v1/auth/refresh` to renew expired tokens within the 30-day refresh window.
## API Tokens
<Callout type="info">
API tokens are available on the **Pro plan**. Create and manage them in organization settings.
</Callout>
For programmatic access, use API tokens (prefixed with `lh_`):
```bash
curl http://localhost:1338/api/v1/users/me \
-H "Authorization: Bearer lh_your_api_token_here"
```
## Auth Endpoints
| Method | Endpoint | Description |
| --- | --- | --- |
| `POST` | `/api/v1/auth/login` | Login and receive a JWT |
| `GET` | `/api/v1/auth/refresh` | Refresh an expired token |
| `DELETE` | `/api/v1/auth/logout` | Invalidate the session |
| `POST` | `/api/v1/auth/oauth` | Google OAuth login |
| `POST` | `/api/v1/auth/verify-email` | Verify email address |

View File

@@ -0,0 +1,186 @@
import { Callout } from 'nextra/components'
# API Endpoints
This page provides an overview of all API endpoint groups available in LearnHouse. All endpoints are prefixed with `/api/v1/`. For the full interactive reference with request and response schemas, visit the Swagger UI at `/docs` on a development instance.
<Callout type="info">
The complete, interactive API documentation is available at [http://localhost:1338/docs](http://localhost:1338/docs) in development mode only. It includes every endpoint, parameter, and response schema.
</Callout>
## Core Endpoint Groups
### Authentication
Login, logout, token refresh, OAuth, and email verification.
```bash
# Login
curl -X POST http://localhost:1338/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "password"}'
```
See [Authentication](/developers/api/authentication) for full details.
### Users
User CRUD, profile management, session info, and password reset.
```bash
# Get current user profile
curl http://localhost:1338/api/v1/users/me \
-H "Authorization: Bearer <token>"
```
### Organizations
Organization CRUD, user management, roles, invites, configuration, SEO settings, branding, API tokens, and custom domains.
```bash
# Get organization details
curl http://localhost:1338/api/v1/orgs/{org_slug} \
-H "Authorization: Bearer <token>"
```
### Courses
Course CRUD, cloning, export/import, and contributor management.
```bash
# List courses in an organization
curl http://localhost:1338/api/v1/courses \
-H "Authorization: Bearer <token>"
# Create a new course
curl -X POST http://localhost:1338/api/v1/courses \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Introduction to Python",
"description": "A beginner-friendly Python course"
}'
```
### Chapters
Chapter CRUD and ordering within courses.
```bash
# List chapters in a course
curl http://localhost:1338/api/v1/chapters \
-H "Authorization: Bearer <token>"
```
### Activities
Activity CRUD -- individual content units within chapters (pages, videos, documents).
```bash
# Get activities
curl http://localhost:1338/api/v1/activities \
-H "Authorization: Bearer <token>"
```
### Blocks
Block CRUD -- content blocks within activities.
### Collections
Collections group related courses together for organization and discovery.
```bash
# List collections
curl http://localhost:1338/api/v1/collections \
-H "Authorization: Bearer <token>"
```
### Assignments
Assignment CRUD for course assessments.
### AI
AI-powered features including an assistant, magic blocks, course planning, and RAG (Retrieval-Augmented Generation).
```bash
# AI endpoints vary by configuration
curl http://localhost:1338/api/v1/ai/chat \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"message": "Explain this concept"}'
```
### Analytics
Course analytics and usage tracking.
### Search
Full-text search across courses and content.
### Code Execution
Code execution endpoints powered by Judge0.
### Learning Trails
Learning trail management and progress tracking.
### Video Streaming
Video streaming and delivery endpoints.
## Community Features (Standard Plan)
### Communities
Community forums for organizations.
### Discussions
Discussion threads within communities.
### User Groups
User group management for organizing learners.
## Pro Features (Pro Plan)
### Certifications
Certificate generation and management for course completion.
### Boards
Collaborative whiteboards for interactive learning.
### Playgrounds
AI-generated interactive elements for hands-on learning.
### Podcasts
Podcast and episode CRUD for audio content delivery.
## Infrastructure Endpoints
| Method | Endpoint | Description |
| --- | --- | --- |
| `GET` | `/api/v1/health` | Health check |
| `GET` | `/api/v1/instance/info` | Public instance information |
| `GET` | `/api/v1/content/...` | Content delivery (filesystem or S3) |
| `GET` | `/openapi.json` | OpenAPI spec (dev mode only) |
## Common Patterns
- All endpoints are prefixed with `/api/v1/`.
- Resources follow standard REST conventions: `GET` to list or retrieve, `POST` to create, `PUT` to update, `DELETE` to remove.
- Authenticated endpoints require either the `Authorization: Bearer <token>` header or the `access_token_cookie` cookie.
- Programmatic access uses API tokens with the `lh_` prefix (Pro plan).
- Responses are returned as JSON.
<Callout type="info">
Endpoint paths and request/response schemas may evolve between versions. Always refer to the interactive `/docs` endpoint on a development instance for the most up-to-date reference.
</Callout>

View File

@@ -0,0 +1,50 @@
import { Callout } from 'nextra/components'
# API Reference
The LearnHouse API is a RESTful service built with **FastAPI**. It powers all platform operations, from user authentication to course management and AI features. All endpoints are prefixed with `/api/v1/`.
## Interactive Documentation
<Callout type="warning">
The interactive API documentation is only available when running in **development mode**. Production instances do not expose Swagger UI or the OpenAPI spec.
</Callout>
When running the development environment, auto-generated interactive API documentation is available:
- **Swagger UI** -- Available at `/docs` (e.g., [http://localhost:1338/docs](http://localhost:1338/docs))
These interfaces let you explore all available endpoints, view request and response schemas, and test API calls directly from your browser.
## Base URL
In local development, the API is available at:
```
http://localhost:1338/api/v1/
```
In production, the API is served behind a reverse proxy and is accessible at the root domain under `/api/v1/`.
## Response Format
All API responses are returned as JSON. Successful responses typically include the requested data directly, while error responses follow this structure:
```json
{
"detail": "Description of the error"
}
```
## Sections
- **[Authentication](/developers/api/authentication)** -- How to obtain and use authentication tokens.
- **[Endpoints](/developers/api/endpoints)** -- Overview of the key API endpoint groups.
## OpenAPI Specification
Since the API is built with FastAPI, a machine-readable OpenAPI specification is available at `/openapi.json` on development instances. This can be used to generate client libraries or import into API testing tools.
<Callout type="info">
The OpenAPI spec at `/openapi.json` is only served in development mode.
</Callout>

View File

@@ -0,0 +1,6 @@
{
"index": "Overview",
"frontend": "Frontend",
"backend": "Backend",
"services": "Services"
}

View File

@@ -0,0 +1,96 @@
import { Callout } from 'nextra/components'
# Backend Architecture
The LearnHouse backend is a **FastAPI** application written in Python, located at `apps/api` in the project. It serves as the central API layer that handles all business logic and data management.
## Technology Stack
- **FastAPI** >= 0.135.1 -- High-performance Python web framework
- **Python 3.14.3**
- **SQLModel** >= 0.0.37 -- ORM for database interactions (built on SQLAlchemy and Pydantic)
- **Alembic** -- Database migration management
- **PostgreSQL 16** with **pgvector** extension -- Primary relational database
- **Redis** >= 7.2.1 -- Caching layer and session storage
- **Uvicorn** 0.41.0 -- ASGI server
- **uv** -- Python package manager
## Key Dependencies
- **psycopg2-binary** -- PostgreSQL adapter
- **pyjwt[crypto]** -- JWT token handling
- **pwdlib[argon2]** -- Password hashing with Argon2
- **google-genai** >= 1.65.0 -- Gemini AI integration
- **llama-index-core + pgvector** -- RAG and vector embeddings
- **stripe** -- Payment processing
- **workos** -- Enterprise SSO
- **boto3** -- S3-compatible storage
- **resend** -- Transactional email
- **sentry-sdk** -- Error tracking and monitoring
## Configuration
The backend uses a dual configuration system:
- **YAML config** at `config/config.yaml` for structured settings
- **Environment variables** which override YAML values when set
The API prefix for all endpoints is `/api/v1/`.
## Responsibilities
The backend handles all core platform operations:
- **Authentication and authorization** -- JWT-based token authentication with role-based access control
- **Course management** -- CRUD operations for organizations, courses, chapters, and activities
- **User management** -- Registration, profiles, and permissions
- **File storage and uploads** -- Handling media uploads with support for local filesystem and S3-compatible storage (via boto3)
- **AI features** -- Integration with Google Gemini and LlamaIndex for learning assistance and RAG
- **Search** -- Content indexing and search across courses and activities
- **Payments** -- Stripe integration for course monetization
- **Email** -- Transactional email via Resend
## Database Layer
SQLModel is used as the ORM, connecting to a PostgreSQL 16 database with the pgvector extension for AI embeddings. Database models define the schema for all entities: organizations, users, courses, chapters, activities, collections, and more. Migrations are managed with **Alembic** to keep the schema in sync across environments.
## Caching
Redis is used for:
- **Response caching** -- Frequently accessed data is cached to reduce database load.
- **Session data** -- Temporary session information is stored in Redis for fast retrieval.
## API Documentation
FastAPI automatically generates interactive API documentation, but it is only available when running in development mode.
<Callout type="info">
Swagger UI (`/docs/`) and ReDoc (`/redoc/`) are only accessible when `LEARNHOUSE_DEVELOPMENT_MODE=True` is set. They are disabled in production.
</Callout>
## Directory Structure
```
apps/api/
├── src/
│ ├── routers/ # API route definitions
│ ├── db/ # SQLModel table definitions
│ ├── services/ # Business logic
│ ├── security/ # Authentication and authorization
│ └── core/ # Configuration and dependencies
├── migrations/ # Alembic database migrations
├── ee/ # Enterprise Edition features
└── config/ # YAML configuration files
```
## Development
The backend runs on **port 1338** by default during local development (configurable via `LEARNHOUSE_PORT`). In production Docker deployments, it runs on port 9000. Install dependencies and run the server:
```bash
uv sync # install dependencies
uv run uvicorn # start the dev server
```
When using the LearnHouse CLI (`learnhouse dev`), the backend starts automatically with hot reload enabled.

View File

@@ -0,0 +1,69 @@
# Frontend Architecture
The LearnHouse frontend is a **Next.js 16** application located at `apps/web` in the project. It serves as the primary user interface for learners, instructors, and administrators.
## Technology Stack
- **Next.js 16.1.6** with the App Router (standalone output)
- **React 19.2.4** with Server Components
- **TypeScript 5.9.3**
- **TailwindCSS v4** for styling
- **Bun** as the package manager
- **Turbopack** for development builds (`next dev --turbopack`)
- **SWR** for client-side data fetching
## Key Dependencies
- **@tiptap/core** -- Block-based rich text editor
- **@radix-ui** -- Accessible, unstyled UI primitives
- **@hocuspocus/provider** -- Real-time collaboration client
- **yjs** -- CRDT library for conflict-free collaborative editing
- **@codemirror** -- Code editor component
- **recharts** -- Charting and data visualization
- **formik / yup** -- Form handling and validation
- **motion** -- Animation library
- **i18next** -- Internationalization
- **wavesurfer.js** -- Audio/podcast player
- **jspdf / html2canvas** -- Certificate generation
- **unsplash-js** -- Unsplash image integration
## App Router
The frontend uses the Next.js App Router, which enables:
- **Server Components by default** -- Pages and layouts render on the server, reducing client-side JavaScript and improving initial load times.
- **Client Components where needed** -- Interactive elements opt into client-side rendering with the `"use client"` directive.
- **Streaming and Suspense** -- Content is progressively streamed to the browser as it becomes ready.
- **Route Groups and Layouts** -- Shared layouts and nested routing keep the codebase organized.
## Authentication
Authentication is handled via **JWT tokens** issued by the FastAPI backend. On login, the backend sets an `access_token_cookie` (HS256, 8-hour expiry) that the frontend attaches to API requests. Protected routes check for a valid session before rendering.
## Communication with the Backend
The frontend communicates with the FastAPI backend over HTTP. API calls are made from both:
- **Server Components** -- Data is fetched at request time on the server, which keeps sensitive tokens off the client.
- **Client Components** -- Interactive features make API calls directly from the browser using **SWR** for caching and revalidation.
## Directory Structure
```
apps/web/
├── app/ # App Router pages and layouts
├── components/ # Reusable UI components
├── services/ # API client and service functions
├── store/ # Client-side state management
└── public/ # Static assets
```
## Development
The frontend runs on **port 3000** during local development. Start the dev server with Turbopack enabled:
```bash
bun dev # runs next dev --turbopack
```
When using the LearnHouse CLI (`learnhouse dev`), the frontend starts automatically with hot reload enabled.

View File

@@ -0,0 +1,36 @@
import { Callout } from 'nextra/components'
import ArchitectureDiagram from '../../../components/ArchitectureDiagram/ArchitectureDiagram'
# Architecture Overview
LearnHouse is a multi-directory project with multiple applications that work together to deliver the full platform experience. The system follows a clear separation of concerns between the frontend, backend, and supporting services.
## Project Structure
```
learnhouse/
├── apps/
│ ├── web/ # Next.js frontend
│ ├── api/ # FastAPI backend
│ ├── collab/ # Hocuspocus collaboration server
│ └── cli/ # LearnHouse CLI
└── community-edition/ # Docker Compose deployment config
```
## How It All Fits Together
The platform consists of four applications backed by two core services:
- **Web (Next.js)** -- The user-facing frontend that communicates with the backend API and the collaboration server.
- **API (FastAPI)** -- The backend that handles authentication, course management, storage, uploads, AI features, and all business logic.
- **Collab (Hocuspocus)** -- A WebSocket server that powers real-time collaborative editing with JWT authentication, Redis persistence, and per-board user limits.
- **CLI (Commander)** -- A command-line tool used for local development and management tasks.
<ArchitectureDiagram />
## Backing Services
LearnHouse relies on two primary backing services:
- **PostgreSQL 16** -- The primary relational database for storing all application data including users, courses, organizations, and activity records. Uses the pgvector extension for AI embedding storage.
- **Redis 7.2** -- Used for caching, session management, collaboration state persistence, and message brokering between services.

View File

@@ -0,0 +1,86 @@
# Supporting Services
LearnHouse relies on several supporting services that run alongside the main applications. In both development and production, these services are managed via Docker (configuration in the `community-edition/` directory).
## PostgreSQL
PostgreSQL 16 (Alpine) is the primary database for LearnHouse. It stores all persistent application data including:
- Organizations and their configurations
- User accounts and authentication records
- Courses, chapters, and activities
- Collections, trails, and progress tracking
- AI vector embeddings (via the pgvector extension)
The backend connects to PostgreSQL through SQLModel. In development, the LearnHouse CLI automatically starts a PostgreSQL container.
**Default port:** `5432`
## Redis
Redis 7.2.3 (Alpine) serves as the caching, session management, and collaboration persistence layer:
- **Caching** -- Reduces database load by storing frequently accessed data in memory.
- **Session storage** -- Manages user session data for fast access.
- **Collaboration state** -- Stores Yjs document state from the Collab server with a 1-hour TTL before it is persisted to PostgreSQL.
- **Pub/Sub** -- Enables communication between services when needed.
**Default port:** `6379`
## Hocuspocus (Collaboration Server)
The Hocuspocus server, located at `apps/collab`, provides real-time collaborative editing capabilities. It is a Node.js + TypeScript application (run via tsx) built on [Hocuspocus](https://hocuspocus.dev/) ^3.0.0, which uses the Yjs CRDT library under the hood. It connects to Redis via ioredis ^5.9.3.
**Default port:** `4000` (configurable via `COLLAB_PORT` env var)
### Authentication
The Collab server performs JWT verification using the same secret as the API backend. On connection, it verifies board membership by making a request to the API.
### Persistence
Document state follows a two-tier persistence strategy:
1. **Redis** -- Yjs state is first stored in Redis with a 1-hour TTL for fast access.
2. **PostgreSQL** -- State is persisted to the database via the API with a 5-second debounce to avoid excessive writes.
### Rate Limiting and Capacity
- **Max 10 concurrent users** per board
- **Rate limiting** of 30 connections per IP per minute
### Key Features
- **Real-time document synchronization** -- Multiple users can edit the same activity simultaneously.
- **Conflict resolution** -- Yjs CRDTs handle concurrent edits without conflicts.
- **Durable persistence** -- Document state survives server restarts through Redis and PostgreSQL.
The frontend connects to Hocuspocus directly over WebSocket using the `@hocuspocus/provider` client for low-latency collaborative editing.
## nginx (Reverse Proxy)
In production deployments, nginx (Alpine) acts as the reverse proxy that routes incoming traffic to the appropriate service:
- Frontend requests go to the Next.js application
- API requests are forwarded to the FastAPI backend
- WebSocket connections for collaboration are routed to the Hocuspocus server
nginx also handles TLS termination and static asset serving in production environments.
## Service Communication
All services communicate over a shared Docker network. The typical request flow is:
```
Client
└── nginx (reverse proxy)
├── web (Next.js frontend, port 3000)
├── api (FastAPI backend, port 9000)
│ ├── PostgreSQL (port 5432)
│ └── Redis (port 6379)
└── collab (Hocuspocus, port 4000)
├── Redis (port 6379)
└── api (port 9000, for persistence & auth)
```
The frontend makes HTTP requests to the backend API. The collaboration server authenticates connections via JWT (shared secret with the API), verifies board membership through the API, and persists document state to both Redis and PostgreSQL (via the API). PostgreSQL is accessed directly only by the backend.

View File

@@ -0,0 +1,5 @@
{
"index": "Overview",
"dev-environment": "Dev Environment",
"guidelines": "Guidelines"
}

View File

@@ -0,0 +1,62 @@
import { Callout } from 'nextra/components'
# Development Environment Setup
The LearnHouse CLI provides a streamlined way to set up and run the entire development environment with a single command.
## Prerequisites
Make sure you have the following installed before proceeding:
- **Docker** (with Docker Compose v2)
- **Node.js 18+**
<Callout type="warning">
Make sure Docker has at least **4GB of RAM** allocated. You can check and adjust this in Docker Desktop under Settings &gt; Resources.
</Callout>
<Callout type="info">
You do **not** need to install Python, uv, Bun, or any other tooling manually. The `npx learnhouse dev` command handles all dependency installation automatically.
</Callout>
## Setup Steps
### 1. Clone the Repository and Start Development
```bash
git clone https://github.com/learnhouse/learnhouse && cd learnhouse && npx learnhouse dev
```
That single command handles everything:
- **Starts backing services** -- PostgreSQL and Redis are launched via Docker Compose.
- **Installs dependencies** -- Python dependencies are installed via `uv` and JavaScript dependencies via `bun`, all automatically.
- **Starts the API** -- The FastAPI backend starts on port 1338 with hot reload.
- **Starts the frontend** -- The Next.js development server starts with `--turbopack` and hot reload.
- **Starts the collaboration server** -- The Hocuspocus collaboration server starts via `tsx watch`.
All services are coordinated automatically so you do not need to manage them individually.
## Accessing the Application
Once `npx learnhouse dev` is running, you can access:
| Service | URL |
| --- | --- |
| Frontend | [http://localhost:3000](http://localhost:3000) |
| API | [http://localhost:1338](http://localhost:1338) |
| API Documentation (Swagger) | [http://localhost:1338/docs](http://localhost:1338/docs) |
<Callout type="info">
The Swagger UI at `/docs` is only available in development mode. Production instances do not expose the interactive API documentation.
</Callout>
## Stopping the Environment
Press `Ctrl+C` in the terminal where `npx learnhouse dev` is running to stop all services.
## Troubleshooting
- **Port conflicts** -- Make sure ports 3000 and 1338 are not in use by other applications.
- **Docker not running** -- Ensure the Docker daemon is started before running `npx learnhouse dev`.
- **Dependency issues** -- The CLI installs all dependencies automatically. If you encounter issues, try deleting `node_modules` and `.venv` directories and re-running `npx learnhouse dev`.

View File

@@ -0,0 +1,86 @@
# Contribution Guidelines
This page outlines the workflow and standards for contributing to LearnHouse.
## Workflow
### 1. Fork and Clone
Fork the [LearnHouse repository](https://github.com/learnhouse/learnhouse) on GitHub, then clone your fork:
```bash
git clone https://github.com/YOUR_USERNAME/learnhouse.git
cd learnhouse
```
### 2. Create a Feature Branch
Always create a new branch for your changes. Use a descriptive branch name:
```bash
git checkout -b feature/your-feature-name
```
Branch naming conventions:
- `feature/` -- New features or enhancements
- `fix/` -- Bug fixes
- `docs/` -- Documentation changes
- `refactor/` -- Code refactoring without behavior changes
### 3. Make Your Changes
Develop your changes locally using the [development environment](/developers/contributing/dev-environment). Keep commits focused and atomic.
When adding or updating dependencies:
- **Frontend** -- Use `bun` to manage JavaScript/TypeScript dependencies (e.g., `bun add <package>`).
- **Backend** -- Use `uv` to manage Python dependencies (e.g., `uv add <package>`).
### 4. Submit a Pull Request
Push your branch to your fork and open a pull request against the `main` branch of the LearnHouse repository:
```bash
git push origin feature/your-feature-name
```
In your pull request description:
- Explain **what** your change does and **why** it is needed.
- Reference any related [GitHub issues](https://github.com/learnhouse/learnhouse/issues).
- Include screenshots or recordings for UI changes.
## Code Style
### Frontend (TypeScript / React)
- Use **TypeScript** for all new code.
- Follow existing patterns in the codebase for component structure and naming.
- Use functional components with hooks.
- Format code consistently -- the project includes configuration for code formatters.
### Backend (Python)
- Follow **PEP 8** conventions.
- Use type hints for function parameters and return values.
- Write clear docstrings for public functions and classes.
- Keep functions focused and concise.
## Testing
- Test your changes locally before submitting a pull request.
- Verify that existing functionality is not broken by your changes.
- For new features, include tests where applicable.
## Review Process
After submitting a pull request:
1. A maintainer will review your code and may request changes.
2. Address any feedback by pushing additional commits to your branch.
3. Once approved, a maintainer will merge your pull request.
## Reporting Issues
If you find a bug or have a feature request, please [open an issue](https://github.com/learnhouse/learnhouse/issues/new) on GitHub. Include as much detail as possible: steps to reproduce, expected behavior, actual behavior, and any relevant logs or screenshots.

View File

@@ -0,0 +1,21 @@
# Contributing to LearnHouse
Thank you for your interest in contributing to LearnHouse! Whether you are fixing a bug, adding a feature, or improving documentation, your contributions are welcome.
## Getting Started
1. **[Set up your development environment](/developers/contributing/dev-environment)** -- Get a local instance of LearnHouse running using the LearnHouse CLI.
2. **[Review the contribution guidelines](/developers/contributing/guidelines)** -- Understand our workflow, code style, and expectations for pull requests.
## Finding Work
The best place to start is the [LearnHouse GitHub issues](https://github.com/learnhouse/learnhouse/issues) page. Look for issues labeled:
- **`help wanted`** -- Issues where community contributions are especially welcome.
- **`good first issue`** -- Smaller, well-scoped tasks ideal for first-time contributors.
If you have an idea for a new feature, open an issue first to discuss it with the maintainers before starting work.
## Questions
If you have questions about contributing, feel free to open a discussion on the [GitHub repository](https://github.com/learnhouse/learnhouse) or reach out to the maintainers through the issue tracker.

View File

@@ -0,0 +1,30 @@
# Developers
Welcome to the LearnHouse developer documentation. This section covers everything you need to understand, build, and contribute to the LearnHouse platform.
## Project Structure
LearnHouse is organized as a monorepo containing four main applications:
| App | Technology | Description |
| --- | --- | --- |
| **web** | Next.js (React) | Frontend web application |
| **api** | FastAPI (Python) | Backend REST API |
| **collab** | Hocuspocus | Real-time collaboration WebSocket server |
| **cli** | Commander (Node.js) | Command-line interface for development and management |
All four apps live under the `apps/` directory in the [LearnHouse repository](https://github.com/learnhouse/learnhouse).
## Sections
### [Architecture](/developers/architecture)
Learn how the different parts of LearnHouse fit together, from the frontend and backend to the supporting services that power the platform.
### [Contributing](/developers/contributing)
Get your local development environment running, understand our contribution workflow, and review code style guidelines.
### [API Reference](/developers/api)
Explore the RESTful API that drives LearnHouse. Covers authentication, key endpoints, and how to interact with the platform programmatically.

View File

@@ -0,0 +1,6 @@
{
"index": "Overview",
"sso": "Single Sign-On",
"audit-logs": "Audit Logs",
"scorm": "SCORM"
}

View File

@@ -0,0 +1,3 @@
{
"index": "Overview"
}

View File

@@ -0,0 +1,47 @@
import { Callout } from 'nextra/components'
# Audit Logs
Audit logs provide a detailed record of all actions taken on the platform, giving administrators full visibility into who did what and when. This is essential for compliance, security monitoring, and troubleshooting.
<Callout>
Audit logs require an Enterprise plan.
</Callout>
## What's Captured
Every mutation (create, update, delete) on the platform is recorded with the following details:
| Field | Description |
|---|---|
| User | Who performed the action (username and ID). |
| Action | The HTTP method (POST, PUT, DELETE, PATCH). |
| Resource | What was affected (e.g., `/courses`, `/users`). |
| Resource ID | The specific item that was modified. |
| Status code | The HTTP response status. |
| IP address | The origin of the request. |
| Timestamp | When the action occurred. |
| Payload | The request body (with sensitive data scrubbed). |
## Sensitive Data Handling
Audit logs automatically scrub sensitive fields from request payloads before storing them. Fields like `password`, `token`, `secret`, and similar keys are redacted to prevent sensitive data from appearing in logs.
## Filtering & Search
You can filter audit logs by:
- User (ID, username, or full name)
- Action type
- Resource type and ID
- HTTP status code
- IP address
- Date range
## CSV Export
Audit logs can be exported as CSV files for offline analysis, compliance reporting, or integration with external SIEM tools.
## Performance
Audit log entries are buffered in Redis and flushed to the database in batches every 60 seconds. This ensures that logging does not impact platform performance, even under heavy usage.

View File

@@ -0,0 +1,22 @@
import { Callout } from 'nextra/components'
# Enterprise Edition
The LearnHouse Enterprise Edition (EE) is a commercially licensed extension of the open-source platform. It includes additional features designed for organizations that need advanced identity management, compliance tooling, and support for industry-standard learning content formats.
## Licensing
The Enterprise Edition is available under a separate **EE license**. It is not covered by the open-source license that governs the core platform.
- **Self-hosted** — The EE features are included in the codebase under `apps/api/ee/` but are locked behind an Enterprise license. You need a valid license key to activate them.
- **LearnHouse Cloud** — Some EE features (like Payments) are available on lower-tier plans. Others (SSO, SCORM, Audit Logs) require an Enterprise plan.
<Callout>
Interested in the Enterprise Edition? Visit [learnhouse.app](https://www.learnhouse.app) to learn more about pricing and licensing.
</Callout>
## Enterprise Features
- **[Single Sign-On (SSO)](/enterprise/sso)** — Authenticate users through external identity providers like WorkOS, Okta, Auth0, Keycloak, or any SAML/OIDC-compatible provider.
- **[Audit Logs](/enterprise/audit-logs)** — A full audit trail of all platform activity for compliance and security monitoring, with filtering and CSV export.
- **[SCORM](/enterprise/scorm)** — Import and run SCORM 1.2 and 2004 learning packages from authoring tools like Articulate Storyline and Adobe Captivate.

View File

@@ -0,0 +1,26 @@
import { Callout } from 'nextra/components'
# SCORM
<Callout>
SCORM support requires an Enterprise plan.
</Callout>
LearnHouse supports importing SCORM (Sharable Content Object Reference Model) packages — the industry standard for e-learning content. Import content from authoring tools like Articulate Storyline, Adobe Captivate, or iSpring and run it directly within your courses.
## Supported Versions
- **SCORM 1.2** — The most widely supported version.
- **SCORM 2004** — Newer version with enhanced sequencing.
## Importing Packages
1. Upload a SCORM `.zip` package to a course.
2. LearnHouse analyzes the package and detects the version, title, and SCOs.
3. Assign SCOs to chapters and import — each SCO becomes a course activity.
You can also import a package as a new course, automatically creating the course structure from the package contents.
## Tracking
Imported SCORM content reports progress back to LearnHouse, including completion status, scores, time spent, and bookmarking for resume support.

View File

@@ -0,0 +1,3 @@
{
"index": "Overview"
}

View File

@@ -0,0 +1,45 @@
import { Callout } from 'nextra/components'
# Single Sign-On (SSO)
LearnHouse supports enterprise Single Sign-On, allowing organizations to authenticate users through their existing identity provider. This means users can log in with their company credentials without creating a separate LearnHouse account.
<Callout>
SSO requires an Enterprise plan.
</Callout>
## Supported Providers
- **WorkOS** — Full implementation with admin portal support.
- **Okta** — OIDC-based authentication.
- **Auth0** — OIDC-based authentication.
- **Keycloak** — Self-hosted identity provider support.
- **Custom SAML** — Connect any SAML-compatible identity provider.
- **Custom OIDC** — Connect any OIDC-compatible identity provider.
## How SSO Works
1. An admin configures SSO in the organization settings, selecting a provider and entering the required credentials.
2. When a user visits the login page, they see an SSO login option if SSO is enabled for that organization.
3. Clicking the SSO button redirects the user to the identity provider's login page.
4. After authenticating with the IdP, the user is redirected back to LearnHouse with an active session.
## User Provisioning
When a user logs in via SSO for the first time, LearnHouse can automatically create their account using profile data from the identity provider:
- **First name, last name, and email** are mapped from the IdP.
- **Avatar** is imported if available.
- **Default role** is assigned based on the SSO configuration (e.g., all new SSO users get the Student role).
Existing users whose email matches are linked automatically — no duplicate accounts are created.
## Configuration Options
| Option | Description |
|---|---|
| Provider | Which identity provider to use. |
| Email domain | Restrict SSO to specific email domains. |
| Auto-provisioning | Automatically create accounts for new SSO users. |
| Default role | Role assigned to newly provisioned users. |
| Admin portal | Some providers (like WorkOS) offer an admin portal for managing the connection directly. |

View File

@@ -1,7 +0,0 @@
{
"content": "Content",
"editor": "Editor",
"ai": "LearnHouse AI",
"user-management": "Users Management",
"trails": "Trails"
}

View File

@@ -1,4 +0,0 @@
{
"students": "Students",
"teachers": "Teachers"
}

View File

@@ -1,13 +0,0 @@
# For students
LearnHouse AI provides different features for students to help them in their learning process.
<br/>
<img style={{borderRadius:10}} quality={100} src="https://www.learnhouse.app/product/ai/screen-ai-1.png" alt="Hello" width={800} height={1300} />
- Chat with activity : Students can chat with the bot and ask questions about the course. The bot will answer the questions and provide the students with the necessary information.
## Context aware
LearnHouse AI is context aware. It can understand the context of the course and the activity and replies accordingly.

View File

@@ -1,16 +0,0 @@
# For teachers
LearnHouse AI provides different features to improve teachers workflow while teaching online & writing content.
<br/>
<img style={{borderRadius:10}} quality={100} src="https://www.learnhouse.app/product/ai/screen-ai-4.png" alt="Hello" width={800} height={1300} />
- Writer : Write content with AI assistance.
- Continue writing : Based on a paragraph or a sentence, AI can continue writing the content.
- Make longer : AI can make the content longer bsed on the text selected.
- Translate : Translate the content to different languages.
## Context aware
LearnHouse AI is context aware. It can understand the context of the content and provide suggestions based on the context of your course and previous paragraphs.

View File

@@ -1,5 +0,0 @@
{
"courses": "Courses",
"collections": "Collections",
"activities": "Activities"
}

View File

@@ -1,5 +0,0 @@
{
"dynamic-pages": "Dynamic Pages",
"documents": "Documents",
"videos": "Videos"
}

View File

@@ -1,5 +0,0 @@
# Documents
Using Document activities, you can upload a document (PDF only for now) and make it part of your course.
This is an important feature that can enhance the learning experience of your students. With this tool, you can provide them with additional resources and reading materials that can help them understand the concepts better.

View File

@@ -1,19 +0,0 @@
# Dynamic pages
Dynamic pages are pages that can contains different types of content at the same time, we call them blocks.
<br/>
<img style={{borderRadius:10}} quality={100} src="/img/pages/activities/editor.png" alt="Hello" width={800} height={1300} />
There is different Blocks for you to choose :
- Callouts : Banners that contains informations, warnings, etc.
- Images : Uploadable Images.
- Video : Uploadable Video Content.
- YouTube Video : Videos from YouTube.
- Math Equations : Equations in LaTeX format.
- PDF Document : PDF files that can be viewed directly from the page.
- Interactive Quiz : Quizzes with questions and answers.
- We’ll add more soon.
We designed the Dynamic Editor to be extremely easy to use and easy to learn, we’re also making it collaborative and up to 5 persons can collaborate on the same page.

View File

@@ -1,5 +0,0 @@
# Video Activities
Video activities serve as valuable resources to enhance the learning experience by providing visual and audio content.
You can either upload your videos or use videos from YouTube. We’ll be adding more video sources later.

View File

@@ -1,15 +0,0 @@
import Image from 'next/image'
import { Callout } from 'nextra/components'
# Collections
Collections is a feature that enables teachers to group and organize courses based on similar themes, topics, or learning objectives.
By using collections, learners can easily navigate through a variety of courses that are relevant to their interests and goals.
<br/>
<Image style={{borderRadius:10}} quality={100} src="/img/pages/collections/collections.png" alt="Hello" width={800} height={500} />
Furthermore, collections can be used to create personalized learning paths that cater to the unique needs and preferences of individuals (will be supported in a future update)
With collections, users can also save time and effort by accessing all relevant courses in one place, instead of having to search for them individually. In addition, collections can serve as a tool for instructors and administrators to provide a more structured and coherent learning experience to their learners, by grouping courses in a logical and meaningful way.

View File

@@ -1,35 +0,0 @@
import { Callout } from 'nextra/components'
import { Cards } from 'nextra/components'
import Image from 'next/image'
# Courses
Courses are a fundamental feature of LearnHouse, they should contain chapters and chapters contains activities.
<br/>
<img style={{borderRadius:10}} quality={100} src="/img/pages/courses/courses.png" alt="Hello" width={800} height={1300} />
There is a wide variety of Activities types to choose from, and we are constantly adding more.
<Cards>
<Cards.Card icon={<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" />
</svg>
} title="Videos" href="/features/activities/videos">
</Cards.Card>
<Cards.Card icon={<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" />
</svg>
} title="Dynamic Pages" href="/features/activities/dynamic-pages">
</Cards.Card>
<Cards.Card icon={<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" />
</svg>
} title="Documents" href="/features/activities/documents">
</Cards.Card>
</Cards>
Courses can be part of a Collection, saving users time and effort by accessing all relevant courses in one place, instead of having to search for them individually. In addition, collections can serve as a tool for instructors and administrators to provide a more structured and coherent learning experience to their learners, by grouping courses in a logical and meaningful way.
When **Starting a new Course**, progression data is stored in your Trail including Quizzes data and Assignments. (Coming soon)

View File

@@ -1,21 +0,0 @@
# Blocks
Blocks are content elements that can be added to a page. They can be any type of content, videos, text, images, quizzes etc.
Blocks can be added to a page in any order and can be rearranged as needed.
<br/>
<img style={{borderRadius:10}} quality={100} src="https://www.learnhouse.app/product/screen-2.png" alt="Hello" width={800} height={500} />
<br/>
## Block types
- **Text** : Add text to your page
- **Image** : Add images to your page
- **Callouts** (Info, Warning) : Callouts are used to highlight important information
- **Video** (Youtube, Hosted) : Videos can be added to your page, either from Youtube or hosted on Learnhouse
- **Quiz** : Inline quizzes can be added to your page
- **Code** : Code blocks that supports syntax highlighting for multiple languages
- **File** : Show PDF files on your page
- **Math** : Math equations can be added to your page
- **Tables** (Soon)
- **Audio** (Soon)
- **Embed** (Soon)

View File

@@ -1,6 +0,0 @@
# Live Collaboration
Collaborate with your team in real-time. See who is editing a document, and what they are changing.
<br/>
<img style={{borderRadius:10}} quality={100} src="/img/pages/editor/multi.png" alt="Hello" width={800} height={500} />

View File

@@ -1,15 +0,0 @@
import { Callout } from 'nextra/components'
import { Cards } from 'nextra/components'
import Image from 'next/image'
# Trails
<br/>
<img style={{borderRadius:10}} quality={100} src="/img/pages/trails/trails.png" alt="Hello" width={800} height={500} />
Trails are a key feature on Learnhouse that enables teachers & students to track their progress through Courses.
By using Trails, teachers can effectively use quiz results and text-based course progression to tailor feedback in-person & remotely. It also lets students keep a track of their own progression through the course, and encourage increased self-determination & confidence.

View File

@@ -1,3 +0,0 @@
{
"users-and-access": "Users & Access"
}

View File

@@ -1,14 +0,0 @@
import Image from 'next/image'
# Users management
You can manage users from the admin dashboard. You can add, remove, and edit users. You can also assign roles to users.
<br/>
<img style={{borderRadius:10}} quality={100} src="https://www.learnhouse.app/product/screen-4.png" alt="Hello" width={800} height={500} />
- Users : Add new users, remove users, and edit their roles and permissions.
- Invite users : Invite new users to join your organization by sending them an email and assigning them to a UserGroup.
- Signup Acess : Enable or disable the signup access for new users, if disabled only userd with an invite code can join the organization.

View File

@@ -0,0 +1,6 @@
{
"index": "Overview",
"quickstart": "Quickstart",
"cloud-vs-self-hosting": "Cloud vs Self Hosting",
"key-concepts": "Key Concepts"
}

View File

@@ -0,0 +1,59 @@
import { Callout } from 'nextra/components'
# Cloud vs Self Hosting
LearnHouse is open-source software. You can use the managed **LearnHouse Cloud** platform or deploy the **Community Edition** on your own infrastructure. This page explains the differences so you can make an informed choice.
## Comparison
| | ☁️ LearnHouse Cloud | 🖥️ Self Hosting |
| ---------------------------- | ------------------------------------------------- | -------------------------------- |
| 🌍 Worldwide CDN | ✅ Included | ⚙️ Manual setup + additional cost |
| 🔄 Weekly updates | ✅ Automatic | 🔧 Manual |
| 🛠️ Maintenance | ✅ Managed by the LearnHouse team | 👤 Your responsibility |
| 🔒 Security patches | ✅ Applied automatically | 🔧 Manual |
| 📊 Threat & uptime monitoring | ✅ Included | ❌ Not included |
| 🔐 SSL certificate | ✅ Included | 🔧 Manual |
| 💾 Continuous backups | ✅ Included | ⚙️ Manual + additional cost |
| 📈 Scalability | ✅ Automatic | ⚙️ Depends on your provider |
| 🖥️ Direct SSH & DB access | ❌ Not available | ✅ Full access |
| 🎧 Product support | ✅ Email support | 👥 Community support |
| 💚 Where your money goes | ✅ Supporting the team and funding new features | 🏢 Third-party hosting companies |
## ☁️ When to choose LearnHouse Cloud
**Best for:** teams, organizations, and businesses that want to focus on content and learners — not infrastructure.
- **Launch in minutes** — no servers to provision, no DevOps overhead. Your team can start building courses immediately.
- **Zero-maintenance operations** — updates, security patches, SSL certificates, and backups are handled automatically by the LearnHouse team.
- **Enterprise-grade reliability** — global CDN, threat monitoring, uptime guarantees, and automatic scaling out of the box.
- **Priority support** — dedicated email support with faster response times for production issues.
- **Invest in the product** — your subscription directly funds development of new features and improvements for the entire LearnHouse ecosystem.
<Callout type="info">
LearnHouse Cloud is the recommended option for most organizations. It eliminates operational complexity and lets your team focus entirely on creating great learning experiences.
</Callout>
## 🖥️ When to choose Self Hosting
**Best for:** enterprises, institutions, and teams with strict infrastructure requirements and dedicated engineering resources.
- **Full data sovereignty** — host on your own infrastructure with complete control over where data lives. Ideal for organizations with data residency mandates.
- **Regulatory compliance** — meet on-premises hosting requirements for HIPAA, SOC 2, internal security policies, or government regulations.
- **Deep infrastructure access** — direct SSH, database access, and full control over networking, storage, and compute resources.
- **Custom integrations** — connect to internal systems, private networks, SSO providers, and proprietary tooling without restrictions.
- **Dedicated engineering teams** — organizations with DevOps or platform engineering teams that prefer to own their deployment pipeline.
<Callout type="warning">
Self hosting requires your team to manage updates, backups, security patches, and scaling. Make sure you have the engineering capacity before choosing this path.
</Callout>
<Callout type="info">
Both options give you access to the same core feature set. Self-hosted instances can be upgraded at any time by pulling the latest release from the [Community Edition repository](https://github.com/learnhouse/community-edition).
</Callout>
## Next steps
- Ready to get started? Head to the [Quickstart](/getting-started/quickstart).
- Want to try the cloud platform? Visit [learnhouse.app](https://learnhouse.app) to create your account.
- Need help configuring a self-hosted instance? See the [Self Hosting Guide](/self-hosting/hosting-guide).

View File

@@ -0,0 +1,25 @@
import { Callout } from 'nextra/components'
# Getting Started
Welcome to LearnHouse — an open-source learning management system for creating and delivering modern educational content.
This section will help you go from zero to a working LearnHouse setup, whether you choose our managed cloud platform or a self-hosted deployment.
## What you will learn
- **[Quickstart](/getting-started/quickstart)** — Get up and running in minutes with LearnHouse Cloud or the self-hosted CLI.
- **[Cloud vs Self Hosting](/getting-started/cloud-vs-self-hosting)** — Understand the trade-offs so you can pick the right deployment model.
- **[Key Concepts](/getting-started/key-concepts)** — Learn the core building blocks: organizations, courses, activities, collections, trails, and the editor.
<Callout>
If you already know how you want to deploy, jump straight to the [Quickstart](/getting-started/quickstart).
</Callout>
## Next steps
Once you have a running instance and understand the basics, explore the rest of the documentation:
- [Platform Guide](/platform) — Deep dive into courses, the editor, AI features, and user management.
- [Self Hosting](/self-hosting) — Configuration, content storage, AI setup, and organization hosting modes.
- [Developers](/developers) — Architecture overview, API reference, and contributing guide.

View File

@@ -0,0 +1,38 @@
import { Callout } from 'nextra/components'
# Key Concepts
This page introduces the core building blocks of LearnHouse. Understanding these concepts will help you navigate the platform and structure your content effectively.
## Organizations
An **organization** is the top-level tenant in LearnHouse. Each organization has its own courses, users, settings, and branding. A single LearnHouse instance can host multiple organizations, making it well-suited for multi-tenant deployments such as schools, companies, or platform providers.
## Courses
A **course** is the primary unit of content. Every course contains one or more **chapters**, and each chapter contains one or more **activities**. Think of a course as a structured curriculum that guides learners from start to finish.
## Activities
An **activity** is a single piece of learning content inside a chapter. LearnHouse supports several activity types:
- **Dynamic pages** — Rich, block-based pages built with the LearnHouse editor.
- **Videos** — Hosted video content with playback tracking.
- **Documents** — PDF and other document uploads for reference material.
- **Quizzes** — Assessments that test learner understanding and feed into progress tracking.
## Collections
A **collection** groups related courses together. Collections make it easy for learners to discover all courses on a particular topic and for instructors to present a structured learning path across multiple courses.
## Trails
A **trail** tracks a learner's progress through a course. It records completed activities, quiz results, and overall advancement. Teachers can use trail data to monitor student performance, while learners can see their own progress and pick up where they left off.
## Editor
LearnHouse includes a block-based **WYSIWYG editor** for authoring dynamic page activities. The editor supports a variety of block types — text, headings, images, code, callouts, embeds, and more — and offers real-time collaborative editing so multiple authors can work on the same page simultaneously.
<Callout>
For a deeper look at each of these features, explore the [Platform Guide](/platform) and the [Features](/features) documentation.
</Callout>

View File

@@ -0,0 +1,64 @@
import { Callout } from 'nextra/components'
# Quickstart
There are two ways to start using LearnHouse: the managed **LearnHouse Cloud** or a **self-hosted** deployment. Pick the path that suits your needs.
---
## Option A — LearnHouse Cloud
The fastest way to get started. No infrastructure to manage.
1. **Sign up** — Create an account at [learnhouse.app](https://learnhouse.app).
2. **Create an organization** — After signing in, create your first organization. This is the top-level container for all of your courses, users, and settings.
3. **Create your first course** — Inside the organization dashboard, click **New Course**, give it a title, and start adding chapters and activities.
You are ready to go. LearnHouse Cloud handles hosting, updates, backups, and SSL for you.
<Callout>
Not sure whether Cloud or self-hosting is right for you? See the [Cloud vs Self Hosting](/getting-started/cloud-vs-self-hosting) comparison.
</Callout>
---
## Option B — Self-Hosted
Run LearnHouse on your own infrastructure using the LearnHouse CLI. You'll need [Docker](https://docs.docker.com/get-docker/) and [Node.js](https://nodejs.org/) (v18+) installed.
### 1. Run the setup wizard
```bash
npx learnhouse@latest setup
```
The interactive wizard walks you through domain configuration, database setup, admin account creation, and optional features (AI, email, storage, OAuth).
### 2. Start LearnHouse
```bash
npx learnhouse start
```
Your instance will be available at `http://localhost` (or the domain you configured during setup).
### 3. Manage your instance
```bash
npx learnhouse stop # Stop all services
npx learnhouse logs # Stream logs
npx learnhouse backup # Backup database
npx learnhouse doctor # Run diagnostics
```
<Callout type="info">
For detailed installation options, see the [Quick Install](/self-hosting/installation/quick-install) guide. For environment variables and configuration, see [Configuration](/self-hosting/configuration).
</Callout>
---
## What to do next
- Familiarize yourself with the [Key Concepts](/getting-started/key-concepts) — organizations, courses, activities, and more.
- Explore the [Editor](/platform/editor) to see how content authoring works.
- Set up [AI features](/self-hosting/configuration/ai-setup) if you want built-in AI assistance for students and teachers.

View File

@@ -1,22 +1,46 @@
# Getting started with LearnHouse
import { Callout } from 'nextra/components'
import HomeCards from '../components/HomeCards/HomeCards'
import FeaturesGrid from '../components/FeaturesGrid/FeaturesGrid'
## What is LearnHouse?
<img src="/img/pages/learnhouse-github.png" alt="LearnHouse" className="no-border" style={{ borderRadius: '12px', marginBottom: '2rem' }} />
LearnHouse is an open source LMS (learning management system) platform that makes it easy for anyone to provide world class educational content. One of the main features is that it offers a variety of content types: Dynamic Pages, Videos, Documents & more..
<HomeCards />
<br/>
<img quality={100} src="/img/pages/features.png" alt="Hello" />
## Platform Features
## Features
<FeaturesGrid />
- 📄✨ Dynamic Notion-like WYSIWYG pages
- 👨‍🎓 Easy & simple to use
- 👥 Multi-Organizational
- 📹 Supports Uploadable Videos and external videos like YouTube
- 📄 Supports documents like PDF
- 🍱 Course Collections
- 🙋 Interactive Quizzes
- 👟 Overall course progress
- ⚡ (Incoming) Live Collaboration
- More to come
## Tech Stack
| Layer | Technology |
| --- | --- |
| Frontend | Next.js 16, React 19, Tailwind CSS v4, Tiptap |
| Backend | FastAPI, Python, SQLModel, Alembic |
| Collaboration | Hocuspocus (Yjs/CRDT) |
| Database | PostgreSQL 16 + pgvector |
| Cache | Redis 7.2 |
| AI | Google Gemini, LlamaIndex |
| CLI | Commander (Node.js) |
<Callout type="info">
New to LearnHouse? Start with the [Quickstart guide](/getting-started/quickstart) to get a running instance in under 5 minutes.
</Callout>
## Explore by Topic
### For Educators & Admins
- [Creating Courses](/platform/courses) — Chapters, activities, and collections
- [Using the Editor](/platform/editor) — Blocks, collaboration, and content creation
- [AI Features](/platform/ai) — AI tutoring for students and teaching assistants
- [User Management](/platform/users) — Roles, permissions, and authentication
- [Organizations](/platform/organizations) — Multi-tenancy and org settings
### For DevOps & Self-Hosters
- [Quick Install](/self-hosting/installation/quick-install) — One command setup with `npx learnhouse@latest setup`
- [Configuration](/self-hosting/configuration) — Environment variables, AI, email, and storage
- [Maintenance](/self-hosting/maintenance) — Updates, backups, monitoring, and troubleshooting
### For Developers
- [Architecture Overview](/developers/architecture) — How the system fits together
- [API Reference](/developers/api) — REST endpoints, authentication, and examples
- [Contributing](/developers/contributing) — Dev environment setup and guidelines

View File

@@ -0,0 +1,18 @@
{
"index": "Overview",
"courses": "Courses",
"editor": "Editor",
"assignments": "Assignments",
"code-execution": "Code Execution",
"playgrounds": "Playgrounds",
"discussions": "Discussions",
"boards": "Boards",
"podcasts": "Podcasts",
"certifications": "Certifications",
"analytics": "Analytics",
"search": "Search",
"payments": "Payments",
"ai": "AI",
"users": "Users & Access",
"organizations": "Organizations"
}

View File

@@ -0,0 +1,5 @@
{
"index": "Overview",
"for-students": "For Students",
"for-teachers": "For Teachers"
}

View File

@@ -0,0 +1,20 @@
# AI for Students
Students can interact with the LearnHouse AI assistant while working through course content. The AI acts as an on-demand tutor that understands the material being studied.
## Context-Aware Chat
When a student opens the AI chat from within a course or activity, the assistant automatically has context about:
- The current activity content
- The broader course material
- The chapter structure and related topics
This allows students to ask questions and receive answers that are directly relevant to what they are studying, rather than generic responses.
## Example Use Cases
- **Clarifying concepts** — Ask the AI to explain a topic from the current lesson in different terms.
- **Summarizing content** — Request a summary of a long activity or chapter.
- **Practice questions** — Ask the AI to generate practice questions based on the current material.
- **Deeper exploration** — Explore related topics that build on the course content.

View File

@@ -0,0 +1,23 @@
# AI for Teachers
The LearnHouse AI assistant helps teachers create and manage course content more efficiently.
## Content Creation Assistance
Teachers can use the AI to accelerate the course-building process:
- **Draft generation** — Generate initial drafts for activity content based on a topic or outline.
- **Content improvement** — Refine existing content for clarity, tone, or completeness.
- **Quiz creation** — Generate quiz questions based on the course material.
## Course Management
Beyond content creation, the AI can assist with organizing and structuring courses:
- Suggest how to break a topic into chapters and activities.
- Identify gaps in course coverage.
- Recommend improvements based on the existing content structure.
## Getting Started
The AI assistant is available from the course editor interface. Make sure your organization has an OpenAI API key configured in the [organization settings](/platform/organizations/settings).

View File

@@ -0,0 +1,18 @@
import { Callout } from 'nextra/components'
# AI
LearnHouse includes a context-aware AI assistant powered by OpenAI. The AI understands the content of your courses and activities, enabling it to provide relevant, targeted assistance to both students and teachers.
## How It Works
The AI assistant operates at the course and activity level. It reads the content of the current course or activity to provide contextually accurate responses. This means answers are grounded in your actual teaching material rather than generic knowledge.
<Callout>
AI features require an OpenAI API key to be configured in your organization settings. See [Organization Settings](/platform/organizations/settings) for details.
</Callout>
## Learn More
- [AI for Students](/platform/ai/for-students) — How students use the AI assistant during learning.
- [AI for Teachers](/platform/ai/for-teachers) — How teachers leverage AI for content creation and course management.

View File

@@ -0,0 +1,3 @@
{
"index": "Overview"
}

View File

@@ -0,0 +1,27 @@
import { Callout } from 'nextra/components'
# Analytics
LearnHouse provides analytics to help administrators and teachers understand how learners engage with content. Analytics track user activity, course engagement, and platform usage.
<Callout>
Analytics must be enabled in your [Organization Settings](/platform/organizations/settings) to be available.
</Callout>
## What's Tracked
- **User engagement** — Activity views, time spent, and interaction patterns.
- **Course analytics** — Which courses and activities are most popular and how students progress through them.
- **Organization-level metrics** — Overall platform usage and growth trends.
## How Analytics Work
Events are tracked as users interact with the platform — viewing activities, completing courses, submitting assignments, and more. These events are aggregated into dashboards accessible from the admin panel.
## Accessing Analytics
Administrators can access the global analytics dashboard from the organization admin panel. Analytics data is scoped to the current organization, so each organization sees only its own data.
<Callout>
Analytics uses event caching for performance. Data may take a short time to reflect the most recent activity.
</Callout>

View File

@@ -0,0 +1,4 @@
{
"index": "Overview",
"grading": "Grading & Submissions"
}

View File

@@ -0,0 +1,26 @@
import { Callout } from 'nextra/components'
# Grading & Submissions
LearnHouse provides a straightforward grading workflow for teachers to review and score student submissions.
## Submission Flow
1. A teacher creates an assignment with one or more tasks.
2. Students complete each task and submit their work (text, files, or code).
3. The teacher reviews submissions and assigns grades per task.
4. Grades are aggregated at the assignment level and reflected in the student's Trail.
## Grading Options
- **Task-level grading** — Assign a score to each individual task within an assignment.
- **Assignment-level grading** — Review and finalize the overall assignment grade.
- **Bulk review** — View all submissions for a task across students to compare and grade efficiently.
## Submission Status
Each submission is tracked with a status so teachers can see at a glance which students have submitted, which are pending, and which have been graded.
<Callout>
Submissions are tied to the student's Trail, so all grading data contributes to the overall course progress view.
</Callout>

View File

@@ -0,0 +1,25 @@
import { Callout } from 'nextra/components'
# Assignments
Assignments let teachers create assessable tasks within courses. Students submit their work, and teachers can review and grade submissions individually or in bulk.
## How Assignments Work
Each assignment is linked to a course activity and can contain one or more tasks. Students complete tasks, upload files, or write code, and then submit their work for grading.
<Callout>
Assignments must be enabled in your [Organization Settings](/platform/organizations/settings) to be available.
</Callout>
## Key Features
- **Multi-task assignments** — Break assignments into individual tasks, each with its own submission and grade.
- **File uploads** — Students can attach files as part of their submission.
- **Submission tracking** — Teachers see submission status for each student and task.
- **Grading** — Grade individual tasks or entire assignments. Scores are recorded in the student's [Trail](/platform/courses/trails).
## Learn More
- [Grading & Submissions](/platform/assignments/grading) — How the grading workflow works.
- [Code Execution](/platform/code-execution) — Auto-graded coding assignments with multi-language support.

View File

@@ -0,0 +1,3 @@
{
"index": "Overview"
}

View File

@@ -0,0 +1,26 @@
import { Callout } from 'nextra/components'
# Boards
Boards are collaborative documents that multiple users can edit together in real time. They use the same block-based editor as course activities but are designed for freeform collaboration outside the course structure.
<Callout>
Boards must be enabled in your [Organization Settings](/platform/organizations/settings) to be available.
</Callout>
## How Boards Work
A board is a shared document with real-time synchronization powered by Yjs. Multiple users can view and edit a board simultaneously, with changes synced instantly across all participants.
## Key Features
- **Real-time collaboration** — Multiple users can edit a board at the same time with live cursor tracking and instant sync.
- **Role-based access** — Board members can be assigned roles: **Owner**, **Editor**, or **Viewer**.
- **Block-based editing** — Boards use the same rich block editor as course activities, supporting text, media, and advanced blocks.
- **Member management** — Board owners can invite members and manage their access levels.
## Use Cases
- **Group projects** — Students collaborate on shared documents for team assignments.
- **Meeting notes** — Teachers and staff maintain shared notes for planning and coordination.
- **Brainstorming** — Teams use boards as collaborative whiteboards for idea generation.

View File

@@ -0,0 +1,3 @@
{
"index": "Overview"
}

View File

@@ -0,0 +1,20 @@
# Certifications
LearnHouse can generate certificates when students complete a course, providing formal recognition of their learning achievements.
## How Certifications Work
When a student completes all activities in a course, a certification record is created and linked to their profile. Teachers and administrators can manage certifications at the course level.
## Key Features
- **Automatic generation** — Certificates are generated when a student's Trail shows full course completion.
- **Course-level configuration** — Each course can have certifications enabled or disabled.
- **Certificate retrieval** — Students can view and access their earned certificates from their profile.
- **Verification** — Each certificate has a unique identifier that can be used for verification.
## Use Cases
- **Professional development** — Issue certificates for compliance training or continuing education.
- **Academic programs** — Provide completion certificates for course series or learning paths.
- **Skill validation** — Give students a shareable credential they can reference externally.

View File

@@ -0,0 +1,33 @@
import { Callout } from 'nextra/components'
# Code Execution
LearnHouse integrates with Judge0 to provide sandboxed code execution for coding assignments. Students can write and run code directly in the platform, and teachers can define test cases for automatic grading.
## Supported Languages
The code execution engine supports 30+ programming languages including Python, JavaScript, Java, C, C++, Go, Rust, Ruby, and many more.
## How It Works
1. A teacher creates an assignment task with one or more test cases (input/output pairs).
2. Students write their solution in the built-in code editor.
3. On submission, the code is executed against all test cases in a sandboxed environment.
4. Results are reported per test case — pass/fail, execution time, and memory usage.
## Test Cases
Each test case defines:
- **Input** — The standard input provided to the program.
- **Expected Output** — The output the program should produce.
The system runs the student's code against each test case and compares the actual output to the expected output.
<Callout>
Code execution requires a Judge0 instance to be configured. See the [Self-Hosting Configuration](/self-hosting/configuration) for setup details.
</Callout>
## Batch Execution
For assignments with multiple test cases, the platform executes all test cases in a single batch request, providing a comprehensive results summary that shows which tests passed and which failed.

View File

@@ -0,0 +1,6 @@
{
"index": "Overview",
"chapters-and-activities": "Chapters & Activities",
"collections": "Collections",
"trails": "Trails"
}

View File

@@ -0,0 +1,33 @@
import { Callout } from 'nextra/components'
# Chapters and Activities
Courses in LearnHouse follow a clear hierarchy: **Course → Chapters → Activities**. This structure keeps content organized and gives students a logical path through the material.
## Chapters
Chapters are the top-level groupings within a course. Use them to break your course into modules, units, or topics. You can reorder chapters at any time from the course editor.
## Activities
Activities are the individual pieces of content within a chapter. Each activity has a specific type that determines how content is presented to students.
### Dynamic Pages
Dynamic Pages use the built-in block-based editor to create rich, interactive content. You can combine text, images, code blocks, callouts, embeds, and more in a single page. This is the most flexible activity type.
### Videos
Video activities let you upload video files directly to LearnHouse or embed videos from YouTube and other external platforms. Uploaded videos are served through LearnHouse's media pipeline.
### Documents
Document activities display PDF files using a built-in viewer. Upload a PDF and students can read it directly within the platform without downloading.
### Quizzes
Quiz activities provide interactive assessments. Teachers can create questions and review student results. Quiz data is recorded in the student's [Trail](/platform/courses/trails) for progress tracking.
<Callout>
You can mix and match activity types within a single chapter to create a varied learning experience.
</Callout>

View File

@@ -0,0 +1,15 @@
# Collections
Collections let you group related courses together, making it easier for students to discover and navigate structured learning paths.
## Use Cases
- **Learning Paths** — Arrange courses in a recommended sequence so students know what to take and in what order.
- **Curricula** — Bundle all courses for a program, department, or certification into a single collection.
- **Categorization** — Organize courses by topic, difficulty level, or audience.
## How Collections Work
A collection is simply a named group of courses. Each course can belong to one or more collections. When students browse a collection, they see all the included courses in the order you define.
To create a collection, go to your organization dashboard and select **Collections**. From there you can name the collection, add courses, and arrange their order.

View File

@@ -0,0 +1,25 @@
import { Callout } from 'nextra/components'
# Courses
Courses are the core content unit in LearnHouse. Each course is made up of chapters, and each chapter contains activities that students work through.
<br/>
<img style={{borderRadius:10}} quality={100} src="/img/pages/courses/courses.png" alt="Courses overview" width={800} height={1300} />
## Activity Types
LearnHouse supports several activity types to accommodate different teaching styles:
- **Dynamic Pages** — Rich WYSIWYG content built with the block-based editor.
- **Videos** — Upload video files directly or embed from YouTube and other external sources.
- **Documents** — PDF documents displayed with a built-in viewer.
- **Quizzes** — Interactive assessments to test student understanding.
## Getting Started
To create a course, navigate to your organization dashboard and select **Create Course**. From there you can add chapters, populate them with activities, and publish when ready.
<Callout>
Courses can be grouped into [Collections](/platform/courses/collections) for better organization, and student progress is tracked via [Trails](/platform/courses/trails).
</Callout>

View File

@@ -0,0 +1,24 @@
import { Callout } from 'nextra/components'
# Trails
Trails let students track their progress through courses, providing a clear view of what they have completed and what is left.
<br/>
<img style={{borderRadius:10}} quality={100} src="/img/pages/trails/trails.png" alt="Trails overview" width={800} height={500} />
## How Trails Work
When a student starts a course, a Trail is automatically created for them. As they work through activities, their progress is recorded — including activity completions and quiz submissions.
Students can view their Trail at any time to see:
- Which activities they have completed
- Quiz results and scores
- Overall course progression
This encourages self-directed learning and helps students stay on track.
<Callout>
A Trail is created automatically when a student starts a course. All quiz submissions and progression data are recorded in the Trail.
</Callout>

View File

@@ -0,0 +1,4 @@
{
"index": "Overview",
"comments": "Comments & Reactions"
}

View File

@@ -0,0 +1,23 @@
# Comments & Reactions
Comments and reactions are the primary ways users engage with discussion threads.
## Comments
Any member of the organization can reply to a discussion with a comment. Comments support text content and are displayed in chronological order within the thread.
### Voting on Comments
Comments can be upvoted by other users. This helps surface the most helpful or relevant replies within a discussion. Vote counts are displayed alongside each comment.
## Reactions
Reactions let users respond to discussions quickly with emoji reactions. Multiple users can add the same reaction, and the count is displayed on the discussion.
## Moderation
Teachers and admins have additional controls over discussions:
- **Pin** a discussion to keep it at the top of the list.
- **Lock** a discussion to prevent further comments.
- **Delete** comments or discussions that violate guidelines.

View File

@@ -0,0 +1,25 @@
import { Callout } from 'nextra/components'
# Discussions
Discussions provide a community space within your organization where students and teachers can ask questions, share ideas, and collaborate outside of course content.
## How Discussions Work
Discussions are organized within communities tied to your organization. Users can create threads, reply with comments, vote on posts and comments, and react with emojis.
<Callout>
Discussions must be enabled in your [Organization Settings](/platform/organizations/settings) to be available.
</Callout>
## Key Features
- **Threaded conversations** — Create discussion topics and reply with comments for focused conversations.
- **Voting** — Upvote discussions and comments to surface the most helpful content.
- **Reactions** — React to discussions with emojis to provide quick feedback.
- **Pinning & locking** — Teachers and admins can pin important discussions or lock threads that have been resolved.
- **Labels** — Categorize discussions with labels for easy filtering and discovery.
## Learn More
- [Comments & Reactions](/platform/discussions/comments) — Engaging with discussion threads.

View File

@@ -0,0 +1,4 @@
{
"index": "Overview",
"blocks": "Blocks"
}

View File

@@ -0,0 +1,91 @@
import {
Paragraph,
TextHOne,
TextHTwo,
TextHThree,
TextHFour,
TextHFive,
TextHSix,
ListBullets,
ListNumbers,
CodeBlock,
Image,
Video,
SpeakerHigh,
FilePdf,
Globe,
Browser,
Question,
Terminal,
Sparkle,
MathOperations,
Cards,
FlowArrow,
Tag,
Info,
Warning,
Table,
Minus,
} from '@phosphor-icons/react/dist/ssr'
export const Block = ({ icon: Icon, name, description }) => (
<li style={{ display: 'flex', alignItems: 'center', gap: 8, listStyle: 'none' }}>
<Icon size={18} weight="fill" style={{ flexShrink: 0, opacity: 0.6 }} />
<span><strong>{name}</strong> — {description}</span>
</li>
)
# Blocks
The LearnHouse editor supports a wide range of block types for building rich course content. You can insert any block by typing `/` and selecting from the menu.
## Text Blocks
<ul style={{ listStyle: 'none', padding: 0, display: 'flex', flexDirection: 'column', gap: 8 }}>
<Block icon={Paragraph} name="Paragraph" description="Standard body text with full inline formatting support." />
<Block icon={TextHOne} name="Heading 1" description="Top-level heading for major sections." />
<Block icon={TextHTwo} name="Heading 2" description="Second-level heading for subsections." />
<Block icon={TextHThree} name="Heading 3" description="Third-level heading for smaller sections." />
<Block icon={TextHFour} name="Heading 4" description="Fourth-level heading." />
<Block icon={TextHFive} name="Heading 5" description="Fifth-level heading." />
<Block icon={TextHSix} name="Heading 6" description="Sixth-level heading." />
<Block icon={ListBullets} name="Bullet List" description="Unordered list for grouping items." />
<Block icon={ListNumbers} name="Numbered List" description="Ordered list for sequential items." />
<Block icon={CodeBlock} name="Code Block" description="Syntax-highlighted code with language selection." />
</ul>
## Media Blocks
<ul style={{ listStyle: 'none', padding: 0, display: 'flex', flexDirection: 'column', gap: 8 }}>
<Block icon={Image} name="Image" description="Upload images or insert by URL." />
<Block icon={Video} name="Video" description="Upload video files or embed from YouTube and other sources." />
<Block icon={SpeakerHigh} name="Audio" description="Upload or embed audio content." />
<Block icon={FilePdf} name="PDF" description="Embed PDF documents with a built-in viewer." />
<Block icon={Globe} name="Embed" description="Embed external content via URL (iframes)." />
<Block icon={Browser} name="Web Preview" description="Preview a web page with metadata." />
</ul>
## Interactive Blocks
<ul style={{ listStyle: 'none', padding: 0, display: 'flex', flexDirection: 'column', gap: 8 }}>
<Block icon={Question} name="Quiz" description="Interactive quiz with questions to test understanding." />
<Block icon={Terminal} name="Code Playground" description="Runnable code with test cases and execution." />
<Block icon={Sparkle} name="Magic Block" description="AI-generated interactive content." />
<Block icon={MathOperations} name="Math Equation" description="Render mathematical notation using LaTeX syntax." />
<Block icon={Cards} name="Flip Card" description="Flashcard for learning and memorization." />
<Block icon={FlowArrow} name="Scenarios" description="Interactive branching scenarios with choices." />
</ul>
## UI Blocks
<ul style={{ listStyle: 'none', padding: 0, display: 'flex', flexDirection: 'column', gap: 8 }}>
<Block icon={Info} name="Callout Info" description="Information callout box for tips and notes." />
<Block icon={Warning} name="Callout Warning" description="Warning callout box for important alerts." />
<Block icon={Tag} name="Badge" description="Styled badge or label element." />
<Block icon={Table} name="Table" description="Resizable tables for structured data." />
<Block icon={Minus} name="Divider" description="Horizontal rule to visually separate sections." />
</ul>
## Using Blocks
Each block can be individually moved, duplicated, or deleted. Click the handle on the left side of a block to drag it to a new position, or use the block menu for additional options.

View File

@@ -0,0 +1,14 @@
# Editor
LearnHouse includes a block-based WYSIWYG editor for creating course content. The editor provides a Notion-like experience where you build pages by stacking and arranging content blocks.
## Key Features
- **Block-based editing** — Each piece of content (paragraph, image, code snippet) is an independent block that you can move, duplicate, or delete.
- **Rich formatting** — Full text formatting including bold, italic, links, and inline code.
- **Drag and drop** — Rearrange blocks by dragging them into the desired position.
- **Slash commands** — Type `/` to quickly insert any block type.
## Learn More
- [Available Blocks](/platform/editor/blocks) — See all the block types you can use.

View File

@@ -0,0 +1,20 @@
# Platform Overview
This section covers all the features and capabilities of the LearnHouse platform. Whether you are a student, teacher, or administrator, you will find detailed documentation on every aspect of the system here.
## Sections
- **[Courses](/platform/courses)** — Create and manage courses, chapters, activities, collections, and trails.
- **[Editor](/platform/editor)** — A block-based WYSIWYG editor for building rich course content.
- **[Assignments](/platform/assignments)** — Assessable tasks with grading, submissions, and auto-graded code execution.
- **[Playgrounds](/platform/playgrounds)** — Interactive code environments for hands-on practice and experimentation.
- **[Discussions](/platform/discussions)** — Community discussion threads with comments, voting, and reactions.
- **[Boards](/platform/boards)** — Real-time collaborative documents for group work and brainstorming.
- **[Podcasts](/platform/podcasts)** — Audio content with episode management and streaming.
- **[Certifications](/platform/certifications)** — Automatic certificate generation on course completion.
- **[Analytics](/platform/analytics)** — Engagement tracking and usage metrics for your organization.
- **[Search](/platform/search)** — Find courses, collections, and users across your organization.
- **[Payments](/platform/payments)** — Sell courses with Stripe, manage offers, subscriptions, and enrollments.
- **[AI](/platform/ai)** — Context-aware AI assistant for students and teachers.
- **[Users & Access](/platform/users)** — User management, roles, permissions, and authentication.
- **[Organizations](/platform/organizations)** — Multi-tenant organization management, branding, and settings.

View File

@@ -0,0 +1,5 @@
{
"index": "Overview",
"multi-tenancy": "Multi-Tenancy",
"settings": "Settings"
}

View File

@@ -0,0 +1,16 @@
# Organizations
Organizations are the top-level tenant in LearnHouse. Every piece of content, every user, and every setting is scoped to an organization.
## What an Organization Contains
Each organization has its own:
- **Courses and collections** — All educational content is owned by the organization.
- **Users** — Members belong to an organization and are assigned roles within it.
- **Settings** — Branding, AI configuration, signup rules, and more are configured per-organization.
## Learn More
- [Multi-Tenancy](/platform/organizations/multi-tenancy) — Running single or multiple organizations on one LearnHouse instance.
- [Settings](/platform/organizations/settings) — Configuring your organization's preferences and features.

Some files were not shown because too many files have changed in this diff Show More