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

yaml-admin-front

v0.0.81

Published

A frontend library that auto-builds a `react-admin` UI from a single `admin.yml`. With only entity definitions in YAML, it renders list/show/create/edit screens, menus, icons, and upload fields out of the box.

Readme

yaml-admin-front

A frontend library that auto-builds a react-admin UI from a single admin.yml. With only entity definitions in YAML, it renders list/show/create/edit screens, menus, icons, and upload fields out of the box.

Features

  • YAML-driven automation: Reads entity definitions and dynamically creates Resources and CRUD screens
  • Built-in auth: Works with /member/login and /member/islogin endpoints and JWT tokens
  • File uploads: Switch between Local or S3 strategies via YAML (upload.local/upload.s3)
  • Icons: Use @iconify/react icon names directly in YAML for menu/resource icons

Installation

npm i yaml-admin-front
# peers if not already present
npm i react-admin react react-dom @iconify/react

Recommended environment

  • Node.js: 18+
  • React: 19.x
  • react-admin: ^5.10

Quick Start (Vite example)

// App.jsx
import { YMLAdmin } from 'yaml-admin-front';
import adminYamlText from './admin.yml?raw';

export default function App() {
  return <YMLAdmin adminYaml={adminYamlText} />;
}

API host resolution order used by the frontend:

  1. YAML api-host.uri → 2) env VITE_HOST_API → 3) default http://localhost:6911

admin.yml Key Sections

Minimal example (see full example in the repo at example/admin.yml):

api-host:
  uri: localhost:6911

entity:
  member:
    label: 'User'
    icon: 'solar:user-hands-outline'
    fields:
      - { name: name, type: string, required: true }

upload:
  # choose one
  # local: { enable: true }
  # s3:    { enable: true }
  • api-host.uri: Backend API base (if missing scheme, http:// is prepended)
  • entity.‹name›: Label/icon/fields; drives Resource creation and CRUD screens
  • upload.local / upload.s3: Select upload strategy. If omitted, plain data provider is used (no uploads)

When a field includes private: true, secure upload flows are used automatically.


Component API

type YMLAdminProps = {
  adminYaml: string;               // YAML as a string (e.g., Vite ?raw import)
  i18nProvider?: any;              // react-admin i18nProvider
  custom?: Record<string, any>;    // inject custom components/fields if needed
};

Notes

  • YMLAdmin parses adminYaml and composes the react-admin Admin/Resource tree.
  • If an entity has custom: true, only the Resource is added; no auto-scaffolded CRUD.

Authentication

  • Login: POST /member/login → on { token }, saved to localStorage.token and sent via x-access-token header
  • Session check: GET /member/islogin{ r: true } means authenticated
  • Token header: all requests include x-access-token automatically

If you use yaml-admin-api on the backend, you can configure login/checks from the same YAML.


File Uploads

Depending on YAML, the data provider is wrapped with an upload adapter.

  • Local uploads: PUT /api/local/media/upload(… )
  • S3 uploads: Uses presigned URLs for multipart uploads and calls complete/abort APIs

Secure uploads use dedicated /secure endpoints. Multipart flows support progress callbacks.


Environment Variables

  • VITE_HOST_API: Default API base (URL or host:port). Overridden by YAML api-host.uri when present.

Examples

  • Frontend example: example/front1
  • API example: example/api1
  • Sample YAML: example/admin.yml

From the repo root you can run both examples together with:

npm run dev

License

MIT