Bring your own database
Every module defines repository interfaces. You implement them with Prisma, Drizzle, raw SQL or an in-memory Map. The SDK has no runtime dependencies.
Repositories
Typed domain models, pure calculation functions and repository-driven services for enrollment, content, assessment, grading, scheduling and more. You choose the database and framework.
Early development
Discendo SDK is at v0.1.0. Expect breaking changes and gaps in coverage, and don't use it in production yet.
import { createRolePolicy, EventBus } from 'discendo-sdk/core'
import { EnrollmentService } from 'discendo-sdk/enrollment'
const bus = new EventBus()
const enrollment = new EnrollmentService(repos, bus, { policy: createRolePolicy() })
await enrollment.enroll(
{ userId: 'stu-1', sectionId: 'sec-1', role: 'student' },
{ actorId: currentUser.id }, // you authenticate; the SDK authorizes
)repos is your implementation of the SDK's repository interfaces, which the tutorial builds step by step with Bun + Hono + Drizzle.