Getting StartedInstallation

Installation

node ace add @oniryk/dreamer

After installing the package, you will be prompted with some questions and a dreamer config file will be generated like this:

import { defineConfig } from '@oniryk/dreamer'
 
const dreamerConfig = defineConfig({
  useUUID: true,
  useSoftDelete: true,
  bruno: {
    enabled: true,
    documentsDir: '/docs',
    useAuth: true,
  },
})
 
export default dreamerConfig

Configuring

  • useUUID: when enabled, all models generated by the dreamer command will use uuid as field instead of id in the methods find() and findOrFail() from Lucid. learn more
  • useSoftDelete: when enabled, all models generated by the dreamer command will implement soft deletes. It will add the field deleted_at in the migration file. learn more
  • bruno.enabled: when enabled, will generate bruno files for all routes generated by the dreamer command
  • bruno.documentsDir: specifies where bruno’s files will be placed
  • bruno.useAuth: when enabled, will automatically add an Authorization: Bearer ... into the request file.