Skip to content

Architecture (back end)

Jonathan Danylko edited this page Jan 22, 2022 · 12 revisions

Tuxboard Backend

Tuxboard uses SQL Server for it's storage.

Schema

Docs Site

Tables

  • Dashboard - Each record is a 1-to-1 relationship between a user ID and a Dashboard ID. The primary table used to grab (or create) a dashboard.

    Table Hook - UserId for Microsoft Identity integration is provided.

  • DashboardDefault - When a new person signs in and it doesn't have a dashboard, this table takes a pre-defined dashboard structure and copies the corresponding records into a new dashboard.

    The LayoutId points to a single record in Layout which containing LayoutRows and LayoutTypes.

    Think of the DashboardDefault and DashboardDefaultWidget tables as blueprints for future dashboard templates for different types of users.

    Table Hook - A PlanId is included to retrieve a default dashboard based on someone's plan. While PlanId is included, the developer could replace PlanId with other options such as:

    • Use Microsoft's Identity RoleId to provide a customized dashboard based on Role `
  • DashboardDefaultWidget - The complement table to DashboardDefault that points to widgets related to the Layout and the placement of the widget in the layout.

  • DashboardTab - Used for future expansion, but currently, Tuxboard only supports one tab.

  • Layout - Containing a header record of all of the rows for a dashboard tab; Master/detail relationship w/ LayoutRow.

    IMPORTANT: If a Layout record doesn't have a TabId filled in (where TabId = null) associated with it, the layout is considered a dashboard (default) template. This allows the DashboardDefault to simply point to Layouts for templates.

    The Layout table is a 1-to-1 relationship with a DashboardTab (translation: a DashboardTab contains one Layout with multiple LayoutRows)

  • LayoutRow - Stores a list of rows. Each row is defined by a LayoutType.

  • LayoutType - A list of CSS classes to define the columns for each row. This may vary between each CSS Framework you use. Currently, Tuxboard uses Bootstrap 4.x.

  • Plan - A simple way to include widgets based on a user's plan.

    For example, some records in the plan table could include Gold, Silver, and Platinum plans. This table would work in conjunction with the WidgetPlan table.

  • Widget - List of widgets for the dashboard. Widgets can be grouped using the Group field. They will be automatically sorted by category when adding them from the dialog. These widgets will have default settings stored in WidgetDefault (general settings) and WidgetDefaultOption (for dropdowns).

  • WidgetDefault - Stores a list of all settings for a particular widget.

  • WidgetDefaultOption - Stored a list of dropdown options if a SettingType (in WidgetDefault) is a dropdown.

  • WidgetPlacement - Primary table of where the widgets are placed on a user's dashboard. Based on LayoutRowId, WidgetId, and TabId (TabId was included for speed purposes pointing back to a DashboardTab for quicker access)

  • WidgetPlan - Used to display a list of widgets based on a user's subscription to a specific plan. For example, if a user subscribes to the Silver plan, there would be a list of widgets with a planId pointing to the Silver plan. When a Silver user wants to add a list of widgets, they will only receive the Silver plan widgets from this table.

  • WidgetSetting - Since a user can have multiple widgets on a tab at the same time, the WidgetSetting table stores the specific settings for a WidgetPlacement on a dashboard while referring to the widget's default settings in the WidgetDefault table.

Seeding the database

  • When Migrations run, a sample dashboard is created based on the TuxDbContext's SeedData method. The Widgets table contains all possible widgets for the dashboard. You can add, update, or remove any widget record you want.
  • Overview

  • Getting Started

  • Architecture

  • Tuxbar

    • Overview
    • Placing Tuxbar
    • Existing controls
      • Layout Dialog button
      • Add Widget Dialog button
      • Tuxboard Status Message
  • Widgets

    • Overview
    • Widget Types
    • Creating Widgets
    • Widget Settings
  • Layout/Layout Rows

    • Overview
  • Extending Tuxboard

    • Overview

    • Custom Widgets

      • Dynamic
      • Static
      • Role-based Widgets
    • User-Specific Dashboards

      • With default dashboards, just create two new records and point to a particular layout.
    • Themeing

  • Exercises

    • Widgets
      • Build static widgets
      • Build dynamic widgets
      • Integrate Charting
    • Dashboard
      • Announcements
    • Tuxbar
      • Add a "Save Layout" button
    • Themeing
      • Updating to another theme.
  • FAQ

  • To-Do's

Clone this wiki locally