Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/benchmarks/shadcn-dashboard/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

# testing
/coverage
/test-output

# next.js
/.next/
Expand Down
53 changes: 30 additions & 23 deletions packages/benchmarks/shadcn-dashboard/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
# shadcn Dashboard Benchmark

## Getting Started
This is a demo application built with [shadcn/ui](https://ui.shadcn.com/) used as a target for React Grab benchmarking tests.

First, run the development server:
## Demo Data

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
The dashboard displays demo data from `app/dashboard/data.json`. This data can be dynamically regenerated using the included script.

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
### Generating Demo Data

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
To regenerate the demo data with randomized values:

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
```bash
cd packages/benchmarks/shadcn-dashboard
npx tsx scripts/generate-demo-data.ts
```

## Learn More
By default, the script generates 68 items. You can specify a custom count:

To learn more about Next.js, take a look at the following resources:
```bash
npx tsx scripts/generate-demo-data.ts 100
```

The script generates realistic demo data matching the dashboard schema with:
- Sequential IDs
- Random headers from a pool of document section names
- Random types (Cover page, Narrative, Technical content, etc.)
- Random statuses (Done, In Process)
- Random target values (0-31)
- Random limit values (0-40)
- Random reviewer assignments

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
The script is idempotent and can be safely run multiple times to reset or update the demo dataset.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
## Development

## Deploy on Vercel
First, run the development server:

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
```bash
npm run dev
```

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
7 changes: 5 additions & 2 deletions packages/benchmarks/shadcn-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint"
"lint": "eslint",
"test": "vitest run"
},
"dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.1.45",
Expand Down Expand Up @@ -54,7 +55,9 @@
"eslint": "^9",
"eslint-config-next": "16.0.7",
"tailwindcss": "^4",
"tsx": "^4.19.2",
"tw-animate-css": "^1.4.0",
"typescript": "^5"
"typescript": "^5",
"vitest": "^3.2.4"
}
}
136 changes: 136 additions & 0 deletions packages/benchmarks/shadcn-dashboard/scripts/generate-demo-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import { writeFileSync } from "node:fs"
import { join } from "node:path"

interface DemoDataItem {
id: number
header: string
type: string
status: string
target: string
limit: string
reviewer: string
}

const HEADERS = [
"Executive Summary",
"Introduction",
"Background",
"Methodology",
"Findings",
"Analysis",
"Recommendations",
"Conclusion",
"Appendix A",
"Appendix B",
"References",
"Glossary",
"Index",
"Abstract",
"Literature Review",
"Data Collection",
"Results",
"Discussion",
"Limitations",
"Future Work",
"Acknowledgments",
"Table of Figures",
"List of Tables",
"Abbreviations",
"Technical Specifications",
"Implementation Details",
"Testing Procedures",
"Risk Assessment",
"Budget Overview",
"Timeline",
]

const TYPES = [
"Cover page",
"Table of contents",
"Narrative",
"Technical content",
"Plain language",
"Legal",
"Visual",
"Financial",
"Research",
"Planning",
]

const STATUSES = ["Done", "In Process"]

const REVIEWERS = [
"Eddie Lake",
"Jamik Tashpulatov",
"Maya Johnson",
"Carlos Rodriguez",
"Sarah Chen",
"Raj Patel",
"Leila Ahmadi",
"Thomas Wilson",
"Sophia Martinez",
"Alex Thompson",
"Nina Patel",
"David Kim",
"Maria Garcia",
"James Wilson",
"Priya Singh",
"Michael Chen",
"Lisa Wong",
"Emma Davis",
"Daniel Park",
"Sarah Johnson",
"Assign reviewer",
]

const randomItem = <T>(array: T[]): T =>
array[Math.floor(Math.random() * array.length)]

const randomNumber = (min: number, max: number): string =>
Math.floor(Math.random() * (max - min + 1) + min).toString()

const generateDemoData = (count: number): DemoDataItem[] => {
const data: DemoDataItem[] = []

for (let index = 0; index < count; index++) {
data.push({
id: index + 1,
header: randomItem(HEADERS),
type: randomItem(TYPES),
status: randomItem(STATUSES),
target: randomNumber(0, 31),
limit: randomNumber(0, 40),
reviewer: randomItem(REVIEWERS),
})
}

return data
}

const main = () => {
const itemCount = Number.parseInt(process.argv[2] || "68", 10)

if (Number.isNaN(itemCount) || itemCount < 1) {
console.error("Error: Item count must be a positive number")
process.exit(1)
}

const demoData = generateDemoData(itemCount)
const outputPath = join(
process.cwd(),
"app",
"dashboard",
"data.json",
)

try {
writeFileSync(outputPath, JSON.stringify(demoData, null, 2) + "\n")
console.log(`Successfully generated ${itemCount} demo items`)
console.log(`Output written to: ${outputPath}`)
} catch (error) {
console.error("Error writing demo data:", error)
process.exit(1)
}
}

main()
Loading