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

@leanspec/ui

v0.2.23

Published

LeanSpec web UI launcher for visual spec management (Vite SPA)

Readme

@leanspec/ui

Primary Vite-based Single Page Application for LeanSpec spec management (web + desktop).

Overview

This is a lightweight, fast SPA built with Vite. It provides a modern UI for viewing and managing LeanSpec specifications.

Unified Server Architecture: The UI is served by the Rust HTTP server on port 3000. When you run npx @leanspec/ui, it starts a single process that serves both the static UI files and the API endpoints. This provides:

  • Single port (default: 3000)
  • Same-origin API requests (no CORS needed)
  • Better performance (no Node.js HTTP server overhead)
  • Simpler deployment

Usage

# Start the unified HTTP server
npx @leanspec/ui

# Custom port and host
npx @leanspec/ui --port 3001 --host 0.0.0.0

# Auto-add project
npx @leanspec/ui --project /path/to/specs

# Read-only mode
npx @leanspec/ui --readonly

# All CLI arguments are passed to the Rust HTTP server
npx @leanspec/ui --help

Visit http://localhost:3000 to access the UI.

Architecture

  • Build Tool: Vite 7 (fast HMR, optimized builds)
  • Framework: React 19 + TypeScript 5
  • Routing: React Router 7 (client-side)
  • Components: @leanspec/ui-components (shared library)
  • Styling: Tailwind CSS 3
  • Backend: Same-origin API served by the Rust HTTP server at http://localhost:3000

Features

  • Specs Page: Browse all specifications with filtering
  • Spec Detail: View individual spec content and metadata
  • Stats Page: Project statistics and metrics
  • Dependencies Page: Dependency graph visualization
  • Responsive: Works on desktop and mobile
  • Dark Mode: Automatic dark mode support

Development

Development with HMR (Recommended)

For fast UI development with Hot Module Replacement:

# Terminal 1: Start Rust HTTP server (API on port 3000)
cd rust/leanspec-http
cargo run

# Terminal 2: Start Vite dev server (UI on port 5173)
cd packages/ui
pnpm dev

Access the UI at http://localhost:5173. Vite's proxy automatically forwards API requests to port 3000.

Production-like Development

To test the unified server locally:

# Build UI
pnpm build

# Start unified server (serves UI + API on port 3000)
cd ../../rust/leanspec-http
cargo run

Access at http://localhost:3000.

Other Commands

# Type check
pnpm typecheck

# Lint
pnpm lint

# Preview production build (Vite preview server)
pnpm preview

Configuration

By default the UI uses same-origin API calls (relative /api/...).

Dev (recommended, “single origin” in the browser)

Run the Rust HTTP server (API) on a port (default 3000), run Vite on 5173, and let Vite proxy /api.

If you need to change where the dev proxy points, use a server-only env var:

# .env.local (used by Vite dev server only)
LEANSPEC_API_URL=http://localhost:3000

With this setup the browser still talks to a single origin (the Vite origin) because all API calls are made to /api.

Deploy UI separately (cross-origin)

If you are serving the UI from a different origin than the Rust server, you can set an explicit API base URL:

# .env.local
VITE_API_URL=http://localhost:3000

If you want the Rust HTTP server to serve both UI + API on a single port, leave VITE_API_URL unset.

Build Output

Production builds are output to dist/:

  • Small bundle size (~300KB gzipped)
  • Optimized assets with code splitting
  • Static files ready for deployment

Deployment

The built static files can be:

  1. Served by the Rust HTTP server
  2. Deployed to any static hosting (Vercel, Netlify, etc.)
  3. Bundled in the Tauri desktop app

License

MIT