<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: ashkank83</title>
    <description>The latest articles on Forem by ashkank83 (@ashkank83).</description>
    <link>https://forem.com/ashkank83</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F113102%2Fe0c70a35-032c-4ed1-a906-afc2266be950.png</url>
      <title>Forem: ashkank83</title>
      <link>https://forem.com/ashkank83</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ashkank83"/>
    <language>en</language>
    <item>
      <title>Fullstack React Material Dashboard (App framework)</title>
      <dc:creator>ashkank83</dc:creator>
      <pubDate>Wed, 10 Jul 2019 19:00:50 +0000</pubDate>
      <link>https://forem.com/ashkank83/fullstack-react-material-dashboard-3m62</link>
      <guid>https://forem.com/ashkank83/fullstack-react-material-dashboard-3m62</guid>
      <description>&lt;h1&gt;
  
  
  A fullstack React Material-UI dashboard
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbsl2i3liq302bklsyao9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbsl2i3liq302bklsyao9.png" alt="dashScreenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://logidashboard.z19.web.core.windows.net/" rel="noopener noreferrer"&gt;demo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Login using U: "test" P: "test"&lt;/p&gt;

&lt;p&gt;or U: "admin" P: "test" for more accessible app&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note the database is in readonly mode so any attempt to change will fail&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Git clone https://github.com/logipro/Dashboard-API.git
npm &lt;span class="nb"&gt;install
&lt;/span&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Client
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/logipro/logi-dashboard.git
yarn &lt;span class="nb"&gt;install
&lt;/span&gt;yarn start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is it?!
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Work In Progress&lt;/strong&gt; fullstack micro framework (is framework the right word?!) which will give you basic authorization, authentication, routing and some general functionalities out of the box. So you can concentrate on developing your Apps and widgets and deliver them to your end users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Add/disable users, change users password, give/take Roles to users&lt;/li&gt;
&lt;li&gt;Add/Remove Roles with access to different sets of apps and widgets&lt;/li&gt;
&lt;li&gt;Create Widgets and add them to the framework to be shown on the dashboard (&lt;strong&gt;Maybe share the nice ones 😀&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Create Apps (React components)&lt;/li&gt;
&lt;li&gt;Have Public Apps and Widgets (No need for login to see these)&lt;/li&gt;
&lt;li&gt;Each user can save his/her dashboard layout&lt;/li&gt;
&lt;li&gt;Lazy loading of apps using react.lazy and suspense. Apps will only be loaded for users who have access to them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What has been used?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Frontend&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;Reactjs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://material-ui.com/" rel="noopener noreferrer"&gt;Material-UI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://reacttraining.com/react-router/" rel="noopener noreferrer"&gt;React-Router&lt;/a&gt;&lt;br&gt;
for dynamic routing magic happening client side&lt;/p&gt;

&lt;p&gt;&lt;a href="https://typescriptlang.org" rel="noopener noreferrer"&gt;TypeScript&lt;/a&gt; not 100% typescript as you will see some js files and a lot of js code but on it's way there!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/logipro/logi-dashboard/tree/master/src/framework/Components/logi-table" rel="noopener noreferrer"&gt;logi-table&lt;/a&gt;: We looked for a good Material table and failed to find one that had everything I needed! So decided to develop my own. This table component lacks a lot of features at the moment and that's why it's not a npm package yet. Maybe one day when it covers more and is tested better we will publish this as it's own package, For now it will stay in a separate folder inside the dashboard!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Backend&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://nodejs.org" rel="noopener noreferrer"&gt;Nodejs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://expressjs.com/" rel="noopener noreferrer"&gt;Express&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.passportjs.org/" rel="noopener noreferrer"&gt;Passport&lt;/a&gt; for authenticating together with express-jwt for giving tokens to logged in users and guests&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.sqlite.org/index.html" rel="noopener noreferrer"&gt;Sqlite&lt;/a&gt; to be free from any DBMS installation we decided to use sqlite. of course for your app you can add connections to any other databases for the main business whilst the framework related persistence like Users, Roles, Apps,... are using the sqlite.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a new app
&lt;/h2&gt;

&lt;p&gt;A. Any react component can be an app and Logi-dashboard will load them for users with access. for an example look at &lt;a href="https://github.com/logipro/logi-dashboard/blob/master/src/framework/Administration/Users.tsx" rel="noopener noreferrer"&gt;User.tsx&lt;/a&gt; which is the app that manages the users.&lt;/p&gt;

&lt;p&gt;B. Add your App from Administration/Apps management&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg93qxy3vzzelp4ou221z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg93qxy3vzzelp4ou221z.png" alt="AppsImage"&gt;&lt;/a&gt;&lt;br&gt;
You have to set the following for each app:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application&lt;/strong&gt;:Name of the App to be shown in the sidebar&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ParentID&lt;/strong&gt;:If you want your App to be shown under a group set this&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RouteName&lt;/strong&gt;:Set the relative Route for this App, Logi-dashboard will use this to load your component&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Component&lt;/strong&gt;:Relative path to App's component (relative from App.tsx)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Props&lt;/strong&gt;:Send props to the app from here, for example let's say I want to have two different versions of &lt;em&gt;Users&lt;/em&gt; app one readonly and the other one full access. I create the same App twice in this table and set Props for one of them to {"Readonly":"true"} then the users.tsx can check for this at load and perform the required operations (in this case hide edit icons)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IsPublic&lt;/strong&gt;: set it to true if you want your app to be available before login. Dashboard must stay public&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Icon&lt;/strong&gt;: A &lt;a href="https://material.io/tools/icons/" rel="noopener noreferrer"&gt;material UI icon&lt;/a&gt; to be shown in the sidebar.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a new Widget
&lt;/h2&gt;

&lt;p&gt;Widgets are shown on the dashboard and you can add your own widget to the collection of available widgets:&lt;/p&gt;

&lt;p&gt;A. Create your widget and copy it to framework/Dashboard/Cards (or wherever!). see a sample &lt;a href="https://github.com/logipro/logi-dashboard/blob/master/src/framework/dashboard/Cards/StatementCard.js" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;B. Add your new Widget to &lt;a href="https://github.com/logipro/logi-dashboard/blob/69fcb29c119cd5974a0999e3a0d4f2ce7f708ab8/src/framework/dashboard/Widget.tsx#L13" rel="noopener noreferrer"&gt;widget.tsx&lt;/a&gt; with preferred sizing. (Dashboard layout uses a grid layout)&lt;/p&gt;

&lt;p&gt;C. Add your Widget to the Widgets table from Administration/Widgets&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fvnizuot2drcl0hks3ipz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fvnizuot2drcl0hks3ipz.png" alt="widgets"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Component&lt;/strong&gt; : Widget component name&lt;br&gt;
&lt;strong&gt;Properties&lt;/strong&gt; : Send any properties required in the widget from here.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;hint&lt;/em&gt;: Try to create generic and reusable widgets and customize them with the props from here. for example if you have a chart which should fetch data in x minute intervals send the URl path for data and also the timer interval from here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IsPublic&lt;/strong&gt; : Public widgets are accessible before login on the dashboard. Logged in users can hide the widget&lt;/p&gt;

&lt;h2&gt;
  
  
  Give access to Apps and Widgets
&lt;/h2&gt;

&lt;p&gt;Access to Apps and widgets is managed via Roles.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqhr0o1uzerewdbpylrj9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqhr0o1uzerewdbpylrj9.png" alt="appsAccess"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose a role and expand he details for it to see the available Apps and Widgets for the Role. Select or deselect any item to modify the access.&lt;/p&gt;

&lt;p&gt;After tuning Roles access you can assign roles to users from the Users app. Each user can have one to many roles and her/his access is the union of all the accessable apps.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fimjgtm5rm07ucspckol1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fimjgtm5rm07ucspckol1.png" alt="userRoles"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>node</category>
      <category>sqlite</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
