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-k2-saas

v1.0.2

Published

A modern, self-documenting SaaS template using React, TypeScript, and Cloudflare Workers.

Readme

K2-SaaS Template

A modern, self-documenting SaaS template using React, TypeScript, and Cloudflare Workers.

Features

  • 🚀 Full-stack TypeScript development
  • 📦 Monorepo structure with pnpm workspaces
  • ⚡ Fast builds with Turborepo
  • 🎨 Beautiful UI with ShadcnUI and TailwindCSS
  • 🔍 End-to-end type safety with Zod
  • 🗄️ SQLite database with Drizzle ORM
  • 🌩️ Serverless API with Cloudflare Workers
  • 📝 Self-documenting API and components

Stack

Frontend

  • React 19 with TypeScript
  • ShadcnUI Components
  • Zustand for State Management
  • React Router for Navigation
  • TailwindCSS for Styling

Backend

  • Cloudflare Workers
  • D1 Database (SQLite)
  • Drizzle ORM
  • Hono for API Routing

Shared

  • pnpm Workspace
  • Turborepo
  • Zod Schema Validation
  • Shared TypeScript Types

Getting Started

  1. Bootstrap your application using this template:

    npm create k2-saas my-saas-app
    cd my-saas-app
  2. Install dependencies:

    pnpm install
  3. Create a D1 database:

    cd apps/api
    pnpm wrangler d1 create k2-sass-db
  4. Update wrangler.toml with your D1 database ID

  5. Push the database schema:

    pnpm db:push
  6. Start the development servers:

    # In the root directory
    pnpm dev

Project Structure

k2-sass/
├── apps/
│   ├── api/              # Cloudflare Worker API
│   │   ├── src/
│   │   │   ├── db/      # Database schema and config
│   │   │   └── index.ts # API routes
│   │   └── wrangler.toml
│   │
│   └── web/             # React frontend
│       ├── src/
│       │   ├── components/
│       │   ├── pages/
│       │   ├── store/
│       │   └── utils/
│       └── index.html
│
└── packages/
    └── shared-types/    # Shared TypeScript types
        └── src/
            └── schemas.ts

Development Workflow

  1. Database Schema: Define your database schema in apps/api/src/db/schema.ts
  2. API Types: Add Zod schemas in packages/shared-types/src/schemas.ts
  3. API Routes: Implement routes in apps/api/src/index.ts
  4. Frontend State: Add Zustand stores in apps/web/src/store
  5. UI Components: Create pages and components in apps/web/src/pages and components

API Endpoints in the example project

Users

  • GET /users - List all users
  • POST /users - Create a new user

Posts

  • GET /posts - List all posts with authors
  • POST /posts - Create a new post
  • GET /posts/:id - Get post by ID
  • PATCH /posts/:id - Update post by ID
  • DELETE /posts/:id - Delete post by ID

Type Safety

The template ensures end-to-end type safety through:

  1. Zod schemas for API payloads and responses
  2. Shared TypeScript types between frontend and backend
  3. Drizzle ORM for type-safe database queries
  4. React Hook Form with Zod validation

License

MIT