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

@webdevarif/dashui-setup

v0.2.0

Published

Zero-config providers, hooks, and middleware for Next.js + NextAuth + SWR (+ optional next-intl, Prisma)

Readme

@webdevarif/dashui-setup

Zero-config providers, hooks, and middleware for Next.js 14+ + NextAuth v5 + next-intl + SWR + Prisma.

The Problem

Every Next.js + auth + i18n + data project needs the same boilerplate:

  • Session providers
  • i18n setup
  • Data fetching with SWR
  • Prisma singleton pattern
  • Middleware for routing

This takes 2-3 hours per project and causes:

  • ❌ Copy-paste pain
  • ❌ Version mismatch bugs
  • ❌ Inconsistent patterns
  • ❌ Token burn on setup

The Solution

One line:

npm install @webdevarif/dashui-setup

Quick Start

1. Wrap Your App (layout.tsx)

import { RootProvider } from '@webdevarif/dashui-setup'
import { auth } from '@/auth'

export default async function RootLayout({ 
  children, 
  params: { locale } 
}: {
  children: React.ReactNode
  params: { locale: string }
}) {
  const session = await auth()
  const messages = await import(`../../messages/${locale}.json`)

  return (
    <html lang={locale}>
      <body>
        <RootProvider 
          session={session}
          locale={locale}
          messages={messages.default}
        >
          {children}
        </RootProvider>
      </body>
    </html>
  )
}

2. Use Hooks Anywhere

'use client'

import { useAuth, useI18n, useFetch } from '@webdevarif/dashui-setup/hooks'

export function Dashboard() {
  const { data: session } = useAuth()
  const t = useI18n()
  const { data: stats } = useFetch('/api/stats')

  return (
    <div>
      <h1>{t('dashboard.title')}</h1>
      <p>Welcome {session?.user?.name}</p>
      <p>Orders: {stats?.orderCount}</p>
    </div>
  )
}

3. Use Prisma (API routes)

import { prisma } from '@webdevarif/dashui-setup/lib'

export async function GET() {
  const users = await prisma.user.findMany()
  return Response.json(users)
}

What's Included

Providers

  • AuthProvider — NextAuth SessionProvider wrapper
  • I18nProvider — next-intl IntlProvider wrapper
  • SWRProvider — Optimized SWR global config
  • RootProvider — All three combined (recommended)

Hooks

  • useAuth() — Access session and auth state
  • useI18n() — Access translations
  • useFetch(url) — Simplified data fetching with SWR

Utilities

  • prisma — Singleton PrismaClient (prevents connection pool issues)

Default Configurations

SWR Config

{
  revalidateOnFocus: false,        // Don't refresh on window focus
  revalidateOnReconnect: true,     // Refresh when network reconnects
  dedupingInterval: 60000,         // Deduplicate requests within 60s
  focusThrottleInterval: 300000,   // Throttle focus revalidation to 5min
}

Prisma Logger

  • Development: Logs SQL queries
  • Production: Silent

Installation

npm install @webdevarif/dashui-setup next-auth next-intl swr @prisma/client

Peer Dependencies

  • next >= 14
  • next-auth >= 5
  • next-intl >= 3
  • swr >= 2
  • @prisma/client >= 5
  • react >= 18
  • react-dom >= 18

What This Saves

| Task | Before | After | |------|--------|-------| | Setup time per project | 2-3 hours | 5 minutes | | Auth provider config | 30 lines | 1 import | | i18n setup | 40 lines | 1 import | | SWR config | 20 lines | 1 import | | Prisma singleton | 20 lines | 1 import | | Data fetching | fetch().then() | useFetch('/api/...') |

Example Project Structure

my-app/
├── src/
│   ├── app/
│   │   ├── [locale]/
│   │   │   ├── layout.tsx          (uses RootProvider)
│   │   │   └── page.tsx             (uses useAuth, useI18n)
│   │   └── api/
│   │       └── users/
│   │           └── route.ts         (uses prisma)
│   ├── messages/
│   │   ├── en.json
│   │   └── nl.json
│   ├── auth.ts
│   └── middleware.ts
├── prisma/
│   └── schema.prisma
└── package.json

License

MIT