Coder Social home page Coder Social logo

minidashboard's Introduction

Minidashboard

A minimalistic dashboard implementation.

It consists of a REST API endpoint and from a web interface to view the data.

Basic concept

Every entry is assigned to domains and categories. Every entry is unique and is updated when newly pushed into the app. The logical ordering of the entries is as follows:

/[domain]/[category]/[entry].

Every Entry can hold up to 8 different attributes.

At the web interface level, the [domain] is the top level element, which is will be present in the top menu.

At the web interface the [entries] are grouped by categories and presented in a simple table.

REST endpoint

Data entries management

Create data

HTTP POST: /api/data/[domain]/[category]/[entry]

The body of the POST data is the attributes for the given entry. E.g. for a book the attributes could be as follows.

{"level0": "Bruce Eckel", "level1": "9/10", "level2": "Read"}

Alternatively, the first two levels of attributes can be created via path parameters as well. E.g. HTTP POST: /api/data/[domain]/[category]/[entry]/[level0] HTTP POST: /api/data/[domain]/[category]/[entry]/[level0]/[level1]

CURL Example of creating data with link.

curl -X POST -d '{"level0": "Payed", "level1": "May", "level2": "<a href=\"/data\">Data</a>"}' -H "Content-type: application/json" http://localhost:8080/api/data/Home/Invoices/Phone

Query the data

HTTP GET: /api/data/[domain] /api/data/[domain]/[category]

Delete the data

Set 'validTo' field of entry HTTP DELETE: /api/data/[domain]/[category]/[entry]

Enforce removing historized data HTTP DELETE: /api/data/[domain]/[category]/[entry]?softDelete=false

File management

Query existing files

HTTP GET: /api/file

You can download the given file by specifying the id.

HTTP GET: /api/file/[id]

Create files

Use HTTP POST to create a new file entry. You have to use file multipart message and you have to set the content type mime type explicitly. E.g.

curl -X POST -F "file=@my_file.txt;type=text/plain" http://localhost:8080/api/file

Delete files

You can delete the file by calling the following

HTTP DELETE: /api/file/[id]

E.g. curl -X DELETE http://localhost:8080/api/file/1652

Configuration

The configuration is available via the /config URL. There is no direct link to it, it must be entered manually. The default configuration values are pre-filled and cannot be removed. Custom configuration values can be added via the text fields on the bottom. There is currently no check regarding the configuration values. You can update any configuration value at any time. If you update a custom configuration with an empty text, the given configuration will be deleted.

The custom configuration values can be used to assign titles to the table headers. For example, let's have a domain of Books and a category of Sci-Fi. Every entry is going to have an Author field as layer0 data, Page count field as layer1 data and Rating as layer2 data. The Title should be presented at the Entry column. The following configuration key-value pairs should be entered to achieve this:

/Books/Sci-Fi/entry = Title /Books/Sci-Fi/layer0 = Author /Books/Sci-Fi/layer1 = Page count /Books/Sci-Fi/layer2 = Rating

Container

  1. Build the application.
  2. Build the image via the docker build -t minidashboard . command.
  3. Run the built image via the docker run --rm -p 8080:8080 minidashboard command.

The container is creating a database file in the /data folder. So you can mount a volume to externalize it and to prevent data loss upon shutting down the container.

docker run --rm -p 8080:8080 -v $(pwd):/data minidashboard

The maximum heap size is in the Dockerfile limited to 64MB.

minidashboard's People

Contributors

szabogabriel avatar

Watchers

 avatar

minidashboard's Issues

View for historical data

Historical data cannot be viewed on GUI.
A new column for the data should be added with the 'History' link, which should lead to a separate '/history/[domain]/[topic]/[entry]' page where all the entries would be listed.
Entries should be listed chronologically in reverse (latest first).

Historized data shown on the GUI

Historized data is still shown on the GUI. It should be removed, and show only the latest entry, where the 'validUntil' field is not set.

Filter option for the columns

A filter possibility must be enabled for the data presented. Filter must be enabled for each column (for example as in Jira via a common search field by stating: [column-name] = [value] or [column-name] % [value] or for each column separately).

Encryption

Encryption should be an option, meaning, a master password would be set for the application and it will use on all data stored and read to and from the database.

The master password must be stored only in memory.

The configuration must have a salt.[random_value] key and the value must be the hash of the master password combined with the salt from the key.

Add wildcard selector for table header

Currently the configuration for the table headers are entered as follows: header:/[domain]/[category]/[level_n], meaning, for every category there is the demand to enter a new configuration value manually.

A wildcard option should be enabled via a * sign. E.g. header:/[domain]/*/[level_n].

Delete should only set validTo field

Currently delete is removing entries. There should be the option just to invalidate the data and leave it intact.
Add a new query attribute "softDelete" which if set to true, should only invalidate data, otherwise remove every entry including historical data.

Paging for data

Paging should be be enabled. If the amount of data presented in the GUI is more than a pre-configured value, a paging should be enabled.

Configuration example key: paging:/[domain], value: integer for the amount of lines to be presented.

Change title definition in configuration

Currently the column titles are matched from configuration keys as following /[domain]/[category]/entry or /[domain]/[category]/[level_n].

This should be changed to the following: header:/[domain]/[category]/entry or header:/[domain]/[category]/[level_n].

Entries not sorted by name

Currently on the GUI the entries are not sorted correctly. Both entries and Groups should be sorted by name.

External column handler

Add a configuration option to define classes from the classpath to be used as column data sources.

The usage of such classes must be configured via configuration by using the callback:/[domain]/[category]/[level_n] key and the absolute class name as the configuration value.

The class itself must implement a common interface, which will be used to retrieve data for the given column.

Caching and other performance tuning must be performed on the external library site.

Add configuration for column formatter

The cell formatters definition should be enabled.

The configuration keys format:/[domain]/[category]/entry or format:/[domain]/[category]/[level_1] should be used. The formatters should implement an interface, which must be loaded on the classpath and the configuration value must be the fully qualified class name.

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.