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 🙏

© 2025 – Pkg Stats / Ryan Hefner

create-onestack

v1.0.2

Published

**Full-stack starter kit** with SvelteKit + PocketBase integrated from the beginning.

Readme

⚡ FStack

Full-stack starter kit with SvelteKit + PocketBase integrated from the beginning.

The goal of FStack is to provide a ready-to-use full-stack development environment similar to create-next-app, but with PocketBase as the backend — everything connected out of the box.

🚀 Quick Start

1. Start PocketBase Server

Download PocketBase from pocketbase.io and run:

./pocketbase serve

This starts the backend at http://127.0.0.1:8090

Create an admin account at http://127.0.0.1:8090/_/

2. Start the SvelteKit App

cd my-app
npm install
npm run dev

This starts the frontend at http://localhost:5173

3. Auto-Setup Database (One Command!)

Run the setup script to automatically create all required collections:

npm run setup

This will:

  • ✅ Connect to PocketBase
  • ✅ Authenticate as admin (prompts for credentials)
  • ✅ Create the test_items collection with proper fields
  • ✅ Configure API rules for authenticated access

Using environment variables (CI/CD):

PB_URL=http://127.0.0.1:8090 [email protected] PB_ADMIN_PASS=yourpassword npm run setup

4. Run the Integration Tests

Open your browser and navigate to http://localhost:5173. The test dashboard will show you the status of all PocketBase integrations — all tests should pass!

📋 Manual Test Suite Setup (Alternative)

If you prefer to manually create collections, add a test_items collection in PocketBase Admin (http://127.0.0.1:8090/_/):

| Field | Type | |-------------|------| | title | Text | | description | Text | | status | Text |

Tip: Set API Rules to @request.auth.id != "" for all operations.

✅ What Gets Tested

Connection & Health

  • Health Check — Verify PocketBase API is responding
  • SDK Ready — Verify PocketBase SDK is properly initialized

Authentication

  • User Registration — Create new test user accounts
  • User Login — Authenticate with email/password
  • Session Validation — Verify auth tokens work
  • User Logout — Clear authentication sessions

CRUD Operations

  • Collection Check — Verify test collection exists
  • Create Record — Insert new records
  • Read Record — Retrieve records by ID
  • Update Record — Modify existing records
  • List Records — Query multiple records with pagination
  • Delete Record — Remove records

Realtime

  • Subscribe — Connect to live data updates
  • Receive Event — Trigger and receive change events
  • Unsubscribe — Disconnect from realtime

📁 Project Structure

my-app/
├── scripts/
│   └── setup-db.ts          # Auto-provision database collections
├── src/
│   ├── lib/
│   │   ├── pocketbase.ts    # PocketBase client & helper functions
│   │   ├── test-utils.ts    # Test utilities and types
│   │   └── setup/           # Setup & provisioning module
│   │       ├── schemas.ts   # Collection schema definitions
│   │       ├── provision.ts # Provisioning logic
│   │       └── index.ts     # Module exports
│   └── routes/
│       └── +page.svelte     # Integration test dashboard
├── package.json
└── README.md

🔧 Using PocketBase in Your App

Import the pre-configured client anywhere in your app:

import { pb, isAuthenticated, getCurrentUser } from '$lib/pocketbase';

// Check authentication
if (isAuthenticated()) {
  const user = getCurrentUser();
  console.log('Logged in as:', user?.email);
}

// Fetch records
const posts = await pb.collection('posts').getList(1, 20);

// Subscribe to changes
pb.collection('posts').subscribe('*', (e) => {
  console.log('Change:', e.action, e.record);
});

🛠 Available Helper Functions

// Health & Connection
checkHealth()                    // Check if PocketBase is reachable

// Authentication
isAuthenticated()                // Check if user is logged in
getCurrentUser()                 // Get current user record
registerUser(email, password, passwordConfirm, name?)
loginWithEmail(email, password)
logout()
requestPasswordReset(email)
requestEmailVerification(email)

// CRUD Operations
createRecord(collection, data)
getRecord(collection, id)
updateRecord(collection, id, data)
deleteRecord(collection, id)
listRecords(collection, page?, perPage?, filter?, sort?)

// Realtime
subscribeToCollection(collection, callback)
subscribeToRecord(collection, recordId, callback)

// Files
getFileUrl(record, filename, queryParams?)
uploadFile(collection, recordId, fieldName, file)

// Utilities
collectionExists(collectionName)

// Setup & Provisioning
provisionCollections(options)      // Auto-create collections
checkPocketBaseHealth(url)         // Verify server is running

➕ Adding Custom Collections

Define your collection schemas in src/lib/setup/schemas.ts:

import { createCollectionSchema, DEFAULT_COLLECTIONS } from '$lib/setup';

// Add your custom collection
const postsCollection = createCollectionSchema('posts', [
  { name: 'title', type: 'text', required: true },
  { name: 'content', type: 'editor' },
  { name: 'published', type: 'bool' }
]);

// Export all collections
export const MY_COLLECTIONS = [...DEFAULT_COLLECTIONS, postsCollection];

Then run npm run setup to provision them automatically.

📦 Tech Stack

  • Frontend: SvelteKit 2 + Svelte 5
  • Backend: PocketBase
  • Language: TypeScript
  • Styling: CSS (scoped)

🎯 Philosophy

FStack aims to be the fastest way to start a full-stack project with:

  1. Zero backend setup — PocketBase is a single executable
  2. Type-safe by default — Full TypeScript support
  3. Batteries included — Auth, database, realtime, files all ready
  4. Test-first confidence — Built-in integration test suite

Built with ❤️ using SvelteKit + PocketBase