npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hfu.digital/coursekit-nestjs

v0.0.5

Published

Timetable engine for academic scheduling — recurring events, conflict detection, and availability management as a NestJS module

Downloads

477

Readme

@hfu.digital/coursekit-nestjs

Timetable engine for academic scheduling: recurring events, conflict detection, availability management, and a pluggable constraint system. Ships as a NestJS dynamic module with storage adapters for any ORM.

Part of CourseKit — see the monorepo for the React frontend (@hfu.digital/coursekit-react).

Installation

bun add @hfu.digital/coursekit-nestjs

Peer dependencies:

bun add @nestjs/common @nestjs/core @nestjs/event-emitter rxjs class-validator class-transformer

Quick Start

import { Module } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
import {
    CourseKitModule,
    PrismaTimetableEventAdapter,
    PrismaRoomAdapter,
    PrismaInstructorAdapter,
    PrismaGroupAdapter,
    PrismaAvailabilityAdapter,
    PrismaAcademicPeriodAdapter,
    PrismaCourseAdapter,
    PrismaLocationDistanceAdapter,
} from '@hfu.digital/coursekit-nestjs';

const prisma = new PrismaClient();

@Module({
    imports: [
        CourseKitModule.register({
            eventStorage: new PrismaTimetableEventAdapter(
                prisma.timetableEvent,
                prisma.eventException,
                prisma.eventInstructor,
                prisma.eventGroup,
            ),
            roomStorage: new PrismaRoomAdapter(prisma.room),
            instructorStorage: new PrismaInstructorAdapter(prisma.instructor),
            groupStorage: new PrismaGroupAdapter(prisma.group, prisma.studentGroup),
            availabilityStorage: new PrismaAvailabilityAdapter(prisma.availability),
            periodStorage: new PrismaAcademicPeriodAdapter(prisma.academicPeriod),
            courseStorage: new PrismaCourseAdapter(prisma.course),
            locationDistanceStorage: new PrismaLocationDistanceAdapter(prisma.locationDistance),
        }),
    ],
})
export class AppModule {}

Domain Services

| Service | Key Methods | |---------|-------------| | RecurrenceService | materialize(), materializeSingle(), parseRule(), validateRule() | | TimeService | overlaps(), endTime(), isInRange(), gapMinutes() | | AvailabilityService | create(), update(), delete(), isAvailable(), findFreeSlots() | | ConflictService | check(), dryRun() | | QueryService | getSchedule(), findFreeSlots(), getEntitySchedule() |

Built-in Constraints

| Constraint | Type | Severity | Description | |------------|------|----------|-------------| | OverlapConstraint | overlap | error | Detects instructor and room double-bookings | | CapacityConstraint | capacity | warning | Checks room capacity against group student count | | AvailabilityConstraint | availability | error/warning | Checks events against entity availability rules |

Custom constraints can be registered via CourseKitModule.register({ constraints: [...] }). Built-ins can be disabled with enableBuiltInConstraints: false.

Storage Adapters

The backend uses a hexagonal architecture — all persistence is behind abstract storage classes. Prisma adapters are included, but you can implement adapters for any ORM (Drizzle, TypeORM, Knex, etc.) by extending the abstract classes.

Testing

Use @hfu.digital/coursekit-nestjs/testing for in-memory adapters and test utilities:

import {
    InMemoryTimetableEventStorage,
    InMemoryRoomStorage,
    createTestEvent,
    createTestRoom,
    expectNoConflicts,
} from '@hfu.digital/coursekit-nestjs/testing';

License

MIT