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

@fliidotdev/component-registry

v0.1.0

Published

Component specifications and standards for FLII.dev marketplace

Readme

╔══════════════════════════════════════════════════════════════════════════════╗
║                                                                              ║
║   ██████╗ ██████╗ ███╗   ███╗██████╗  ██████╗ ███╗   ██╗███████╗███╗   ██╗████████╗
║  ██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗  ██║██╔════╝████╗  ██║╚══██╔══╝
║  ██║     ██║   ██║██╔████╔██║██████╔╝██║   ██║██╔██╗ ██║█████╗  ██╔██╗ ██║   ██║   
║  ██║     ██║   ██║██║╚██╔╝██║██╔═══╝ ██║   ██║██║╚██╗██║██╔══╝  ██║╚██╗██║   ██║   
║  ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║     ╚██████╔╝██║ ╚████║███████╗██║ ╚████║   ██║   
║   ╚═════╝ ╚═════╝ ╚═╝     ╚═╝╚═╝      ╚═════╝ ╚═╝  ╚═══╝╚══════╝╚═╝  ╚═══╝   ╚═╝   
║                                                                              ║
║                             ██████╗ ███████╗ ██████╗ ██╗███████╗████████╗██████╗ ██╗   ██╗
║                             ██╔══██╗██╔════╝██╔════╝ ██║██╔════╝╚══██╔══╝██╔══██╗╚██╗ ██╔╝
║                             ██████╔╝█████╗  ██║  ███╗██║███████╗   ██║   ██████╔╝ ╚████╔╝ 
║                             ██╔══██╗██╔══╝  ██║   ██║██║╚════██║   ██║   ██╔══██╗  ╚██╔╝  
║                             ██║  ██║███████╗╚██████╔╝██║███████║   ██║   ██║  ██║   ██║   
║                             ╚═╝  ╚═╝╚══════╝ ╚═════╝ ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝   ╚═╝   
║                                                                              ║
║                         Solana Blinks Component Registry API                ║
╚══════════════════════════════════════════════════════════════════════════════╝

Build Status API Status TypeScript License


Overview

Component Registry is a centralized API service for managing and discovering Solana Blinks components. It provides a RESTful API for storing, retrieving, and searching reusable Blinks components, enabling developers to share and discover pre-built blockchain interactions.

Key Features

  • Component Storage: Store and version Blinks components with metadata
  • Discovery API: Search and filter components by category, tags, and capabilities
  • Version Management: Semantic versioning support for component updates
  • Authentication: JWT-based authentication for component publishers
  • Rate Limiting: Built-in rate limiting for API protection
  • Caching: Redis-based caching for high performance
  • Analytics: Track component usage and popularity
  • Validation: Schema validation for component definitions

Installation

Prerequisites

  • Node.js 18+
  • PostgreSQL 14+
  • Redis 7+
  • npm or yarn

Setup

# Clone repository
git clone https://github.com/fliidotdev/component-registry.git
cd component-registry

# Install dependencies
npm install

# Setup environment
cp .env.example .env
# Edit .env with your configuration

# Run database migrations
npm run migrate

# Seed database (optional)
npm run seed

# Start development server
npm run dev

API Documentation

Base URL

Production: https://api.flii.dev
Development: http://localhost:3000

Authentication

POST /api/auth/register
POST /api/auth/login
POST /api/auth/refresh

Components Endpoints

List Components

GET /api/components

Query Parameters:
- page: number (default: 1)
- limit: number (default: 20, max: 100)
- category: string
- tags: string[] (comma-separated)
- search: string
- sort: 'popular' | 'recent' | 'name'

Response:

{
  "data": [
    {
      "id": "uuid",
      "name": "Transfer SOL Button",
      "description": "A button component for SOL transfers",
      "category": "payment",
      "tags": ["transfer", "sol", "payment"],
      "version": "1.0.0",
      "author": {
        "id": "uuid",
        "name": "Developer Name"
      },
      "downloads": 1234,
      "rating": 4.5,
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 100,
    "pages": 5
  }
}

Get Component

GET /api/components/:id

Response:

{
  "id": "uuid",
  "name": "Transfer SOL Button",
  "description": "A button component for SOL transfers",
  "category": "payment",
  "tags": ["transfer", "sol", "payment"],
  "version": "1.0.0",
  "schema": {
    "type": "button",
    "action": "transfer",
    "params": {
      "recipient": {
        "type": "string",
        "required": true,
        "description": "Recipient wallet address"
      },
      "amount": {
        "type": "number",
        "required": true,
        "description": "Amount in SOL"
      }
    }
  },
  "code": {
    "typescript": "...",
    "javascript": "..."
  },
  "documentation": "...",
  "examples": [...],
  "dependencies": {
    "@solana/web3.js": "^1.87.0"
  },
  "author": {
    "id": "uuid",
    "name": "Developer Name",
    "avatar": "https://..."
  },
  "stats": {
    "downloads": 1234,
    "stars": 567,
    "forks": 89
  },
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z"
}

Create Component

POST /api/components
Authorization: Bearer <token>

{
  "name": "Component Name",
  "description": "Component description",
  "category": "payment",
  "tags": ["tag1", "tag2"],
  "version": "1.0.0",
  "schema": {...},
  "code": {...},
  "documentation": "...",
  "examples": [...],
  "dependencies": {...}
}

Update Component

PUT /api/components/:id
Authorization: Bearer <token>

{
  "description": "Updated description",
  "version": "1.0.1",
  ...
}

Delete Component

DELETE /api/components/:id
Authorization: Bearer <token>

Search Endpoints

Search Components

GET /api/search

Query Parameters:
- q: string (search query)
- filters: object (JSON string)
- page: number
- limit: number

Get Categories

GET /api/categories

Response:

[
  {
    "id": "payment",
    "name": "Payment",
    "description": "Payment and transfer components",
    "count": 45
  },
  {
    "id": "defi",
    "name": "DeFi",
    "description": "Decentralized finance components",
    "count": 78
  }
]

Get Popular Tags

GET /api/tags

User Endpoints

Get User Profile

GET /api/users/:id

Get User Components

GET /api/users/:id/components

Update Profile

PUT /api/users/profile
Authorization: Bearer <token>

Analytics Endpoints

Track Download

POST /api/analytics/download
{
  "component_id": "uuid"
}

Get Component Stats

GET /api/analytics/components/:id

Database Schema

Components Table

CREATE TABLE components (
  id UUID PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  description TEXT,
  category VARCHAR(100),
  tags TEXT[],
  version VARCHAR(50),
  schema JSONB,
  code JSONB,
  documentation TEXT,
  examples JSONB,
  dependencies JSONB,
  author_id UUID REFERENCES users(id),
  downloads INTEGER DEFAULT 0,
  stars INTEGER DEFAULT 0,
  created_at TIMESTAMP,
  updated_at TIMESTAMP
);

Users Table

CREATE TABLE users (
  id UUID PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  username VARCHAR(100) UNIQUE NOT NULL,
  password_hash VARCHAR(255),
  avatar_url VARCHAR(500),
  bio TEXT,
  github_username VARCHAR(100),
  twitter_username VARCHAR(100),
  created_at TIMESTAMP,
  updated_at TIMESTAMP
);

Configuration

Environment Variables

# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/component_registry

# Redis
REDIS_URL=redis://localhost:6379

# Authentication
JWT_SECRET=your-secret-key
JWT_EXPIRES_IN=7d

# API
PORT=3000
NODE_ENV=production

# Rate Limiting
RATE_LIMIT_WINDOW=15m
RATE_LIMIT_MAX=100

# Storage
AWS_S3_BUCKET=component-registry
AWS_ACCESS_KEY_ID=xxx
AWS_SECRET_ACCESS_KEY=xxx

# Monitoring
SENTRY_DSN=https://...

Deployment

Docker

# Build image
docker build -t component-registry .

# Run container
docker run -p 3000:3000 --env-file .env component-registry

Docker Compose

version: '3.8'
services:
  api:
    build: .
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgresql://user:pass@db:5432/registry
      - REDIS_URL=redis://redis:6379
    depends_on:
      - db
      - redis
  
  db:
    image: postgres:14
    environment:
      - POSTGRES_DB=registry
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=pass
    volumes:
      - postgres_data:/var/lib/postgresql/data
  
  redis:
    image: redis:7
    volumes:
      - redis_data:/data

volumes:
  postgres_data:
  redis_data:

Production Deployment

# Install PM2
npm install -g pm2

# Start application
pm2 start ecosystem.config.js

# Setup nginx reverse proxy
sudo nano /etc/nginx/sites-available/api.flii.dev

Testing

# Run all tests
npm test

# Run unit tests
npm run test:unit

# Run integration tests
npm run test:integration

# Run E2E tests
npm run test:e2e

# Coverage report
npm run test:coverage

Monitoring

Health Check

GET /health

Metrics

GET /metrics

Rate Limiting

Default rate limits:

  • Anonymous: 100 requests per 15 minutes
  • Authenticated: 1000 requests per 15 minutes
  • Component creation: 10 per hour

Security

  • JWT-based authentication
  • Input validation and sanitization
  • SQL injection prevention via parameterized queries
  • XSS protection
  • CORS configuration
  • Rate limiting
  • Request size limits

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development

# Run in development mode
npm run dev

# Run linter
npm run lint

# Format code
npm run format

# Check types
npm run type-check

License

MIT License - see LICENSE for details.

Links


Built by the FLII.dev team