A CLI toolkit to rapidly scaffold dashboard UIs and RESTful APIs in your Next.js (App Router) projects using your Prisma database schema.
- ⚡ Auto-generate forms, tables, and API routes from Prisma models
- 📦 Works out-of-the-box with Next.js App Router
- 🛠️ Supports RESTful API generation
- 🧱 Schema-driven resource scaffolding
- 🧩 Built-in support for add/edit UI forms
npm install nextjs-panel
Follow the steps below to generate a complete dashboard in minutes:
npm install nextjs-panel
npx nextjs-panel setup
This sets up necessary files and folder structure for the admin panel.
npx prisma init
Edit the generated prisma/schema.prisma
file and set your database:
datasource db {
provider = "postgresql" // or mysql, sqlite, etc.
url = env("DATABASE_URL")
}
Update your .env
file with the correct DATABASE_URL
.
# For existing database:
npx prisma db pull
# For new schema:
npx prisma db push
npx prisma generate
npx nextjs-panel make:resource user
This will generate:
app/admin/users/page.tsx
– Admin dashboard pageapp/api/users/route.ts
– REST API for CRUD- Dynamic forms & tables powered by Prisma
Given a User
model in prisma/schema.prisma
:
model User {
id Int @id @default(autoincrement())
name String
email String @unique
}
Run:
npx nextjs-panel make:resource user
This will instantly scaffold everything you need to view, create, update, and delete users in your dashboard.
app/
├── admin/
│ └── users/
│ └── page.tsx # Dashboard view
└── api/
└── users/
└── route.ts # RESTful API
- [ ] Field-level validation
- [ ] Role-based access control
- [ ] File/image upload fields
- [ ] Relationship support
- [ ] Dark mode theming
- [ ] CLI config customization
Pull requests are welcome. For major changes, please open an issue first to discuss what you’d like to change.
git clone https://github.com/yourusername/nextjs-panel.git
cd nextjs-panel
npm install
MIT © Your Name
If you have any feedback, ideas, or questions, feel free to open an issue or reach out!