open-index/open-npm huggingface dataset:
npm package: @listablelabs/create-api
Description: CLI to scaffold ListableLabs microservices
Author: ListableLabs
Latest version: 1.0.3

# @listablelabs/create-api

CLI tool to scaffold standardized ListableLabs microservices.

## Installation

```bash
# Install globally
npm install -g @listablelabs/create-api

# Or use npx (no install required)
npx @listablelabs/create-api create my-service
```

## Usage

### Create a New Service

```bash
# Interactive mode (recommended)
listablelabs create my-service

# Quick mode with defaults
listablelabs create my-service -y

# Specify directory
listablelabs create my-service -d ./services

# Skip npm install
listablelabs create my-service --skip-install

# Skip git initialization
listablelabs create my-service --skip-git
```

### Add Components to Existing Project

```bash
# Add a new route + controller
listablelabs add route
listablelabs add route -n users

# Add just a controller
listablelabs add controller -n payment

# Add a service
listablelabs add service -n email

# Add a middleware
listablelabs add middleware -n cache

# Add a model (auto-detects MongoDB/SQL)
listablelabs add model -n user
```

## Features

When creating a new service, you can choose:

- **Logging** - Pino with pretty printing in dev
- **Validation** - Joi request validation
- **Rate Limiting** - Express rate limit
- **Error Handling** - Centralized error handling with typed errors
- **JWT Authentication** - Optional auth middleware
- **Swagger/OpenAPI** - Optional API documentation
- **Database** - PostgreSQL, MongoDB, or MySQL support

## Project Structure

```
my-service/
├── src/
│   ├── config/           # Environment configuration
│   ├── controllers/      # Request handlers
│   ├── middlewares/      # Express middlewares
│   ├── routes/v1/        # API routes
│   ├── services/         # Business logic
│   ├── models/           # Data models
│   ├── utils/            # Utilities (logger, response)
│   ├── app.js           # Express setup
│   └── server.js        # Entry point
├── tests/
├── Dockerfile
└── docker-compose.yml
```

## Publishing (Internal)

```bash
# Login to npm (or your private registry)
npm login

# Publish
npm publish --access public
```

## Examples

### Create a user service with PostgreSQL and auth:

```bash
$ listablelabs create user-service

? Service name: user-service
? Description: User management microservice
? Port: 3001
? Select features:
  ◉ Pino Logging
  ◉ Joi Validation
  ◉ Rate Limiting
  ◉ Error Handling
  ◉ JWT Authentication
  ◯ Swagger/OpenAPI Docs
? Database: PostgreSQL

✔ Project structure created
✔ Git repository initialized
✔ Dependencies installed

✔ Project created successfully!

Next steps:
  cd user-service
  npm run dev
```

### Add a products route:

```bash
$ cd user-service
$ listablelabs add route -n products

✔ Created products route and controller

Files created:
  - src/routes/v1/productsRoutes.js
  - src/controllers/productsController.js

Add to src/routes/v1/index.js:
  const productsRoutes = require('./productsRoutes');
  router.use('/products', productsRoutes);
```
npm package: @listee/api
Description: HTTP-facing application utilities for Listee. The package wires queries, services, and repositories so Hono route handlers can expose category/task endpoints and health checks with minimal boilerplate.
Latest version: 0.3.2

# @listee/api

HTTP-facing application utilities for Listee. The package wires queries, services, and repositories so Hono route handlers can expose category/task endpoints and health checks with minimal boilerplate.

## Installation

```bash
npm install @listee/api
```

## Features

- `createApp` helper that returns a fully wired Hono instance
- Register functions for categories, tasks, and health routes
- Query facades that coordinate services and repositories per use case
- Validation utilities shared across handlers to enforce input constraints

## Quick start

```ts
import { Hono } from "hono";
import {
  createCategoryQueries,
  createTaskQueries,
  registerCategoryRoutes,
  registerTaskRoutes,
} from "@listee/api";

const app = new Hono();

const categoryQueries = createCategoryQueries(/* dependencies */);
const taskQueries = createTaskQueries(/* dependencies */);

registerCategoryRoutes(app, { queries: categoryQueries });
registerTaskRoutes(app, { queries: taskQueries });

export default app;
```

All queries accept factories so tests can inject fakes/mocks. See `src/queries/` and `src/routes/` for concrete wiring examples.

## Development

- Build: `bun run build`
- Tests: `bun test`
- Lint: `bun run lint`

## License

MIT
npm package: @listee/auth
Description: Authentication and provisioning helpers for Listee services. This package ships reusable providers that validate requests (e.g., Supabase JWTs) and optional hooks for post-auth account provisioning.
Latest version: 0.5.0

# @listee/auth

Authentication and provisioning helpers for Listee services. This package ships reusable providers that validate requests (e.g., Supabase JWTs) and optional hooks for post-auth account provisioning.

## Installation

```bash
npm install @listee/auth
```

## Features

- Supabase Auth REST client via `createSupabaseAuthClient`
- Supabase JWT verification via `createSupabaseAuthentication`
- Account provisioning wrapper `createProvisioningSupabaseAuthentication`
- Strongly typed `AuthenticatedUser` and `AuthenticationContext` exports

## Quick start

### Verify Supabase JWTs

```ts
import { createSupabaseAuthentication } from "@listee/auth";

const authentication = createSupabaseAuthentication({
  projectUrl: "https://<project>.supabase.co",
  audience: "authenticated",
  requiredRole: "authenticated",
});

const result = await authentication.authenticate({ request });
const user = result.user;
// Continue handling the request with user.id and user.token
```

### Call Supabase Auth REST endpoints

```ts
import { createSupabaseAuthClient } from "@listee/auth";

const auth = createSupabaseAuthClient({
  projectUrl: "https://<project>.supabase.co",
  publishableKey: process.env.SUPABASE_PUBLISHABLE_KEY!,
});

await auth.signup({ email: "user@example.com", password: "secret" });
const tokens = await auth.login({ email: "user@example.com", password: "secret" });
const refreshed = await auth.refresh({ refreshToken: tokens.refreshToken });
```

See `src/authentication/` and `src/supabase/` for additional adapters and tests demonstrating error handling scenarios.

## Development

- Build: `bun run build`
- Tests: `bun test`
- Lint: `bun run lint`

## License

MIT
npm package: @listee/db
Description: Postgres + Drizzle utilities used by Listee services. It provides connection management, row-level security (RLS) helpers, and schema exports for downstream consumers.
Latest version: 0.4.0

# @listee/db

Postgres + Drizzle utilities used by Listee services. It provides connection management, row-level security (RLS) helpers, and schema exports for downstream consumers.

## Installation

```bash
npm install @listee/db
```

## Features

- Cached `postgres` connections for local development and tests
- `createRlsClient`/`createDrizzle` to run transactions with Supabase-style claims
- Schema exports under `schema/` plus category constants for consistent lookups
- Graceful error wrapping that surfaces detailed Drizzle/Postgres diagnostics

## Quick start

```ts
import { createRlsClient, createPostgresConnection } from "@listee/db";

const connection = createPostgresConnection();

const rlsClient = createRlsClient({
  connection,
});

await rlsClient.runWithToken({ token: jwt }, async (tx) => {
  const categories = await tx.query.categories.findMany();
  return categories;
});
```

Set `POSTGRES_URL` (or pass `connectionString`) before invoking the helpers. When `reuseConnection` is true (default), connections are cached across calls to reduce overhead.

## Development

- Build: `bun run build`
- Tests: `bun test`
- Lint: `bun run lint`

## License

MIT
npm package: @listee/types
Description: Shared TypeScript interfaces used across Listee services and client SDKs. The package aggregates API payloads, authentication contracts, and database types so downstream packages stay in sync.
Latest version: 0.5.0

# @listee/types

Shared TypeScript interfaces used across Listee services and client SDKs. The package aggregates API payloads, authentication contracts, and database types so downstream packages stay in sync.

## Installation

```bash
npm install @listee/types
```

## Contents

- `api` — request/response types for Listee REST handlers
- `authentication` — user/session contracts consumed by `@listee/auth`
- `db` — database-facing types used by `@listee/db` and repository layers

## Usage

```ts
import type { AppDependencies, ListCategoriesResult } from "@listee/types";

function listCategories(deps: AppDependencies): Promise<ListCategoriesResult> {
  return deps.categoryQueries.listCategories({ userId: deps.actor.id });
}
```

The package ships only `.d.ts` files, making it safe to use from Node.js and browser contexts.

## Development

Changes flow from the monorepo root:

- Update the relevant source under `src/`
- Run `bun run build` to emit declaration files into `dist/`
- Execute `bun test` or higher level tests in dependent packages to ensure compatibility

## License

MIT