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

master-data-management-react

v0.1.7

Published

A flexible, configurable React package for managing master data with dynamic forms and tables

Readme

master-data-management-react

A reusable React library for managing master data using metadata-driven forms and tables.
It automatically generates grids and forms while letting you fully control APIs, routing, and authentication.


✨ Features

  • 📊 Server-side data grid
    • Pagination
    • Filters
    • Multi-column sorting
  • 📝 Auto-generated forms
    • Create / View / Edit
  • 🔄 Full CRUD support
  • 📤 CSV & Excel export
  • 🎯 Metadata-driven UI (no hardcoded fields)
  • 🎨 Material-UI based components
  • 🧩 Works with any backend and routing setup

📦 Installation

npm install master-data-management-react

📚 Peer Dependencies

npm install react react-dom react-router-dom axios \
@mui/material @emotion/react @emotion/styled \
ag-grid-react ag-grid-community

🚀 Quick Start

⚠️ IMPORTANT: Configure your axios instance with a baseURL to ensure dropdown options and all API calls go to your backend API, not your frontend. See CLIENT_AXIOS_SETUP.md for detailed setup.

import { MasterView } from "master-data-management-react";
import axios from "axios";

// ✅ CRITICAL: Configure axios with baseURL
const apiClient = axios.create({
  baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:3000',
});
const apiClient = axios.create({
  baseURL: "https://api.example.com",
});

const apiEndpoints = {
  entities: "/master/entities",
  metadata: (entity) => `/master/${entity}/metadata`,
  records: (entity) => `/master/${entity}/records`,
  recordById: (entity, id) => `/master/${entity}/records/${id}`,
  exportCSV: (entity) => `/master/${entity}/export/csv`,
  exportExcel: (entity) => `/master/${entity}/export/excel`,
};

export default function App() {
  return (
    <MasterView
      apiClient={apiClient}
      apiEndpoints={apiEndpoints}
    />
  );
}

⚠️ Important: Your apiClient must have a baseURL configured. Without it, API calls will try to fetch from the frontend itself instead of your backend.

📖 Need help with axios setup? See AXIOS_SETUP_GUIDE.md for detailed instructions, including:

  • Configuring axios with interceptors (JWT auth)
  • Environment variables setup
  • Monorepo considerations
  • Troubleshooting common issues

📝 Forms (Create / View / Edit)

import { MasterForm } from "master-data-management-react";
import { FORM_MODES } from "master-data-management-react/constants";

<MasterForm
  apiClient={apiClient}
  apiEndpoints={apiEndpoints}
  entity="country"
  id="10"
  mode={FORM_MODES.EDIT}
  onBack={() => navigate("/master")}
  onSuccess={() => navigate("/master")}
/>;

🧭 Routing (Example)

This package does not enforce routing. You define routes however your application prefers.

<Route path="master" element={<MasterView />} />
<Route path="master/:entity/new" element={<MasterForm />} />
<Route path="master/:entity/:id" element={<MasterForm />} />
<Route path="master/:entity/:id/edit" element={<MasterForm />} />

🎨 Styling

Import styles once in your app entry file:

import "master-data-management-react/dist/style.css";
import "ag-grid-community/styles/ag-grid.css";
import "ag-grid-community/styles/ag-theme-alpine.css";

🔗 Backend API Contract

Your backend must expose the following endpoints:

| Endpoint | Method | | ------------------------------ | ------ | | /master/entities | GET | | /master/:entity/metadata | GET | | /master/:entity/records | GET | | /master/:entity/records/:id | GET | | /master/:entity/records | POST | | /master/:entity/records/:id | PUT | | /master/:entity/export/csv | GET | | /master/:entity/export/excel | GET |


🧩 Metadata Example

{
  "parameterList": [
    { "name": "countryName", "label": "Country", "dataType": "string" }
  ],
  "resultsList": [
    { "name": "countryName", "label": "Country Name" }
  ],
  "formConfig": {
    "Country Name": {
      "fieldName": "countryName",
      "fieldType": "input",
      "validation": { "required": true }
    }
  }
}

⚙️ Customization

You can customize:

  • ✅ API URLs
  • ✅ Axios instance (auth, interceptors, refresh tokens)
  • ✅ Routing & navigation
  • ✅ Permissions / guards
  • ✅ Styling & MUI theme
  • ✅ Backend metadata behavior

❌ What This Package Does NOT Do

  • ❌ Force routing
  • ❌ Handle authentication
  • ❌ Assume backend structure

🧠 How It Works (Simple)

  1. Backend sends metadata
  2. Grid & forms render automatically
  3. CRUD, sorting, filtering handled internally
  4. You control navigation and APIs
  5. If wanted auto routes then use backend package master-data-management (npm i master-data-management) works for nestjs typeorm

📄 License

MIT License