Coder Social home page Coder Social logo

skyronic / crudkit Goto Github PK

View Code? Open in Web Editor NEW
290.0 35.0 85.0 2.31 MB

Toolkit to quickly build powerful mobile-friendly CRUD (create/read/update/delete) interfaces for PHP, Laravel, and Codeigniter apps. Works with MySQL and other databases.

Home Page: http://crudkit.com

License: MIT License

PHP 71.67% JavaScript 18.97% CSS 0.29% HTML 9.07%

crudkit's Introduction

CrudKit

GitHub license


A Toolkit to quickly build powerful mobile-friendly CRUD (create/read/update/delete) interfaces. http://crudkit.com

Build locally

Additionally from having PHP installed, make sure you have nodejs installed.

Once you have the basic requirements, follow the below instructions:

  1. Clone the repository $ git clone [email protected]:skyronic/crudkit.git

  2. Install composer.

  3. Install / Update dependencies, $ composer update.

  4. Install grunt and other node related packages using: $ npm install (You might need to use sudo)

  5. Install client-side dependencies using: $ bower install

Demos

Demos are listed in demo/. Inorder to see the demos in action follow the steps listed below:

  • Create a symlink of crudkit using: $ ln -s /home/<username>/path/to/crudkit demo/crudkit
  • Build static files: $ grunt buildStatic
  • Start the server by running $ php -S 0.0.0.0:8080 from the root of the project
  • Navigate to http://localhost:8080/demo/sql_basic.php

Laravel Support

Check out markpurser/laravel-crudkit for a similar project (no code shared with this project) with out of the box support for eloquent and relying on blade templates and Laravel for routing.

crudkit's People

Contributors

buedsmith avatar skyronic avatar swaroopsm avatar thepsion5 avatar thomasdebrunner 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

crudkit's Issues

Wrong documentation on crudkit.com

I managed to get crudkit to work, but there are, in my opinion, some serious documentation errors on crudkit.com in the section How does it work.

  • Instead of use CrudKit\MySQLTablePage; use CrudKit\Pages\MySQLTablePage;
  • Constructor of MySQLTablePage requires at least 4 arguments. new MySQLTablePage ("page_id", "username", "password", "database"); instead of new MySQLTablePage ("john", "hunter2", "mydb");
  • A mySQL page requires a summary collumn ->setSummaryColumns(array("column1", "column2"))

I don't know wheter these things are bugs in the code and the demo should work, or the documentation is wrong indeed.

Installation via Composer - SQL driver problem?

I just did a fresh install using:

composer create-project skyronic/crudkit-template your_project

When I fire up the crudkit website (using this with apache2) with default crudkit settings I recieve the following:

Doctrine \ DBAL \ Exception \ DriverException
An exception occured in driver: could not find driver

[vhost]/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php
return new Exception\ReadOnlyException($message, $exception);
}

    if (strpos($exception->getMessage(), 'unable to open database file') !== false) {
        return new Exception\ConnectionException($message, $exception);
    }

    return new Exception\DriverException($message, $exception);
}

Am I missing something or is the installation guide missing something?

The file html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php does exist.
I get the same error when trying to build an mysql page.
This is under Debian 8.2 without selinux.

Thanks!

Have 'display mode'

Sometimes detailed data needs to be displayed but not for editing on a form. We can investigate having a way to just display a row of data nicely on a page. But this needs to be thought out better to allow for things like upcoming foreign key support.

Display error if fail on ajax

If there's a failure on the server because of an exception or syntax, then there's still no clear indication on client side. This needs to be there.

Can't attach mysql pages to crudkit app

When I try to attach mysql pages I get this error

Whoops\Exception\ErrorException
…/­vendor/­skyronic/­crudkit/­src/­CrudKit/­Data/­SQLDataProvider.php142

Whoops \ Exception \ ErrorException (E_NOTICE)
HELP
Undefined offset: 0
screenshot from 2016-04-19 14 52 08

Error when saving item without changing any fields

When editing an item and saving it without changing any fields before, a SQL error is shown.

2015-11-27 09_40_19-hello crudkit

The issue seems to be that when only changed fields are submitted to QueryBuilder, it generates an invalid query. Check before sending the form and notify the user.

Cannot modify header information - headers already sent

When running index.php using php -s on OS/X El Capitan, I get

Whoops \ Exception \ ErrorException (E_WARNING)
Cannot modify header information - headers already sent by (output started at /Users/anon/Desktop/CrudKit2/vendor/skyronic/crudkit/src/CrudKit/Pages/BasicLoginPage.php:67)

This code block is then shown with the header("Location..." line highlighted:

    /**
     * Render your CrudKit app and output to HTML
     */
    public function render () {
        $content = $this->renderToString();

        if ($this->redirect !== null) {
            header("Location: ".$this->redirect);
            session_write_close();
            exit();

Need to show option values

I want to show option values to be selected in HTML select element. How can I add this to a column?
What I want is showed below:

<select name="options">
<option value="1">Value 1</option>
<option value="2">Value 2</option>
</select>

Comments and suggestions

Hi!
Very nice kit for quick building web-app. Thank you! 👍

Some changes that I want:

  1. Enter button don't work in search field. Fix, please.
  2. Can you use more complex table? Something like JTable (very good relations support) or ExtJS with grouping, summary in groups, grouped header. Also very good table in w2ui. The only problem is that most of them did not responsive.
  3. Edit button per row support.
  4. Edit in modal window.
  5. Selecting rows by checkbox and group deleting.
  6. Extendable authetification (in future). I used LDAP in my app with adLdap PHP extension.
  7. Select2 or something that can add search in comboboxes.
  8. Multilaguage support.
  9. Laravel example and documentation (in future).

I already wrote an app that uses Jtable, adLdap, select2 in pure PHP. My big problem is code organization and adding module structure...maybe I rewrite my project with your kit in future.

What frontend template you use for this project? It looks like AdminLTE.

I can help you with something if you want =)

Online Demo

Hi

Do you have an online demo of what this application does?

Crudkit.com simply goes to a holding page.

Cheers
Stephen

Error in whoops

I have a fresh install (with composer) in a 5.5.9 AND in a 7.0 environment. In both I've got the same message.

Whoops \ Exception \ ErrorException (E_ERROR)

Uncaught TypeError: Argument 1 passed to Whoops\Run::handleException() must be an instance of Exception, instance of Error given in /home/ubuntu/workspace/concursos/vendor/filp/whoops/src/Whoops/Run.php:233 Stack trace: #0 [internal function]: Whoops\Run->handleException(Object(Error)) #1 {main} thrown

When I comment $app->render(), nothing is showed.

My code:

<?php
require_once('vendor/autoload.php');
use CrudKit\CrudKitApp;
use CrudKit\Pages\MySQLTablePage;
use CrudKit\Pages\BasicLoginPage;
# Create a new CrudKitApp object
$app = new CrudKitApp ();
$app->setStaticRoot ("static/crudkit/");
$app->setAppName ("Admin_Panel");

$c = new MySQLTablePage ("Admin", "myuser", "mypass", "mydb");
$c->setName ("Users");
$c->setTableName ("users")
        ->setPrimaryColumn ("id")
        ->addColumn ("name", "Name",['validation' => ['required' => true,]])
        ->addColumn ("height", "Height");
$app->addPage ($c);
# Render the app. This will display the HTML
$app->render();

Document how to add to existing project

Please document how to do the equivalent of:

composer create-project skyronic/crudkit-template your_project

but for an already existing composer project.

Dropdown list in edit mode

Hi!
I've discovered crudkit and I've implemented on a test environment for experimental. Is possible to add a drop down list select in edit mode?
Is possible to retrieve the selecto options from a array of elements? Thanks!!

Utilize Interfaces for BaseDataProvider and BasePage

The current implementation of Data Providers and Pages is requires extending a base class, which is inflexible and makes extending and testing more difficult. A better approach is to create interfaces for both, and possibly replace the base classes with traits that have the same functionality. This will also allow for better usage of typehinting.

I'm interested in using this library at work but not having interfaces to work with would create additional maintenance liabilities for us, so I'm willing to create a PR with the required changes (and relevant tests, even!).

Unknown database type enum requested

Getting this issue when trying to load from a database table that has an enum column as part of its schema.

Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.

Not able to create new records with custom PK value

When trying to add a new record to the db using mysql and setting the primary value with ->setPrimaryColumn() - I'm not able to create a new record with a custom Primary key. The value simply does not display for me in the create form and defaults to 0 when the record is created.

Trying to add the same column in with the ->addColumn () to display in the create form causes the first table only not to load with this error:
TypeError: Cannot read property 'key' of undefined
at crudkit.min.js:768
at crudkit.min.js:264
at n.$eval (crudkit.min.js:278)
at n.$digest (crudkit.min.js:275)
at n.$apply (crudkit.min.js:279)
at l (crudkit.min.js:233)
at F (crudkit.min.js:237)
at XMLHttpRequest.C.onload (crudkit.min.js:238)

The main part of this method is $scope.primaryCol = _.find (colSpec.schema, 'primaryFlag', true).key;

When using the paginated bar - the other tables load without issue. Only the first table fails - i see they use different methods.

Users should be able to create a new record with the form while adding their own Primary key.

RESOLVED: Summary not working

require "vendor/autoload.php";
use CrudKit\CrudKitApp;
use CrudKit\Pages\MySQLTablePage;

// Create a new app
$app = new CrudKitApp();

// Create a new page mapped to a table
$sqlPage = new MySQLTablePage ("flat", "root", "0101", "radamira", array('charset'=>'utf8'));

$sqlPage->setTableName ("flat")

    ->setName ("Квартиры")
    ->setPrimaryColumn ("id")

    ->addColumn ("url", "Адрес страницы")
    ->addColumn ("name", "Название")
    ->addColumn ("cost", "Общая Стоимость")
    ->addColumn ("kvm", "Цена 1 кв.м.")
    ->addColumn ("type", "(0 = СТУДИЯ) или (1 = однушка) или (2 = двушка) или (3 = трешка)")

    ->addColumn ("rooms", "Количество Комнат")
    ->addColumn ("merged_toilet", "Санузел совмещен (1 = ДА) или (0 = НЕТ)")

    ->addColumn ("full", "Общая кв.м.")
    ->addColumn ("live", "Жилая кв.м.")
    ->addColumn ("toilet", "Туалет кв.м.")
    ->addColumn ("kitchen", "Кухня кв.м.")
    ->addColumn ("balcony", "Балкон кв.м.")

    ->addColumn ("windows", "Окна выходят на")
    ->addColumn ("bal_lod", "(1 = Балкон) или (0 = Лоджия)")

    ->addColumn ("address_short", "Короткое название дома")
    ->addColumn ("plan", "Файл с Планировкой")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")

    // ->addColumn ("Country", "Country", [ // Additional configuration using options
    //     'validation' => [
    //         'required' => false,
    //     ]
    // ])

     ->setSummaryColumns (
        ["name"],
        ["balcony"]
    );

// Add the page to the app
$app->addPage($sqlPage);

// Render the app
$app->render();
?>

Error during configuration of BasicLoginPage

Happy Evening All,

Successfully configure CrudKit with HtmlPages, MySQLTablePages... and I was trying to configure authentication following the documentation [http://crudkit.com/docs/security/auth.html]

I had downloaded the package from the download page and the package doesn't consist of BasicLoginPage.php - so downloaded it directly from the Github.

Still getting the below said errors.

Fatal error: Class 'BasicLoginPage' not found in C:\xampp\htdocs\xxxxx\dashboardv2.php on line 14

Warning: Missing argument 1 for CrudKit\Pages\BasicLoginPage::preprocess()

When visiting the page, I get this PHP warning:

Warning: Missing argument 1 for CrudKit\Pages\BasicLoginPage::preprocess(), called in \vendor\skyronic\crudkit\src\CrudKit\CrudKitApp.php on line 51 and defined in \vendor\skyronic\crudkit\src\CrudKit\Pages\BasicLoginPage.php on line 67

In CrudKitApp.php, there is this function call of preprocess() without arguments, see line 51:

48     protected $login = null;
49     public function useLogin ($login) {
50         $this->login = $login;
51         $login->preprocess ();
52         if (!$login->check ()) {
53             $this->addPage ($login);
54             $this->render ();
55         }
56     }

File BasicLoginPage.php has got a function preprocess, but takes one argument $app, see line 67:

67  public function preprocess ($app) {
68      if ($this->url->get ('__ckLogout', false) !== false) {
69          $this->doLogout ();
70      }
71  }

Dependencies

Hey guys, I'm having issues pulling this into a project because of dependency issues between Twig 1.18 and Twig 1.24.

Any chance the composer.json can be updated to allow none breaking changes on dependencies to occur?

Proper pagination count

The pagination count currently uses a hard coded value, and this needs to be dynamically determined based on the query.

Manual install?

Hello,

How can I install CRUDKIT manually without bash/hithub/composer...?

Thanks,

L

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.