Getting Started

The getting started guide walks you through how to manually setup a admin dashboard. flashboard actually create your back-end package services such as rest-full api of your models based on loopback node.js framework and generate admin dashboard automatically for data moderation.



Introduction

flashboard can handle your whole back-end includes services, rest-full api and admin dashboard based on loopback node.js framework.
Simply can define your models with several options and get your rest-full api and admin dashboard automatically.
Admin dashboard implemented by vue.js 2 framework and muse-ui as ui-component library that allows you have a multiple themes for your user interface.
You have a database-connector options that allows you to connect your back-end to each database you want such as mongodb or mysql and etc.

Admin demo : http://138.68.46.113/flashboard
demo admin credential:
email: admin@flashboard.com
password: qwertyuiop

Let’s start to build your own back-end services.



Installation

  1. Before you begin, make sure you have Node.js and MongoDB installed. For best results, use the latest LTS (long-term support) release of Node.js.
  2. Running below command in your empty project directory path :
$ git clone https://github.com/vah7id/flashboard.git
  1. First install your services packages by run below command on your project directory :
$ npm run preinstall
  1. Install your admin generator packages by run below command on root directory:
$ npm install
  1. Running back-end services first before running admin dashboard :
$ npm run service
  1. At last you can run your admin dashboard by running below command:
$ npm run dev

for deploy on production you can run build command :

$ npm run build


Admin Default User

In first-time you start the project api/server/boot/script.js create default admin account as you can see below :

  module.exports = function (app) {
  var _ = require('lodash');
  var User = app.models.User;
  var Role = app.models.Role;
  var RoleMapping = app.models.RoleMapping;
  var ACL = app.models.ACL;

  User.create([{
      username: 'flashboard',
      email: 'admin@flashboard.com',
      password: 'qwertyuiop', 
      type: 'admin'
   }], function(err, users) {

  Role.find({ name: 'admin' }, function(err, results) {
      if (err) console.log(err);
      Role.create({
        name: 'admin'
      }, function(err, role) {
        if (err);
        //debug(role);
        role.principals.create({
          principalType: RoleMapping.USER,
          principalId: users[0].id
        }, function(err, principal) {
          if (err) console.log(err);
        
        });
      });
  });
    
  });
};

You can change the initial credential in script.js before start your project.
If you miss this step nevermind, you can login by default admin credentials then create new admin account in dashboard from users section for yourself and manage accounts in there.



Models

After run your project you can see built-in models on your dashboard such as posts, galleries and etc. for starting to create your own website models you should go to next section of documentation.