Git Product home page Git Product logo

dbwebgen's Introduction

dbWebGen - Database Web App Generator for PHP

This PHP application automatically generates a responsive web app on top of your relational database. The app allows users to

  • Create and edit records via web forms, taking into account foreign keys and other constraints
  • View stored records along with related records from other tables
  • Browse, search, and filter records in tables
  • Query the database, visualize the results, and share the visualizations. Currenty the engine offers various visualizations like tables, bar charts, leaflet maps, sankeys, timelines, graphs/networks, social network analysis, geomaps and others

Developers may add custom functionality and extensions to the engine through hook functions in plugins, and admins may exploit an extensive array of settings controlling the engine.

Requirements

  • Webserver running PHP (lowest tested version is 5.3)
  • Database server (currently working only with PostgreSQL -- lowest tested version is 9.2; experimental support for MySQL)
  • A database

Get it Running

  • Clone this repository into any folder that is served by your webserver.

  • Run npm install in this folder.

  • Since this repository contains the app engine only, you need to create another folder that will serve as the actual app folder

  • In the app folder, create a PHP file that serves as the main entry point of the app (typically index.php). This file is very simple: it must include a definition of the constant ENGINE_PATH, which shall define the relative path to app engine folder. The other line in this file is the inclusion of engine.php from the app engine folder. You can also define the language by defining DBWEBGEN_LANG (currently English en and German de are available).

    Note: if required, you may use ENGINE_PATH_LOCAL to define the relative or absolute local file system path to the engine folder, which is used for including .php files; the ENGINE_PATH is used to point to files in <script> or <link> tags, so those must be resolveable by the web server.

    The typical index file would then look like this:

    <?php
       define('ENGINE_PATH', '../dbWebGen/');
       define('DBWEBGEN_LANG', 'de');
       include ENGINE_PATH . 'engine.php';
    ?>
  • Direct your web browser to the app folder. Upon first visit, a setup wizward will allow you to specify all app settings, which will be stored in a file called settings.php. If you encounter any issues or somehow misconfigure your app, you can also manually edit the settings.php file with explanations provided in settings.template.php

Example Database and App

An example app using this engine can be seen in the dbWebGen-demo repository

Selected Features

  • Fully localized in English and German; other languages can be added easily
  • Access control via users table in database, custom authentication functions, or static user arrays
  • Paginated, searchable, sortable viewing of table contents
  • Viewing full details of single records
  • Single-page or tabbed record editing forms
  • Inline creation and editing of records referenced via foreign keys
  • Conditional display and labeling of record fields in editing forms
  • Grouped field display in editing forms (e.g. when date components are stored in separate columns)
  • Hyperlinked display of records linked via foreign keys
  • Record merging wizard
  • Global and table-local search, allowing custom search transformations (e.g. removing diacritics, unaccenting, etc.)
  • Custom menus, pages, and plugins with access to dbWebGen global objects, settings, and variables
  • Input controls for most important field types, e.g. dropdown boxes, date pickers, geomap pickers, boolean toggles, text boxes, file uploads
  • Custom JavaScript form validation

Limitations

The major limitation currently is that the table settings for composite primary keys (e.g. in N:M-tables where each primary key part is a foreign key) currently only support a maximum of two primary key columns per table. If a composite primary key in some table in your DB consists of more than two columns, the remedy would be to create an artificial single-column primary key with auto-increment value for such tables.

Screenshots

Below are some screenshots from a database app that uses dbWebGen to allow users to work with historic documents from 19th century Oman. Click any thumbnail to view at full resolution.

Data in a TableSearch FilterView a RecordNew Record FormEdit Record FormQuery with Network VisualizationQuery with Map VisualizationResponsive Edit

License

This code is licensed under the MIT license. See the LICENSE file.

dbwebgen's People

Contributors

derntl avatar eczema avatar npmcdn-to-unpkg-bot avatar terranulm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbwebgen's Issues

parameterized queries

allow parameterized queries in MODE_QUERY. viewer may select values for the parameters when displaying visualization of query result

built-in form validation for N:M tables with additional required fields

In n:m tables that are linked via T_LOOKUP/CARDINALITY_MULTIPLE fields, the linkage table might have additional required fields. Currently this can only be discovered through knowing or through the error raised when saving the record. Form validation should be built in for all linkage tables that have required fields which do not have a default values specified in the settings.

Upload visualisation

Whenever an upload is performed the browser sgouldn't freeze and instead visual feedback should be displayed; e.g. a moving hourglass.

Mysql

Hi, is it compatible with mysql?
Thanks

Pre-Displayed default value for textfields

Hi,

we need a method for the following situation: We want to add a default-value for T_TEXT_LINE. This value should be displayed when the site is requested by a user within the corresponding text-field.

Cheerz,

Kevin

[PROPOSAL] Table view

Hello! This engine saved me a lot of time doing simple CRUD applications for our PostgreSQL instance. Overall it's pretty good, but I faced with one request I wasn't able to resolve. Table view. "Yeah, just like in Google Sheets, it would be way faster to insert a batch data here rather than in a form". Seems like a wise idea, so I am sharing it with you guys. Thanks for such a delightful solution for "hey, you kinda know computers, solve this" kind of people. ❤️

Charts & SQL query box

Apologies if I'm missing something obvious but my installation displays list of records fine and I can search on columns, edit & add records but I can't see any way to access the SQL query box or the charts shown in the screenshots.

Do I need to write some plug-ins in PHP?

Enable merging of records

Allow user to initiate merging of any two records in a table (along with their "dependencies" established by lookup fields)

Search Function always returns no results

This looks like a great program that suits my needs well but I'm finding that all searches return null results. I have columns of various types - text, fixed length characters and boolean, but all searches return no results. My postgres log shows lines like:
2019-04-10 19:25:00.539 BST [3831] postgres@cases ERROR: could not determine data type of parameter $1
2019-04-10 19:25:00.539 BST [3831] postgres@cases STATEMENT: SELECT COUNT(*) FROM "cases" d WHERE "full_text"::text like concat('%', $1, '%')

I'm using Firefox (but get same issues on Vivaldi) on ubuntu 18.04.02 on an oracle VM.
Postgres is v 10.7
PHP v7.3.3

Any help would be much appreciated

Validation support. date data type support

The original issue is below but now I believe THERE must exist user-defined validation function!!! Such function should check field values and prevent form from submitting with error popup
Isn't it possible to implement drop down calendar and corresponding datatype/field type? Thank you very much for your great project I'd donate if I had money...

Table managment rights

Isn't it possible to somehow restrict edit ability for some users for some tables? There is login functionality but no right management? Can it be implemmented by user? Maybe in login_success_proc I can define table rights depending on logged in user name?
I'll probably have write a separate php script which will after login

  1. edit seetings.php of dbwebgen
  2. open and pass login info to real dbwegen
    Or how do I allow certain users to see/edit certain tables For example
    user:Ivan{
    meals{view}
    hotels{view,edit}
    }
    user:maria{
    meals{view,edit}
    hotels{view}
    }

T_ForeignKeyLookup not updated

When I display id (not "name" for example) in T_ForeignKeyLookup

'trip_id' =>
						array (
							'label' => 'Trip Id',
							'required' => true,
							'editable' => true,
							'type' => 'T_ForeignKeyLookup',
							'lookup' =>
								array (
									'cardinality' => 'CARDINALITY_SINGLE',
									'table' => 'trips',
									'field' => 'id',
									'display' => 'id',
									'label_display_expr_only' => true,
								),
						),

And when I create a new "trip" clicking near "Trip Id" field the dropdown IS NOT UPDATED and is not autosubstituted..
When I use for example

 'hotel_id' => 
      array (
        'label' => 'Hotel Id',
        'required' => true,
        'editable' => true,
        'type' => 'T_ForeignKeyLookup',
        'lookup' => 
        array (
          'cardinality' => 'CARDINALITY_SINGLE',
          'table' => 'hotels',
          'field' => 'id',
          'display' => 'name',
          'label_display_expr_only' => true,
        ),
      ),
    ),

So when I use 'display' => 'name', there is no such bug...
Why there is a bug with using 'display' => 'id', ?

bootstrap dependencies

Hi, I would like to know if you agree to include js and css in the project ?

Indeed, dbWebGen cannot render pages in 'offline' mode.
New directories /content should be used :

/dbWebGen/inc/bootstrap/js
bootstrap.min.js
jquery.min.js
select2.min.js
transliteration.min.js

/dbWebGen/inc/bootstrap/css
bootstrap.min.css
select2-bootstrap.css
select2.min.css
/dbWebGen/inc/fonts
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff
glyphicons-halflings-regular.woff2

Problem with order of numeric values in queries.

Hello.
First, congratulations for your great work! An excellent tool to manage queries in a database!!
I use your tool to make many queries, and store that.
But when I get the result, and try to order pressing in the heading of the column, the numeric column values dont get ordered.
If there are two values, for example, 234 and 1234, the app get first 1234 than 234.
It work with the numbers as strings: the "1" before the "2", not the 234 before the 1234.
Can I correct that in any way?
Thanks!

Icon-based Textfield-Value setting

We require a method for the following use-case:
Behind input-fields symbols may be displayed. Once a symbol is clicked by the user, the textfields value is set to a pre-defined value. E.g.: Symbol is "hammer and sickle" and value should by ´communism'.

Reversed 1:N relationship missing

Right now we have 1:N (T_LOOKUP with CARDINALITY_SINGLE) and N:M (T_LOOKUP with CARDINALITY_MULTIPLE). We lack some kind of a N:1 (a reversed 1:N) relationship.

Example: brand 1:N model. Right now it is possible to use a 1:N lookup in model and assign the brand to the model. In many cases, e.g. to reduce the form editing effort, it makes sense to allow assigning models to brands in the brand editing form. Supporting this should be possible in dbWebGen

Bootstrap / popover bug

The bootstrap version used into package.json is version 3.4.1

This version is got an issue with popover widget. moving back to bootstrap 3.4.0 resolve the issue....

The clean way is to tune sanitizer rules.

Password reset function

We need a function that allows users that submited an email to reset the password via that email adress

npm install warnings

npm WARN deprecated [email protected]: This module is now under the @mapbox namespace: install @mapbox/leaflet-omnivore instead
npm WARN deprecated [email protected]: This module has moved: please install @mapbox/togeojson instead
npm WARN deprecated [email protected]: This module is now under the @mapbox namespace: install @mapbox/corslite instead
npm WARN deprecated [email protected]: This module is now under the @mapbox namespace: install @mapbox/polyline instead
npm WARN deprecated [email protected]: Use topojson-client, topojson-server or topojson-simplify directly.
npm WARN deprecated [email protected]: This module is now under the @mapbox namespace: install @mapbox/sexagesimal instead
npm WARN deprecated [email protected]: Please consider using https://github.com/visjs
npm WARN deprecated [email protected]: Replaced by d3-dsv.
npm WARN deprecated [email protected]: renamed to d3-queue

npm WARN [email protected] requires a peer of jQuery@>=1.8 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of component-emitter@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of hammerjs@^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of keycharm@^0.2.0 || ^0.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of propagating-hammerjs@^1.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of vis-data@^6.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of vis-util@^3.0.0 but none is installed. You must install peer dependencies yourself.

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.