Giter Club home page Giter Club logo

edubox-nuxt's Introduction

@badaso/nuxt

Nuxt module for integration with badaso out of the box.

Features

  • RESTful methods
  • Handle errors with hooks

Installation

Using npm:

npm install @badaso/nuxt

Using yarn:

yarn add @badaso/nuxt

Configure

Add @badaso/nuxt to the modules section of nuxt.config.js:

export default {
  modules: ['@badaso/nuxt'],
  badaso: {
    // Options
  }
}

Options

  • endpoint Default: process.env.BADASO_URL || 'http://localhost:8000' URL of the Badaso server. Environtment variable BADASO_URL can be used to override endpoint.
  • entities Default: {} You can specify the entities that present in your API. For example:
    export default {
      badaso: {
        entities: {
          post: true,
          crud: ['articles', 'products']
        }
      }
    }
    Then you can use this.$badaso.$post.browse() in your application. For now, entities only accept:
    • post: Boolean
    • content: Boolean
    • crud: Array
  • key Key used for the cookie name as well as localStorage/sessionStorage key.
  • prefix Default: badaso-api URL prefix to access Badaso API server.

Usage

Authentication

To handle authentication in your Nuxt app with Badaso, you can:

Login

await this.$badaso.login({ email: '', password: '' })

Register

await this.$badaso.register({ email: '', name: '', password: '', passwordConfirmation: '' })

Verify

await this.$badaso.verify({ email: '', token: '' })

Resend Email Verification

await this.$badaso.sendEmailConfirmation({ email: '' })

Logout

await this.$badaso.logout()

Forgot Password

await this.$badaso.forgotPassword({ email: '' })

Verify Token for Forgot Password

await this.$badaso.verifyForgotPasswordToken({ email: '', token: '' })

Reset Password

await this.$badaso.resetPassword({ email: '', password: '', token: '' })

User

Once logged in, you can access your user everywhere:

this.$badaso.user

Post Module

Content Module

For content module, please refer to this page

CRUD Generated

For CRUD generated, please refer to this page

Development

  1. Clone this repo
  2. Install dependencies using npm install or yarn install
  3. Start development server using npm run dev or yarn dev

edubox-nuxt's People

Contributors

rizkiheryandi avatar dannyatthaya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.