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-pbx

v1.1.3

Published

A CLI tool to scaffold an Express backend with Prisma and Better Auth.

Readme

create-pbx

A CLI tool that scaffolds a backend project with Prisma, Better Auth, and Express already wired together.


What it is

Setting up auth on the backend is repetitive. You install packages, configure the database adapter, register routes, handle CORS, wire up sessions. It is the same work every time.

create-pbx does that work for you. Run one command and you get a working Express server with Better Auth and Prisma set up, PostgreSQL schema included.


What you get

  • Express 5 server
  • Better Auth with GitHub OAuth
  • Prisma ORM with a PostgreSQL schema (User, Session, Account, Verification)
  • CORS configured for local frontend development
  • A /api/me endpoint that returns the current session
  • TypeScript and nodemon for development

Requirements

  • Node.js 18 or higher
  • npm
  • A PostgreSQL database

Usage

npm init pbx

Or

npx create-pbx my-app

Or without a name, and it will ask:

npx create-pbx

It will copy the template files, update package.json with your project name, and optionally run npm install.


Configuration

After scaffolding, copy .env.example to .env and fill in the values:

BETTER_AUTH_SECRET=your_secret_here
BETTER_AUTH_URL=http://localhost:3005
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
PORT=3005
DATABASE_URL=your_postgresql_connection_string

To get GitHub OAuth credentials, create an OAuth App at github.com/settings/developers. Set the callback URL to http://localhost:3005/api/auth/callback/github.


Running the project

# Generate Prisma client
npm run generate

# Push schema to your database
npx prisma db push

# Start the dev server
npm run dev

The server starts on the port you set in .env.


Project structure

my-app/
  prisma/
    schema.prisma       # Database schema
  src/
    lib/
      auth.ts           # Better Auth setup
    server.ts           # Express server
  .env.example
  prisma.config.ts
  tsconfig.json

Adding more providers

Open src/lib/auth.ts and add providers under socialProviders. Better Auth supports Google, Discord, Twitter, and others. The setup is the same pattern as the existing GitHub config.


Changing the frontend origin

The CORS origin is set to http://localhost:3000 in both src/server.ts and src/lib/auth.ts. Change both when you deploy.


Stack versions

| Package | Version | |--------------|---------| | Express | 5 | | Better Auth | 1.5.x | | Prisma | 6.x | | TypeScript | 5.x |

Note: this template is built for Prisma 6 only. Prisma 7 and above are not supported and will likely break the setup.