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

create-restack-pattern

v0.1.8

Published

Scaffold a new Next.js + Hono + Drizzle monorepo using the Restack Pattern (Semi-DDD) template.

Downloads

31

Readme

create-restack-pattern

npm version npm license node version

Skip the boilerplate — scaffold a full-stack Next.js + Hono + PostgreSQL monorepo with secure auth cookies, structured logging, and a type-safe Hono RPC client end-to-end, all wired up and ready to deploy.

This is the official initializer for the Restack Pattern.

Usage

npx create-restack-pattern my-app

Or run it without arguments to be prompted for a project name:

npx create-restack-pattern

Prerequisites

  • Node.js: version 20 or higher
  • pnpm: package manager installed (run npm install -g pnpm if needed)
  • PostgreSQL: a running database (either a local instance or a free hosted instance on Neon)

Quick Start (Next Steps)

Once the CLI finishes scaffolding your project, follow these three simple steps to get started:

1. Configure Environment Variables

cd my-app
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
  • Open backend/.env and set:
    • DATABASE_URL (format: postgresql://user:password@localhost:5432/dbname; you can use a local Postgres database or a free hosted instance on Neon)
    • JWT_SECRET (generate a secure 32-character key by running: openssl rand -base64 32)
  • (Optional) Open frontend/.env to override NEXT_PUBLIC_API_URL (defaults to http://localhost:3001 for local Hono API).

2. Push Database Tables

This creates the required users and auth_sessions tables in your database:

pnpm --filter backend db:push

3. Start Development Servers

pnpm dev

What You Get

  • frontend/ — Next.js 16 (App Router)
  • backend/ — Hono + Drizzle ORM, with a working JWT + refresh-token auth flow, production-ready structured correlation logging (Pino + Hono request tracing), and an example user domain already wired up.
  • packages/shared/ — Zod schemas shared between frontend and backend.

For a full breakdown of the folder structure, architecture rules (Semi-DDD), dual-cookie auth implementation, and deployment verification checklists, please visit the GitHub repository.


For Maintainers (Local Dev & Publishing)

The template/ directory in this package is a copy of frontend/, backend/, and packages/shared/ from the repo root, not a live reference — and it's gitignored.

Before testing your CLI changes locally or publishing, follow the standard workflow:

  1. Sync template:
    pnpm --filter create-restack-pattern sync-template
  2. Compile the CLI script:
    pnpm --filter create-restack-pattern build
  3. Verify the published files:
    npm pack --dry-run
  4. Scaffold locally to test:
    node dist/index.js test-app
  5. Publish to npm: Bump the "version" in package.json, then:
    npm publish

For detailed guides, workflow explanations, and lessons learned: