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

@withwiz/academic-affairs

v0.1.0

Published

Academic Affairs Management System - 학사관리 어드민 프레임워크

Readme

English | 한국어

@withwiz/academic-affairs

Academic Affairs Management System — a reusable admin framework for school / academy products.

@withwiz/academic-affairs is a monolithic npm package that bundles the UI shell, domain services, API handlers, validators, and Prisma schemas needed to ship an admin console for academic-affairs domains (staff, students, attendance, counseling, admissions, academic calendar, FAQ, etc.). It is designed to be reused across multiple school projects by injecting per-project configuration into a single AdminShell.

Features

  • AdminShell — configurable sidebar layout with resize / collapse / mobile menu, built-in auth check & logout flow, themable accent color.
  • Domain services & handlers — ready-made service / handler / validator triplets for staff, students, attendance, counseling, admissions, academic calendar, FAQ, dashboard.
  • Attendance toolkit — date rules, class-day plans, aggregation, notification schemas, guardian-phone sanitation, and access-control helpers.
  • Infrastructure — Prisma client wrapper plus withPublicApi / withAdminApi / withAuthApi middleware wrappers.
  • RBAC & Auth — role-based access control primitives and academic auth helpers layered on top of @withwiz/toolkit.
  • Prisma schemas — ships academic.prisma, rbac.prisma, menu-resource.prisma in the package payload so consumers can merge them into their own schema.
  • HooksuseAdminForm, useAdminList, useImageDropZone for common admin UX patterns.
  • Multiple subpath exports — fine-grained entry points (e.g. @withwiz/academic-affairs/components/AdminShell, /infrastructure/middleware, /attendance) for optimal tree-shaking.

Tech Stack

Installation

# pnpm (recommended)
pnpm add @withwiz/academic-affairs

# npm
npm install @withwiz/academic-affairs

# yarn
yarn add @withwiz/academic-affairs

Peer dependencies you need to provide in the host app:

pnpm add next react @withwiz/toolkit zod
# optional: sonner (for toast notifications)
pnpm add sonner

Note: this package is currently developed inside a workspace and references @withwiz/toolkit as a file: dependency. To build it as an external consumer you will need to install a published version of @withwiz/toolkit that satisfies >=0.7.0-rc.0.

Usage

1. Mount the AdminShell layout

// app/admin/layout.tsx
import AdminShell from "@withwiz/academic-affairs/components/AdminShell";
import "@withwiz/academic-affairs/styles/admin.css";

const config = {
  brand: { name: "My School", shortName: "MS", homeUrl: "/" },
  auth:  { meEndpoint: "/api/auth/me", logoutEndpoint: "/api/auth/logout", loginPath: "/admin/login" },
  navigation: [
    { href: "/admin/students",   label: "Students",   shortLabel: "Stu" },
    { href: "/admin/attendance", label: "Attendance", shortLabel: "Att" },
    { href: "/admin/calendar",   label: "Calendar",   shortLabel: "Cal" },
  ],
  theme: { accentColor: "#D4AF37" },
};

export default function AdminLayout({ children }: { children: React.ReactNode }) {
  return <AdminShell config={config}>{children}</AdminShell>;
}

2. Build an API route with the middleware wrapper

// app/api/admin/students/route.ts
import { withAdminApi } from "@withwiz/academic-affairs/infrastructure/middleware";
import { studentHandlers } from "@withwiz/academic-affairs/handlers";

export const GET  = withAdminApi(studentHandlers.list);
export const POST = withAdminApi(studentHandlers.create);

3. Use a domain service directly

import { attendanceService } from "@withwiz/academic-affairs/services";
import {
  buildClassDayPlan,
  sanitizeGuardianPhone,
} from "@withwiz/academic-affairs/attendance";

4. Merge the Prisma schemas

The package ships prisma/academic.prisma, prisma/rbac.prisma, and prisma/menu-resource.prisma. Copy or include them in your host application's Prisma schema, then run prisma generate / prisma migrate as usual.

Package Layout

@withwiz/academic-affairs/
├── src/
│   ├── components/      # AdminShell, AdminManagerBase, image upload, toggle, nav
│   ├── hooks/           # useAdminForm, useAdminList, useImageDropZone
│   ├── services/        # staff, student, attendance, counseling, admission, ...
│   ├── handlers/        # createAcademicSystem factory + per-domain handlers
│   ├── infrastructure/  # prisma client + middleware wrappers
│   ├── types/           # shared type definitions
│   ├── utils/           # adminFetch, api-response, cn, date, academic-year, holidays
│   ├── validators/      # Zod schemas per domain
│   ├── errors/          # error classes
│   ├── auth/            # academic auth helpers
│   ├── facade/          # high-level facades
│   ├── rbac/            # role / permission primitives
│   ├── presets/         # config presets
│   ├── counseling/      # counseling-specific helpers
│   ├── scheduling/      # scheduling-specific helpers
│   ├── attendance/      # attendance helpers (date rules, class-day plans, ...)
│   └── styles/          # admin.css
├── prisma/              # academic.prisma, rbac.prisma, menu-resource.prisma
└── __tests__/           # vitest unit tests

Scripts

pnpm build         # tsup build (ESM + CJS + d.ts) into dist/
pnpm test          # vitest run (CI mode)
pnpm test:watch    # vitest watch mode

License

MIT