Clone or download
Permalink
Failed to load latest commit information.
cli @ 84d44c5 Using include_dir to serve static files embedded into the binary Jul 23, 2018
dbscripts Use dbscripts/setup.sh for travis-ci Nov 16, 2017
elm-webclient @ 1676eed Using include_dir to serve static files embedded into the binary Jul 23, 2018
intel Restructured how user credentials is set Jul 19, 2018
rustorm @ 985b197 Using include_dir to pack in static files into the binary Jul 22, 2018
sakila @ 382c1b8 update sakila dep Jan 29, 2018
server Using include_dir to serve static files embedded into the binary Jul 23, 2018
.gitignore make the webserver api url more organized Nov 24, 2017
.gitlab-ci.yml Changed diwata to diwata_server Mar 12, 2018
.gitmodules change folder name for diwata_cli May 2, 2018
.travis.yml create the public/static directory to satisfy build Jul 23, 2018
Cargo.lock Using include_dir to serve static files embedded into the binary Jul 23, 2018
Cargo.toml update from rustorm Jun 14, 2018
Design.md update from elm-webclient Apr 23, 2018
Dockerfile remove unused dep, expose some object May 2, 2018
LICENSE Add apache license Nov 16, 2017
Notes.md update from dep, some notes Jul 11, 2018
Procfile diwata now Dec 25, 2017
README.md update readme and todo Jul 9, 2018
TODO.md Updated todo, mark include_dir as completed Jul 24, 2018
diwata1.png Add screenshot Dec 29, 2017
release_run.sh Add cleaning Jul 26, 2018
run.sh Move webclient to new repository ivanceras/elm-webclient Apr 12, 2018
run_airlines_ru.sh Add cleaning Jul 26, 2018
run_mock.sh Add cleaning Jul 26, 2018
run_sakila.sh Using include_dir to serve static files embedded into the binary Jul 23, 2018
run_sakila_required_login.sh Add cleaning Jul 26, 2018

README.md

Diwata

Diwata is a database interface for PostgreSQL with the goal of being usable, user-friendly with its basic and advanced functionality be discoverable by the user. Goal of diwata is to be a replacement of back-end admin without explicitly writing the code for it. It is content aware, and renders records as it sees fits. An attempt to create back-end to end all back-ends.

Backers on Open Collective Sponsors on Open Collective

Features

  • Automatic display of direct and indirect linked record
  • Freeze column and freeze rows
  • Infinite scrolling / loading of page on scrolling
  • User friendly granular search and filter
  • Diplay descriptive referred records. (ie: Instead of displaying the foreign_key value integer or uuid, display the referred records in such a way it is distinguisable by the user)
  • Well integrated with the browsers, clickable tables, records and tabs can be openned in a new window and displays the data as though clicking on it.

Freeze row Freeze column

Distinguisable referred record in a dropdown

Dynamic toolbar displaying the exact information of what the button actually does

Navigating through the apps and opening other window in another browser window/tab is seamless

Binary data detected as images would be rendered as such

Demo - Sakila (films) using the sakila database example

Demo - airlines (russian) russian airlines booking database

Demo - Dota2 heroes using dota2 hero and abilities data

Quickstart

If you have an existing postgresql database, you can quickly open it using the app by:

curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
cargo install diwata_cli
diwata_cli --db-url postgres://user:passwd@localhost:5432/dbname -p 8000 --open

You can also open sqlite database. Download this sqlite sample db You can then open it by issuing the command

diwata_cli --db-url sqlite://sakila.db  -p 80001 --open

Build from source

Needed Dependencies

  • rust nightly
  • elm v0.18 ( elm installation needed npm or yarn)
  • rsync ( for fast syncing files over and over )
  • google-closure-compiler (optional, for release build)
  • sed (search and replace app.js with app.min.js in index.html
  • sakila database (for demo and testing) [1]
  • build-essential (for compiling c based dependencies such as sqlite-src)

Install Dependencies

curl https://sh.rustup.rs -sSf | sh
sudo apt install rsync build-essential pkg-config
npm install -g elm@0.18
npm install -g google-closure-compiler-js

Compile and run

git clone https://github.com/ivanceras/diwata
cd diwata
git submodule update --init --recursive
rustup self update && rustup update
rustup override set nightly
cd webclient && ./compile.sh && cd ..

cargo run -p diwata -- --dburl <db_url>

Note: You need to use the latest nightly.

Specify a database ( sakila database example )

cargo run -p diwata_server -- --dburl postgres://postgres:passwd@localhost:5432/sakila -p 8000

see run.sh for the accurate content of command

Then visit http://localhost:8000/

Content Aware

Using heristic method, diwata is able to infer the content of a table.

  • When it a column is a boolean it make sense to display it with a checkbox rather than just 'true' and 'false'. Dates will be rendered with a dropdown calender.
  • Country lookup will be rendered with a dropdown list of country alongside their flags
  • Images will be displayed in line when in grid view, and will be fully displayed when in card view
  • Attachments such as pdf,xls,csv,svg,md,txt,source codes will be rendered to their corresponding document editors
  • Urls are linked and clickable automatically
  • Embed common web objects: youtube videos, tweets, images, map locations

Roadmap checklist:

  • Infinite load-on-deman scrolling
  • Meaningful dropdown lookup
  • Seamless url-based navigation
  • Delete records
  • Update records
  • Insert records
  • Detail record update/insert, delete link detail records [X] Filtering and searching on has_many and indirect records for detailed record
  • Undo update/delete records (upon deletion/modification, user have a grace period to undo the changes)
  • Search and filter data
  • Drag/Rearrange and resize columns
  • Multi column sorting
  • Smart delete cascade messages
  • Error Handling/Error messages display
  • Advanced filtering, where user can type in the logic for filtering
  • Display of images and file attachments
  • Interactive/dynamic record count indicator for toolbar buttons
  • Loading indicators
  • Page transition animation
  • Search/filter on tables
  • Table/Columns filtering based on privilege system.
    • Display only tables that the user has privilege
    • Display only columns that the user has privilege
    • An interface for superusers to set user privileges for each tables
  • Row level security
    • When the server is configured to require user login, the user will be forced to login

Next iteration development

  • Plugin and module system
  • Custom validation on field
  • Custom buttons for application specific functionality

Notes:

[1]: You can use sakila database dump as demo database https://github.com/ivanceras/sakila

Patreon:

Please support me on patreon, so I can dedicate more time to the development of this project

Contact me:

ivanceras [a t] gmail.com

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]