Skip to content

tobiasdiez/nuxt-forestadmin

Repository files navigation

Nuxt module for Forest Admin

npm version npm downloads Github Actions Codecov

This package allows you to easily integrate Forest Admin in your Nuxt 3 application.

Features

  • TODO

Installation

# npm
npm install nuxt-forestadmin

# yarn
yarn add nuxt-forestadmin

# pnpm
pnpm add nuxt-forestadmin

You also need to install at least one of the Forest Admin data source packages.

Usage

  1. Add the module in nuxt.config.ts and specify the datasource:

    // Replace with a different datasource if needed
    import { createSqlDataSource } from '@forestadmin/datasource-sql'
    export default defineNuxtConfig({
       modules: [
          'nuxt-forestadmin'
       ],
       forestadmin: {
          dataSource: {
             factory: createSqlDataSource("<DATABASE URL>")
          }
       }
    })
    ̀ ``
  2. Specify the authSecret and envSecret that you obtained during the onboarding procedure. You have two options to set them:

    • Via the Runtime Config inside nuxt.config.ts:

      runtimeConfig: {
         forestadmin: {
            authSecret: "...",
            envSecret: "..."
         }
      }
      ̀ ``
      
      These can then be overwritten by the environment variables `NUXT_FORESTADMIN_AUTHSECRET` and `NUXT_FORESTADMIN_ENVSECRET` at runtime.
    • Via the forestadmin key inside the nuxt.config.ts at build-time:

      forestadmin: {
         authSecret: "...",
         envSecret: "..."
      }
  3. TODO

  4. That's it! You can now use Forest Admin in your Nuxt app ✨

💻 Development

  • Clone this repository
  • Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10).
  • Install dependencies using pnpm install.
    • Run pnpm run prepare to generate type stubs.
  • Use pnpm run dev to start playground in development mode.

License

Made with 💛

Published under MIT License.

About

Forest Admin for Nuxt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published