tpmjs/packages/db
Ajax Davis 9ab8946c9d feat: add skills.md endpoint and CLI run command
- Add /:username/collections/:slug/skills.md endpoint for AI-generated skills docs
- Analyze npm package source code to generate comprehensive capability contracts
- Add `tpm run` CLI command to execute tools from collections via MCP
- Cache generated skills.md in database with 1-week TTL
2026-01-21 14:50:07 +10:00
..
prisma feat: add skills.md endpoint and CLI run command 2026-01-21 14:50:07 +10:00
scripts feat: add usernames, pretty URLs, cloning, and sharing docs 2026-01-08 20:47:08 +10:00
src feat: add use cases marketing product with AI-generated content 2026-01-20 16:17:35 +10:00
.env.example feat(db): create database package with Prisma schema for NPM registry 2025-11-28 02:07:39 +10:00
.gitignore fix: add Prisma client to web app for Vercel monorepo compatibility 2026-01-02 00:37:00 +10:00
check-tool.js fix: update API route to use catch-all pattern for clean URLs 2025-11-29 22:57:54 +10:00
check-tool.mjs feat: add use cases marketing product with AI-generated content 2026-01-20 16:17:35 +10:00
package.json fix: make username compulsory and improve MCP error messages 2026-01-14 04:21:41 +10:00
README.md feat(db): create database package with Prisma schema for NPM registry 2025-11-28 02:07:39 +10:00
sync-single-tool.mjs fix: update dependency cruiser config to allow TypeScript path aliases and workspace packages 2025-11-30 01:55:51 +10:00
test-query.mjs fix(ci): skip lefthook install when .git directory missing 2025-11-29 13:51:05 +10:00
tsconfig.json feat(db): create database package with Prisma schema for NPM registry 2025-11-28 02:07:39 +10:00

@tpmjs/db

Database package for TPMJS NPM Registry. Provides Prisma ORM setup and database client for storing tool metadata.

Setup

1. Create Neon Database

  1. Go to https://neon.tech/
  2. Create a new project
  3. Copy the connection string

2. Configure Environment

cp .env.example .env
# Edit .env and add your DATABASE_URL

3. Run Migrations

pnpm db:migrate
pnpm db:seed

Usage

import { prisma } from '@tpmjs/db';

// Query tools
const tools = await prisma.tool.findMany({
  where: {
    category: 'web-scraping',
    isOfficial: true,
  },
  orderBy: {
    qualityScore: 'desc',
  },
  take: 10,
});

// Update sync checkpoint
await prisma.syncCheckpoint.update({
  where: { source: 'changes-feed' },
  data: {
    checkpoint: {
      sequence: '12345',
      lastProcessed: new Date().toISOString(),
    },
  },
});

Scripts

  • pnpm db:generate - Generate Prisma client
  • pnpm db:push - Push schema to database (for development)
  • pnpm db:migrate - Create and run migrations (for production)
  • pnpm db:studio - Open Prisma Studio GUI
  • pnpm db:seed - Seed initial data

Schema

Tool

Stores NPM packages with TPMJS metadata from their package.json.

SyncCheckpoint

Tracks progress of sync workers (changes feed, keyword search, metrics).

SyncLog

Audit trail of all sync operations.