dashmin

1.2.6 • Public • Published

... DASHmin ...

Built with ❤︎ by Romullo

DASHmin is only a base for the development of your Administrative System! it still (still ;) .. does not have a range of components, but is well on the way to help you in development! By default Bootstrap is already included, if you know the basics of it,easily create your pages!

If you want to create your admin using DASHmin, follow the installation tutorial below!

✓ Structure

├── node_modules
├── src
│   ├── components
│   ├── store
│   ├── dashmin.js
│   ├── index.js
├── .editorconfig
├── .eslintrc.json
├── .gitignore
├── .travis.yml
├── package.json
├── README.md
├── LICENCE.md
├── logo.png
└── dashmin.png

✓ Requirements

To run this project, you need to have Node.js installed on your machine! If you do not have it, go to the website https://nodejs.org/en/ and download and install it as it is taught in the documentation!

✓ Instalation

To get started, create your application using the create-react-app.

create-react-app example

Install

After creating the application using create-react-app enter the project folder, open the terminal and install thedashmin.

yarn add dashmin

or

npm i dashmin

✓ How to use

Dashmin is just a basic interface to help you in creating your admin dashboard. After you download and install the dependencies, you can start your application.

To begin, delete all files inside src/, leaving only index.js andapp.js. after doing so create two new views androutes folders.

├── node_modules
├── src
│   ├── views
│   ├── routes
│   ├── app.js
│   ├── index.js
├── package.json

views/example.js

Within the views directory create your view component to be rendered.

// Imports
import React from 'react';
 
// Products
const Example01 = () => (
  <div>
    <h1>Example01</h1>
  </div>
);
 
export default Example01;
// Imports
import React from 'react';
 
// Products
const Example02 = () => (
  <div>
    <h1>Example02</h1>
  </div>
);
 
export default Example02;

routes/index.js

Shortly after creating your view component create a route file by passing the following properties.

// Routes
const Routes = {
  example01: '/example01',
  example02: '/example02',
};
 

After defining the routes, define a const Dashmin by passing defining properties. Dashmin requires information for navbar,sidebar and content. so it is important to inform them.

const Dashmin = {
  // navbar
  navbar: {
 
  }
 
  // sidebar
  sidebar: {
 
  }
 
  // Content
  content: [
 
  ]
}
 
navbar: {}

in navbar you need to pass a user object, passingavatar, name andjobRole. these will be the information displayed in the dropdown.

const Dashmin = {
  // navbar
  navbar: {
    user: {
      avatar: 'https://imgur.com/NpICPSl.jpg',
      name: 'R o m u l l o',
      jobRole: 'Administrator',
    },
  },
}
 
sidebar: {}

For the sidebar you need to passbrand and buttons. For brand you need to pass only the name of your organization by entering the full namemax and abbreviated min. For buttons, aname, icon androute are required.

Sobre os icones .. o Dashmin usa o React icons, então você pode simplesmente importar os icones que deseja usar e passar o component para icon.

// Icons
import {
  IoMdOptions,
  IoMdPeople,
  IoMdCard,
  IoMdCart,
  IoMdAnalytics
} from 'react-icons/io'
 
const Dashmin = {
  // sidebar
  sidebar: {
    // brand
    brand: {
      max: 'D A S H M I N',
      min: 'dmin'
    },
 
    // buttons
    buttons: [
      {
        name: 'Example01',
        icon: {
          component: <IoMdOptions />,
        },
        route: Routes.example01,
      },
      {
        name: 'Example02',
        icon: {
          component: <IoMdOptions />,
        },
        route: Routes.example02,
      },
    ]
  }
}
 
content: []

Finally the part of content. For it will be necessary to pass an array of objects containing the route and the visualization component to be redemptivelyview.

// Views
import Example01 from '../pages/example01';
import Example02 from '../pages/example02';
 
const Dashmin = {
  // content
  content: [
    {
      route: Routes.example01,
      view: Example01
    },
    {
      route: Routes.example02,
      view: Example02
    },
  ]
}
 

Full configuration

The Route file containing the settings made above.

// React
import React from 'react';
 
// Views
import Dashboard from '../views/Dashboard';
import Users from '../views/Users';
import Financial from '../views/Financial';
import Products from '../views/Products';
import Reports from '../views/Reports';
 
// Icons
import {
  IoMdOptions,
  IoMdPeople,
  IoMdCard,
  IoMdCart,
  IoMdAnalytics
} from 'react-icons/io'
 
// Routes
const Routes = {
  dashboard: '/',
  users: '/users',
  financial: '/financial',
  products: '/products',
  reports: '/reports',
};
 
// Dashmin
const Dashmin = {
  // Navbar
  navbar: {
    user: {
      avatar: 'https://imgur.com/NpICPSl.jpg',
      name: 'R o m u l l o',
      jobRole: 'Administrator',
    },
  },
 
  // Sidebar
  sidebar: {
    // brand
    brand: {
      max: 'D A S H M I N',
      min: 'dmin'
    },
 
    // buttons
    buttons: [
      {
        name: 'Example01',
        icon: {
          component: <IoMdOptions />,
        },
        route: Routes.example01,
      },
      {
        name: 'Example02',
        icon: {
          component: <IoMdOptions />,
        },
        route: Routes.example02,
      },
    ]
  },
 
  // Content
  content: [
    {
      route: Routes.example01,
      view: Example01
    },
    {
      route: Routes.example02,
      view: Example02
    },
  ]
};
 
export default Dashmin;

app.js

Finally, in your app.js importdashmin and pass the following properties.

// Imports
import React from 'react';
import { Dashmin } from 'dashmin';
import routes from './routes';
 
const App = () => (
  <Dashmin
    navbar={routes.navbar}
    sidebar={routes.sidebar}
    content={routes.content}
  />
);
 
export default App;

For more exexmplos you can check https://github.com/hiukky/dashmin-react/tree/demo.

Finishing

After you have followed the steps above, you can now test your application using one of the commands below.

yarn run start

or

npm run start

Ready!! if everything went well, just check your application in the browser http://127.0.0.1:3000/.

✓ Preview

Demo

✓ Libraries

Some frontend libs included.


Bootstrap

React Icons

Readme

Keywords

none

Package Sidebar

Install

npm i dashmin

Weekly Downloads

1

Version

1.2.6

License

MIT

Unpacked Size

932 kB

Total Files

4

Last publish

Collaborators

  • hiukky