Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

radmin-free

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

radmin-free

RedwoodJS Admin Panel Generator

  • 0.1.4
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Radmin

RedwoodJS Admin Panel Generator

Usage

Standing in the Redwood app you want to generate an admin panel for you just run npx radmin-free <path-to-admin-panel>

cd ./existing-rw-project
npx radmin-free ../project-admin

Guiding Principles

  • It should be easy to regenerate the admin panel when the db schema changes
  • Admin panel customizations should live separate from the generated code so that no customizations are lost when the panel is regenerated
  • Getting started should always be as easy as just running a single command. No initial setup or configuration should be needed
  • There should be three levels of customizations:
    1. None: The default, and always preferred. Radmin should always provide good defaults
    2. Schema comments: Simple customizations are done by adding triple-slash meta comments to the schema.prisma file
    3. Code: For scenarios where meta comments aren't enough proper TS code should be used to customize Radmin.

Known Limitations

Node version

Needs Node 16.7 (released 18-Aug-2021) or later because of use of fs.cpSync.

Compound IDs

Radmin doesn't support compound IDs yet.

This will not work

model CategoryToProduct {
  product    Product  @relation(fields: [productId], references: [id])
  productId  String   @db.Uuid
  category   Category @relation(fields: [categoryId], references: [id])
  categoryId Int

  @@id([productId, categoryId])
}

You'll have to add an id key, and make the compound id a compound unique constraint instead

model CategoryToProduct {
  id         String   @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  product    Product  @relation(fields: [productId], references: [id])
  productId  String   @db.Uuid
  category   Category @relation(fields: [categoryId], references: [id])
  categoryId Int

  @@unique([productId, categoryId])
}

If you do it exactly like that you should be able to migrate your DB without losing any data

Prisma Generators

If you have additional prisma generators defined in your schema, radmin will error out when you run it. The solution is to manually install the generators in the admin project, and then rerun radmin.

FAQs

Package last updated on 08 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc