Giter Club home page Giter Club logo

dashmin's Introduction

... d a s h m i n ...

Built with ❀︎ by Romullo

Hello dev .. this is Dashmin! It is nothing more than a simple and elegant base to help you in the development of your administrative system. It doesn't have many components yet, but it already has some famous libraries like Material UI and Reactstrap integrated, so if you know any of them it will be easy to create your pages .. if you don't want to use any of them, feel free to use the library. to your liking. So let's start.

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

βœ“ Structure

β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ logo.png
β”‚   β”œβ”€β”€ login.png
β”‚   β”œβ”€β”€ dashmin.png
β”œβ”€β”€ node_modules
β”œβ”€β”€ public
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ components
β”‚   β”œβ”€β”€ helpers
β”‚   β”œβ”€β”€ routes
β”‚   β”œβ”€β”€ services
β”‚   β”œβ”€β”€ store
β”‚   β”œβ”€β”€ views
β”‚   β”œβ”€β”€ App.js
β”‚   β”œβ”€β”€ index.js
β”œβ”€β”€ .editorconfig
β”œβ”€β”€ .env
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .travis.yml
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
└── LICENSE.md

βœ“ Preview

User: dashmin pass: 123

Live demo

Login

Admin

βœ“ 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 start clone the repository and install the dependencies using the commands below.

git clone https://github.com/hiukky/dashmin-react.git -b master nameOfYourProject
cd nameOfYourProject
yarn install

or

npm install

βœ“ How to use

Right .. after installing all the dependencies you can run the application and check if everything is working correctly.

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/.

βœ“ Creating your views

Dashmin is already all set up, so for starters you can create your views in src/views/YourView and then use it in the routes file in routes.

views / Example01.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;

views / Example02.js

// Imports
import React from 'react';

// Products
const Example02 = () => (
  <div>
    <h1>Example02</h1>
  </div>
);

export default Example02;

βœ“ Configuring Routes and Dashmin

routes / index.js

After creating your view, go to routes/index.js and import the created views.

// Views
import Example01 from 'pages/example01';
import Example02 from 'pages/example02';

Define your routes.

// 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 enter a dropdown object containing the user and buttons objects.

// Serices
import { logout }  from 'services/auth';

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

      // Buttons events
      buttons: {
        settings: () => {},
        profile: () => {},
        logout: () => {
          logout();
          document.location.reload();          
        }
      }
    }
  },
}

sidebar: { }

For the sidebar you need to pass brand and buttons. For brand you need to pass only the name of your organization by entering the full name max and abbreviated min. For buttons, a name, icon and route 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,
} 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: <IoMdOptions />,
        route: Routes.example01,
      },
      {
        name: 'Example02',
        icon: <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 redemptively view.

// 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.

routes / index.js

// React
import React from 'react';

// Views
import Example01 from 'views/example01';
import Example02 from 'views/example02';

// Icons
import {
  IoMdOptions,
  IoMdPeople,
} from 'react-icons/io';

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

// Dashmin
const Dashmin = {
  // Navbar
  navbar: {
    // Dropdown
    dropdown: {
      // User Profile
      user: {
        avatar: 'https://i.imgur.com/NpICPSl.jpg',
        name: 'R o m u l l o',
        jobRole: 'Administrator',
      },

      // Buttons events
      buttons: {
        settings: () => {},
        profile: () => {},
        logout: () => {
          logout();
          document.location.reload();          
        }
      }
    }
  },

  // Sidebar
  sidebar: {
    // brand
    brand: {
      max: 'D A S H M I N',
      min: 'dmin'
    },

    // buttons
    buttons: [
      {
        name: 'Example01',
        icon: <IoMdOptions />,
        route: Routes.example01,
      },
      {
        name: 'Example02',
        icon: <IoMdOptions />
        route: Routes.example02,
      },
    ]
  },

  // Content
  content: [
    {
      route: Routes.example01,
      view: Example01
    },
    {
      route: Routes.example02,
      view: Example02
    },
  ]
};

export default Dashmin;

Finishing

Once you have followed the steps above, you can now test your app using one of the commands below if you have not previously run it.

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/.

βœ“ Libraries

πŸ“ Material UI

πŸ“ Reactstrap

πŸ“ React Icons

πŸ“ React Router Dom

πŸ“ Redux

πŸ“ Styled Components

dashmin's People

Contributors

dependabot[bot] avatar hiukky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.