@bunnabyte/erp-report-engine
v1.2.0
Published
Config-driven ERP reporting engine with grid, pivot, filters, and exports
Readme
ERP Report Engine
A config-driven enterprise reporting engine for building dynamic, scalable, and extensible reporting interfaces with support for grids, grouping, pivot views, filtering, and export capabilities.
Designed for modern ERP systems where flexibility, performance, and clean UI are critical.
✨ Features
- 📊 Dynamic Grid Reports
- 🧩 Config-Driven Architecture
- 🔁 Pivot Table Support
- 🔎 Filtering & Search
- 📦 Grouping & Aggregations
- 📤 Export (Excel, CSV, PDF)
- ⚙️ Fully Config-Driven
- ⚛️ React-Based
- 🎨 TailwindCSS Powered UI
- 🧩 Modular ERP-Friendly Design
📦 Installation
1. Install the package
npm install @bunnabyte/erp-report-engine2. Install required dependencies
npm install react@^18 react-dom@^18
npm install lucide-react@^0.400
npm install tailwindcss@^4🎨 Tailwind Setup (IMPORTANT)
In your main CSS file (e.g. index.css):
@import "tailwindcss";
@import "../node_modules/@bunnabyte/erp-report-engine/dist/style.css";✅ This is required for proper styling of the report engine
🚀 Usage
1. Import
import { ReportEngine } from "@bunnabyte/erp-report-engine";2. Define a Report
export const auditData = [
{ action: "Login", user: "Admin", status: "Success", time: "10:00 AM", module: "Auth" },
{ action: "Update", user: "Jane", status: "Success", time: "10:15 AM", module: "Settings" },
{ action: "Delete", user: "Admin", status: "Failed", time: "11:00 AM", module: "User" },
];
export const auditReport = {
id: "audit",
name: "Audit Report",
icon: "Shield",
config: {
data: auditData,
view: "grid",
header: {
title: "Audit Logs",
icon: "Shield",
subtitle: "System security activity"
},
columns: [
{ key: "action", label: "Action" },
{ key: "user", label: "User" },
{ key: "status", label: "Status", type: "status" },
{ key: "time", label: "Time" },
{ key: "module", label: "Module" },
],
groupBy: ["module"],
footer: "Security Restricted",
},
};3. Render the Report
import { ReportEngine } from "@bunnabyte/erp-report-engine";
import { auditReport } from "./reports/auditReport";
export default function App() {
return (
<div className="p-4">
<ReportEngine config={auditReport.config} />
</div>
);
}📊 Sample Reports Included
- Sales Report
- User Report
- Inventory Report
- Finance Report
- HR Report
- Audit Report
- Transport Report
- Procurement Report
- Production Report
- System Logs
🧠 Configuration Overview
| Feature | Description |
| --------- | --------------------- |
| data | Array of records |
| columns | Column definitions |
| view | grid / pivot |
| groupBy | Grouping fields |
| header | Title, icon, subtitle |
| footer | Footer text |
| filters | Enable filtering |
| export | Export options |
⚙️ Configuration API
{
data: any[],
view?: "grid" | "pivot",
header?: {
title: string,
icon?: string,
subtitle?: string,
badge?: string
},
columns: [
{
key: string,
label: string,
type?: "text" | "number" | "currency" | "badge" | "status",
sortable?: boolean,
align?: "left" | "right" | "center",
badgeColors?: Record<string, string>
}
],
filters?: [
{
key: string,
label: string,
type: "select" | "date" | "text",
options?: { label: string, value: any }[]
}
],
sort?: {
field: string,
direction: "asc" | "desc"
},
groupBy?: string[],
aggregations?: {
[key: string]: "sum" | "count" | "avg"
},
pivot?: {
rows: string[],
columns: string[],
values: string[]
},
footer?: string,
exportFileName?: string
}📊 Built-in Column Types
textnumbercurrencybadgestatus
🧩 Example Capabilities
Grouping
groupBy: ["module"]Sorting
sort: { field: "revenue", direction: "desc" }Aggregation
aggregations: { revenue: "sum", deals: "count" }Pivot Mode
view: "pivot",
pivot: {
rows: ["dept"],
columns: ["quarter"],
values: ["revenue"]
}🛠 Development
git clone https://github.com/your-repo/erp-report-engine.git
cd erp-report-engine
npm install
npm run build📈 Roadmap
- Server-side processing
- Role-based access control
- Plugin system
- Charts integration
- Advanced pivot engine
- Theming system
📄 License
MIT
