Giter Club home page Giter Club logo

mojito's Introduction

Mojito

Mojito is a backend management system based on Laravel, Vue, Element.

Simplified Chinese

中文README

Screenshot

Feature

  • Quickly derive multiple backend systems
  • Built-in role, permissions, user, menu management
  • OAuth 2.0 and support multi-table authentication
  • Complete PHPUnit test
  • The minimum unit of API privilege is routing, and the minimum unit of page privilege is button or link.
  • SPA
  • Multi-tab page
  • Support for multi-language configuration
  • Simple page layout

Requirements

  • Laravel >= 5.5.0
  • Vue >= 2.5.17
  • Element >= 2.4.6

Compatibility

Laravel Mojito admin
5.5, 5.6 1.0.*
5.7+ 1.1.*

Installation

First install laravel and make sure you have the correct database connection configured.

vcs:

    "repositories": [{
        "type": "vcs",
        "url": "https://github.com/osindex/mojito.git"
    }]
composer require "moell/mojito":"dev-mix"

If there is a conflict caused by the random_compat version, manually add moell/mojito to composer.json and then composer update to install.

Then run the following command to publish the resource:

php artisan mojito:install

Successful execution of the command will generate configuration files, data migration, and building SPA files.

Add the appropriate guards and providers to config/auth.php as follows:

'guards' => [
        ...
        'admin' => [
            'driver' => 'passport',
            'provider' => 'admin'
        ]
    ],

'providers' => [
        ...
        'admin' => [
            'driver' => 'eloquent',
            'model' => \Moell\Mojito\Models\AdminUser::class,
        ]
    ],

Add oauth.providers and mojito.permission in the middle of the $routeMiddleware property in app/Http/Kernel.php and replace the auth middleware with the following:

class Kernel extends HttpKernel
{
    protected $routeMiddleware = [
        // 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
        'auth' => \SMartins\PassportMultiauth\Http\Middleware\MultiAuthenticate::class,
        'oauth.providers' => \SMartins\PassportMultiauth\Http\Middleware\AddCustomProvider::class,
        'mojito.permission' => \Moell\Mojito\Http\Middleware\Authenticate::class,
    ];
}

Perform data migration, data filling

php artisan migrate

php artisan db:seed --class="Moell\Mojito\Database\MojitoTableSeeder"

Passport installation and configuration

php artisan passport:install

After successful execution, obtain the corresponding password to grant the client's ID and secret and configure it to the corresponding .env:

MIX_CLIENT_ID=2
MIX_CLIENT_SECRET=AtejVSZclgemDnvtRZ1Rns576tPNmzYhpIgtT1eP

Install JavaScript Dependencies

npm install
npm install -D vuex@^3.0.1 vue-router@^3.0.1 vue-i18n@^8.1.0 localforage@^1.7.2 element-ui@^2.9.1

Add admin.js to webpack.mix.js

mix.js('resources/assets/js/app.js', 'public/js')
    .sass('resources/assets/sass/app.scss', 'public/css')
    //.js('resources/js/admin.js', 'public/js') laravel5.7+
    .js('resources/assets/js/admin.js', 'public/js')

Run Mix

#npm run watch
npm run production

Log in

url: http://localhost/mojito#/admin/login

email: [email protected]

password: password

Dependent on open source software

  • Laravel
  • Vue
  • Element UI
  • laravel/passport
  • smartins/passport-multiauth
  • spatie/laravel-permission
  • orchestra/testbench

Reward

License

Apache License Version 2.0 see http://www.apache.org/licenses/LICENSE-2.0.html

mojito's People

Contributors

moell-peng avatar osindex avatar samnela avatar eddiclin 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.