open-index/open-npm huggingface dataset:
npm package: @micro-cms/admin-ui
Description: A collection of schema-driven React components for building dynamic admin interfaces. This package uses the "Zero-Config" style injection strategy to ensure it works in any host application.
Latest version: 1.0.39

# @micro-cms/admin-ui

A collection of schema-driven React components for building dynamic admin interfaces. This package uses the "Zero-Config" style injection strategy to ensure it works in any host application.

## Features

- **AutoForm:** Generates complete forms based on a data schema.
- **AutoTable:** Renders paginated data tables with sorting and actions.
- **OffCanvas:** A slide-in drawer for editing and creating records without leaving the context.
- **Component Registry:** Extensible system to map data types to custom UI components.
- **Zero-Config Styles:** Pre-compiled CSS is automatically injected into the DOM at runtime with `mcms-` prefixing to avoid conflicts.

## Installation

```bash
pnpm add @micro-cms/admin-ui
```

## Basic Usage

```tsx
import { AutoTable, AutoForm } from '@micro-cms/admin-ui';

const schema = {
  name: 'posts',
  fields: [
    { name: 'title', type: 'text', label: 'Post Title' },
    { name: 'is_published', type: 'boolean', label: 'Published' }
  ]
};

function MyAdmin() {
  return (
    <div>
      <AutoTable 
        schema={schema} 
        data={[]} 
        onEdit={(id) => console.log('Edit', id)} 
      />
      
      <AutoForm 
        schema={schema} 
        onSubmit={(data) => console.log('Saving', data)} 
      />
    </div>
  );
}
```

## Customizing Components

You can register custom input components for specific data types via the `ComponentRegistry`:

```tsx
import { ComponentRegistry } from '@micro-cms/admin-ui';

ComponentRegistry.register('geo_point', MyMapPicker);
```

## Design System

All components are styled with Tailwind CSS using an `mcms-` prefix. This package is fully isolated and will not leak styles into your application or be affected by your app's global CSS resets.
npm package: @micro-cms/core
Description: The backbone of the Micro-CMS ecosystem. This package provides the runtime for loading and composing decoupled modules.
Latest version: 1.0.39

# @micro-cms/core

The backbone of the Micro-CMS ecosystem. This package provides the runtime for loading and composing decoupled modules.

## Features

- **Module Loader:** Discovers and initializes modules with a standardized lifecycle.
- **Staged Event Bus:** Decoupled communication with support for validation, processing, and notification stages.
- **Shared State Manager:** Reactive, cross-module state management.
- **Capability Registry:** Allows modules to provide and consume specialized functionalities (e.g., `database-adapter`, `route-provider`).
- **Route Registry:** Framework-agnostic API endpoint registration.

## Installation

```bash
pnpm add @micro-cms/core
```

## Basic Usage

```javascript
import { createApp } from '@micro-cms/core';
import postgresModule from '@micro-cms/postgres';
import restApiModule from '@micro-cms/rest-api';

const app = createApp();

// Compose your stack
app.use(postgresModule, { connectionString: '...' });
app.use(restApiModule);

// Start the runtime
await app.start();
```

## Core Concepts

### 1. Staged Events
The Event Bus supports deterministic execution order through stages:
1. `validation`: Ensure data integrity.
2. `processing`: Execute business logic (sequential or parallel).
3. `notification`: Trigger post-processing effects.

### 2. Capabilities
Modules can register "capabilities" that other modules can consume via `runtime.getCapability(name)`. This enables a "plug-and-play" architecture where you can swap a database or UI without changing other modules.

### 3. Shared Context
A global, reactive key-value store that allows modules to publish state (like `currentUser` or `currentSchema`) that others can subscribe to.
npm package: @micro-cms/crypto-auth-node
Description: Node.js Crypto Authentication Module for Micro-CMS
Latest version: 1.0.39

# @micro-cms/crypto-auth-node

A backend Micro-CMS module for verifying crypto wallet signatures (Solana and EVM) and issuing JWT tokens.

## Features
- **Multi-Chain Verification**: Supports Solana (ed25519) and EVM (personal_sign) signature verification.
- **Nonce Management**: Generates and manages short-lived nonces to prevent replay attacks.
- **JWT Issuance**: Issues signed JWT tokens upon successful verification.
- **Composable**: Integrates seamlessly with `@micro-cms/core` and `@micro-cms/express-adapter`.

## Installation
```bash
pnpm add @micro-cms/crypto-auth-node
```

## Usage

### Integrating with Micro-CMS App
```typescript
import { createApp } from '@micro-cms/core';
import { bindExpressRoutes } from '@micro-cms/express-adapter';
import CryptoAuthModule from '@micro-cms/crypto-auth-node';
import express from 'express';

const app = express();
const cms = createApp();

cms.use(CryptoAuthModule, {
  jwtSecret: process.env.JWT_SECRET,
  jwtExpiresIn: '24h',
  // Optional hook to provision or find users in your DB
  onVerified: async ({ address, network, token, req }) => {
    // Return user object to be included in the response
    return { id: 1, address, network };
  }
});

cms.start().then(() => {
  bindExpressRoutes({ app, cms });
});
```

## Provided Endpoints
When bound to an Express app, this module provides:

- `POST /api/auth/crypto/nonce`: Generates a nonce for a wallet address.
  - Body: `{ "address": "..." }`
- `POST /api/auth/crypto/verify`: Verifies a signature and returns a token.
  - Body: `{ "address": "...", "signature": "...", "network": "solana" | "evm" }`

## Configuration Options

| Option | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `jwtSecret` | `string` | 'fallback-secret' | Secret used to sign JWT tokens |
| `jwtExpiresIn` | `string` | '24h' | JWT expiration time (e.g., '1h', '7d') |
| `onVerified` | `Function` | - | Async hook called after successful verification |
npm package: @micro-cms/crypto-auth-ui
Description: Composable Crypto Authentication Widget for Micro-CMS
Latest version: 1.0.39

# @micro-cms/crypto-auth-ui

A composable React widget and hook for authenticating users with crypto wallets (Solana and Base/EVM).

## Features
- **Multi-Chain**: Supports Solana (Phantom) and EVM (MetaMask, Coinbase Wallet, etc.).
- **Highly Configurable**: Control which networks to display and customize the header.
- **Style Isolation**: Uses scoped Tailwind CSS (prefixed with `mcms-`) and automatic style injection.
- **Zero Configuration**: Works out of the box with Micro-CMS backend modules.

## Installation
```bash
pnpm add @micro-cms/crypto-auth-ui
```

## Usage

### Using the Widget
```tsx
import { AuthWidget } from '@micro-cms/crypto-auth-ui';

function LoginPage() {
  const handleSuccess = (token: string) => {
    console.log('Authenticated!', token);
  };

  return (
    <AuthWidget 
      onSuccess={handleSuccess}
      // Configure allowed networks (default: ['solana', 'evm'])
      allowedNetworks={['solana']}
      // Optional: Hide default header or provide custom component
      hideHeader={false}
      // headerComponent={<MyCustomHeader />}
      endpoints={{
        nonce: '/api/auth/crypto/nonce',
        verify: '/api/auth/crypto/verify'
      }}
      headers={{
        'X-Tenant-ID': 'my-tenant'
      }}
    />
  );
}
```

### Properties

| Property | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `onSuccess` | `(token: string) => void` | - | Callback on successful authentication |
| `onError` | `(error: Error) => void` | - | Callback on authentication error |
| `allowedNetworks` | `('solana' \| 'evm')[]` | `['solana', 'evm']` | Which networks to show in the UI |
| `hideHeader` | `boolean` | `false` | Whether to hide the widget header |
| `headerComponent` | `React.ReactNode` | - | Custom component to replace the default header |
| `endpoints` | `{ nonce?: string, verify?: string }` | - | Custom backend API paths |
| `headers` | `Record<string, string>` | - | Custom headers for fetch requests |
| `className` | `string` | - | Custom container class |

### Using the Hook
```tsx
import { useCryptoAuth } from '@micro-cms/crypto-auth-ui';

const { authenticate, status, error } = useCryptoAuth({
  onSuccess: (token) => console.log(token),
  headers: { 'X-Tenant-ID': 'my-tenant' }
});

// Trigger login
authenticate('solana'); // or 'evm'
```
npm package: @micro-cms/crypto-payments
Description: Composable Crypto Payment Widget for Micro-CMS
Latest version: 1.0.39

# @micro-cms/crypto-payments

A composable, drop-in React widget for accepting cryptocurrency payments in your application.

## Features

*   **Multi-Chain Support:** Built-in adapters for Solana (Phantom) and EVM (MetaMask).
*   **Headless Hooks:** `usePayment` hook for custom UI implementation.
*   **Secure Handshake:** Standardized backend protocol (`initiate` -> `verify`) to ensure transaction integrity.
*   **Tailwind Styled:** Comes with a clean, pre-styled widget that respects your theme.

## Installation

```bash
pnpm add @micro-cms/crypto-payments
```

## Usage

### 1. Basic Widget

```tsx
import { PaymentWidget } from '@micro-cms/crypto-payments';
import '@micro-cms/crypto-payments/dist/index.css';

function Checkout() {
  return (
    <PaymentWidget
      orderId="ord_123"
      amount={10.50}
      endpoints={{
        initiate: '/api/orders/initiate',
        verify: '/api/orders/verify-payment'
      }}
      onSuccess={(receipt) => {
        console.log('Payment confirmed:', receipt);
      }}
    />
  );
}
```

### 2. Custom UI with `usePayment`

```tsx
import { usePayment } from '@micro-cms/crypto-payments';

function CustomCheckout() {
  const { 
    initiate, 
    status, 
    handleSolanaPay, 
    handleEVMPay 
  } = usePayment({ orderId: '123' });

  return (
    <div>
      <button onClick={initiate}>Start</button>
      
      {status === 'pending_signature' && (
        <>
          <button onClick={handleSolanaPay}>Pay with Solana</button>
          <button onClick={handleEVMPay}>Pay with Ethereum</button>
        </>
      )}
    </div>
  );
}
```

## Backend Requirements

Your backend must implement two endpoints:

1.  **POST /initiate**
    *   Input: `{ productId, amount, currency, paymentProvider: 'crypto' }`
    *   Output: `{ paymentAddress, network, nonce, amount }`

2.  **POST /verify**
    *   Input: `{ orderId, transactionHash }`
    *   Output: `{ status: 'confirmed' | 'failed', order }`

## Configuration

The widget supports custom headers for authentication:

```tsx
<PaymentWidget
  headers={{
    'Authorization': 'Bearer ...',
    'X-Tenant-ID': 'my-tenant'
  }}
  // ...
/>
```
npm package: @micro-cms/express-adapter
Description: Express.js framework adapter for Micro-CMS
Latest version: 1.0.39

# @micro-cms/express-adapter

The glue between the Micro-CMS runtime and the Express.js framework. This module automatically discovers API routes defined by other CMS modules and binds them to your Express application.

## Features

- **Automatic Route Discovery:** Polls the CMS runtime for all registered `route-provider` capabilities.
- **Middleware Mapping:** Translates abstract middleware keys used in modules to real Express middleware functions.
- **Error Handling:** Provides a standardized wrapper for catching and reporting errors in CMS routes.
- **Prefix Support:** Allows mounting all CMS routes under a specific base path (e.g., `/api/admin`).

## Installation

```bash
pnpm add @micro-cms/express-adapter
```

## Basic Usage

```javascript
import express from 'express';
import { createApp } from '@micro-cms/core';
import { bindExpressRoutes } from '@micro-cms/express-adapter';
import resourceModule from '@micro-cms/resource-module';

const app = express();
const cms = createApp();

// Load modules
cms.use(resourceModule);
await cms.start();

// Bind CMS routes to Express
bindExpressRoutes({
  app,
  cms,
  routePrefix: '/api/v1',
  middlewareMap: {
    'admin-auth': (req, res, next) => {
      // Your auth logic here
      next();
    }
  }
});

app.listen(3000);
```

## How It Works

Modules like `@micro-cms/resource-module` provide generic `RouteDefinition` objects (containing method, path, and handler) to the CMS runtime. The Express Adapter iterates through these definitions and calls `app.get()`, `app.post()`, etc., on your Express instance, effectively "mounting" the CMS functionality into your existing server.
npm package: @micro-cms/mock-db
Description: A development utility that provides an in-memory database and simulated blockchain payment provider. This allows you to build and test your CMS logic without needing a running PostgreSQL instance or a real blockchain wallet.
Latest version: 1.0.39

# @micro-cms/mock-db

A development utility that provides an in-memory database and simulated blockchain payment provider. This allows you to build and test your CMS logic without needing a running PostgreSQL instance or a real blockchain wallet.

## Features

- **Standardized Data Provider:** Implements the `DataProvider` interface with support for CRUD, pagination, sorting, and searching.
- **Mock Introspection:** Returns a rich, predefined schema (`users`, `posts`, `orders`) to drive the Admin UI.
- **Mock Payment Provider:** Simulates the crypto payment handshake (`initiate` and `verify`) for testing checkout flows.
- **Auto-Sync:** Automatically publishes its schema to the global CMS context on load.

## Installation

```bash
pnpm add @micro-cms/mock-db
```

## Basic Usage

```javascript
import { createApp } from '@micro-cms/core';
import mockDbModule from '@micro-cms/mock-db';
import adminUiModule from '@micro-cms/admin-ui';

const app = createApp();

// Use the mock database
app.use(mockDbModule);

// The Admin UI will automatically discover the schema from the mock DB
app.use(adminUiModule);

await app.start();
```

## How It Works

The module registers implementation for three core CMS capabilities:
1. `database-adapter`: Handles data persistence (in-memory).
2. `introspection`: Provides the schema metadata.
3. `payment-provider`: Simulates blockchain interactions.

This makes it the perfect "companion" module for front-end development before the real back-end is ready.
npm package: @micro-cms/node-adapter
Description: A "translator" module that allows the Micro-CMS runtime to communicate with an existing REST API. This is the primary module used when you have a backend with CRUD endpoints and want to instantly generate a full-featured admin panel for it.
Latest version: 1.0.39

# @micro-cms/node-adapter

A "translator" module that allows the Micro-CMS runtime to communicate with an existing REST API. This is the primary module used when you have a backend with CRUD endpoints and want to instantly generate a full-featured admin panel for it.

## Features

- **API Mapping:** Translates `DataProvider` calls into standard RESTful requests (`GET`, `POST`, `PATCH`, `DELETE`).
- **Schema Introspection:** Fetches data models from a remote `/admin/schema` endpoint to drive the Admin UI.
- **Authentication:** Supports Bearer Token authentication via configuration or local storage.
- **Pagination & Sorting:** Passes through UI state to the API for efficient server-side data handling.

## Installation

```bash
pnpm add @micro-cms/node-adapter
```

## Basic Usage

```javascript
import { createApp } from '@micro-cms/core';
import nodeAdapter from '@micro-cms/node-adapter';
import adminUi from '@micro-cms/admin-ui';

const app = createApp();

// Configure the adapter to point to your API
app.use(nodeAdapter, { 
  apiUrl: 'https://my-api.com',
  token: 'your-secret-token'
});

app.use(adminUi);

await app.start();
```

## API Contract

For this adapter to work, your existing API **must** expose the following endpoints:

1.  **GET /admin/schema:** Must return a JSON object defining your resources and their fields.
2.  **GET /admin/resources/:name:** Must return a paginated list of records.
3.  **POST /admin/resources/:name:** Must handle record creation.
4.  **PATCH /admin/resources/:name/:id:** Must handle updates.
5.  **DELETE /admin/resources/:name/:id:** Must handle deletion.
npm package: @micro-cms/resource-module
Description: Standardized CRUD and Schema routes for Micro-CMS
Latest version: 1.0.39

# @micro-cms/resource-module

A core module that provides framework-agnostic CRUD (Create, Read, Update, Delete) business logic and API route definitions. It acts as the bridge between your database adapter and your web server adapter.

## Features

- **Standardized API Routes:** Provides pre-defined `RouteDefinition`s for resource listing, retrieval, creation, updates, and deletion.
- **Automatic Introspection:** Exposes a `/schema` endpoint that queries the `database-adapter` to describe the data structure.
- **Framework Agnostic:** Generates generic route handlers that can be mounted on Express, Hono, Fastify, or any other supported web framework.
- **Middleware Integration:** Uses abstract middleware keys (like `admin-auth`) that are resolved by the server adapter.

## Installation

```bash
pnpm add @micro-cms/resource-module
```

## Basic Usage

```javascript
import { createApp } from '@micro-cms/core';
import { createResourceModule } from '@micro-cms/resource-module';
import postgresModule from '@micro-cms/postgres';

const app = createApp();

// Resource module REQUIRES a database-adapter
app.use(postgresModule);
app.use(createResourceModule());

await app.start();
```

## Routes Provided

| Method | Path | Description |
| :--- | :--- | :--- |
| `GET` | `/schema` | Returns the data schema for all entities. |
| `GET` | `/resources/:name` | Lists records for a specific resource (supports paging/sorting). |
| `GET` | `/resources/:name/:id` | Returns a single record by ID. |
| `POST` | `/resources/:name` | Creates a new record. |
| `PATCH` | `/resources/:name/:id` | Updates an existing record. |
| `DELETE` | `/resources/:name/:id` | Deletes a record. |
npm package: @micro-cms/types
Description: Standardized TypeScript interfaces and type definitions for the Micro-CMS ecosystem. This package ensures strict contracts between modules, the runtime, and front-end components.
Latest version: 1.0.39

# @micro-cms/types

Standardized TypeScript interfaces and type definitions for the Micro-CMS ecosystem. This package ensures strict contracts between modules, the runtime, and front-end components.

## Installation

```bash
pnpm add @micro-cms/types
```

## Key Definitions

### 1. Schema System
Defines the `Entity`, `Field`, and `Schema` structures used to drive the Admin UI and validation logic.

### 2. Module System
- **`CmsModule`**: The interface every module must implement.
- **`ModuleManifest`**: Metadata about a module, including its capabilities (`provides`) and requirements (`requires`).
- **`CmsContext`**: The object passed to a module during load, containing access to the runtime, events, and shared state.

### 3. Capabilities
Contracts for common system functionalities:
- **`DataProvider`**: For database adapters.
- **`RouteProvider`**: For contributing API endpoints.
- **`PaymentProvider`**: For blockchain payment integrations.

### 4. Event System
Types for the staged event bus, including `EventStage` (`validation`, `processing`, `notification`) and `SubscriptionOptions`.

## Usage

This package is typically used as a `devDependency` in other modules to ensure type safety:

```typescript
import { CmsModule, CmsContext } from '@micro-cms/types';

export default {
  manifest: {
    name: 'my-module',
    provides: ['custom-capability']
  },
  async load(context: CmsContext) {
    // ...
  }
} as CmsModule;
```
npm package: @micro-courses/client
Description: This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
Latest version: 0.1.5

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).