Build an LMS with Discendo SDK
In this hands-on tutorial, you will build a complete, production-ready backend for a modern Learning Management System called Academix.
Unlike generic tutorials that use toys or in-memory arrays, this guide builds a real web application with a relational database, transactional repository adapters, JWT authentication, role-based access control, and asynchronous notification delivery.
What We Are Building
By the end of this guide, your application will handle:
- Authentication & Multi-Tenancy: Secure authentication mapped to verified SDK
Identityrecords, with hard organizational walls for multi-tenant deployments. - Course Rosters & Registration: Publishing courses, enforcing section seat caps, atomic waitlist queues, auto-promotion on drop, and SIS bulk imports.
- Curriculum & Content Trees: Hierarchical modules, pages, and assignments with publishing versions and prerequisite unlocking.
- Assessments & Quizzes: Student file submissions, randomized quiz attempts with progressive saving, and objective auto-scoring.
- Gradebook & Calculations: Weighted grade categories, drop-lowest rules, late submission penalties, grade overrides with immutable audit trails, and GPA calculations.
- Timetables & Rooms: Recurring class session schedules, calendar materialization, classroom capacity checks, and automated backtracking timetable solving.
- Announcements & Reports: Discussion threads, guardian portals, attendance roll calls, and CSV exports.
The Tech Stack
We chose a lightweight, modern TypeScript stack that matches Discendo's high-performance, dependency-free philosophy:
| Layer | Technology | Why We Use It |
|---|---|---|
| Runtime | Bun | Blazing-fast execution, native TypeScript support, built-in test runner, zero build step needed during development. |
| HTTP Framework | Hono | Extremely fast, lightweight, and type-safe web framework with intuitive middleware and OpenAPI compatibility. |
| ORM / Query Builder | Drizzle ORM | Schema-first, lightweight, type-safe SQL query builder with zero runtime bloat. |
| Database | SQLite (dev) / PostgreSQL (prod) | File-based SQLite (bun:sqlite) for zero-configuration local development; drop-in compatible with PostgreSQL for cloud deployments. |
| LMS Business Logic | Discendo SDK | Replaces thousands of lines of fragile custom business logic with tested, hardened academic workflows. |
Roadmap
The tutorial is structured into four progressive phases:
Phase 1: Foundation (Chapters 1–4)
- 1. Project Setup: Bootstrapping the project, configuring dependencies, and establishing folder structure.
- 2. Database Schema: Designing relational tables with Drizzle ORM to back the SDK domain entities.
- 3. Implementing Repositories: Building robust, transactional repository adapters matching
RepositoryContext. - 4. Wiring Services: Assembling the global service container with EventBus and PermissionPolicy.
Phase 2: People & Access (Chapters 5–7)
- 5. Authentication & Actors: Building JWT authentication middleware and resolving authenticated users into SDK actors.
- 6. Roles & Permissions: Protecting API routes with fail-closed permissions and customizing role policies.
- 7. Organizations & Departments: Implementing multi-tenant boundaries and departmental groupings.
Phase 3: Teaching & Learning (Chapters 8–12)
- 8. Courses, Terms & Sections: Creating courses, academic calendars, and configuring cohorts.
- 9. Enrollment & Waitlists: Implementing course registration APIs, atomic seat locking, and waitlist promotion.
- 10. Course Content: Building content tree hierarchies, publishing version workflows, and prerequisite gating.
- 11. Assignments & Quizzes: Managing file uploads, randomized quizzes, scoring rubrics, and plagiarism seams.
- 12. Grading & Gradebook: Recording grades with immutable regrade trails, weighted categories, late penalties, and GPA.
Phase 4: Operations & Shipping (Chapters 13–19)
- 13. Timetables: Setting up class schedules, conflict detection, and using the auto-scheduling solver.
- 14. Announcements & Notifications: Broadcasting student announcements and bridging domain events to email/push notifications.
- 15. Attendance & Reports: Taking attendance roll calls and generating downloadable CSV reports.
- 16. Audit Log: Capturing compliance audit trails using
withAuditandAdminService. - 17. Parent Portal (Guardians): Establishing read-only guardian links for student academic oversight.
- 18. Testing: Writing integration tests with Bun's native test runner.
- 19. Deployment: Production deployment with Docker and PostgreSQL.
Ready? Let's start with Chapter 1: Project Setup.