GithubHelp home page GithubHelp logo

what-crud / vue-crud Goto Github PK

View Code? Open in Web Editor NEW
827.0 35.0 238.0 11.7 MB

Vue.js based REST-ful CRUD system

Home Page: https://vue-crud.github.io/

License: MIT License

JavaScript 30.13% Vue 69.26% Dockerfile 0.20% Stylus 0.41%
crm crud vue vuejs2 vuex vuetify rest crud-application vue-crud cms

vue-crud's Introduction

the project is not supported

If you want to contribute to this project please fork from this project or email me to add you to what-crud group

Vue CRUD

license version build PRs Gitpod Ready-to-Code

Vue.js based REST-ful CRUD system.

  • Vue CRUD allows to create both a mechanism for managing a single table, as well as a CMS or extended CRM with a login system and modules
  • Application built with Vue CRUD is SPA (Single Page Application) so it works much faster than apps based on Wordpress, Joomla, etc.
  • Vue CRUD uses the vue along with its ecosystem (Vuex, Vuetify, etc). Enjoy the benefits of the most popular JS framework in the world.
  • The application architecture is adapted to work with REST API

Vue CRUD demo

Functions

Vue CRUD provides a set of utilities, from which you can compose your own application. Features included in the system can communicate with each other thanks to the use of the Vuex library. Vue CRUD includes the following elements:

  • CRUD | DEMO / SANDBOX:
    • operations on records:
      • Store,
      • Update,
      • Suspend/Restore,
      • Delete,
      • Multiple update,
      • Multiple Suspend/Restore,
      • Multiple Delete
    • filtering:
      • Show active/inactive records,
      • Search phrase in whole table,
      • Search phrase in selected column (exact, like and list mode)
    • items view versions:
      • client side (small tables),
      • server side (big tables)
    • items view types:
      • table,
      • NEW! tree
    • other functions and features:
      • datatable mechanism allows selection of the number of records per page, page transition and sorting,
      • management of a child table from the parent table module,
      • export to excel (xlsx),
      • table refreshing,
  • Authentication system | DEMO / SANDBOX:
    • login form (built-in communication with API, validation),
    • optional locale selection,
    • redirecting to the app,
  • App layout components | DEMO / SANDBOX:
    • Toolbar (with optional elements):
      • title,
      • logo,
      • user profile,
      • locale selection,
      • logout,
      • slots for developer
    • Sidebar:
      • List of routes,
      • Slot for title or user avatar,
      • Slot for developer,
      • Customizable sidebar behaviour
    • Alerts system,
    • Footer,
    • ... and others

The record creation / editing form supports the following types of fields:

  • Input,
  • Number,
  • Decimal
  • Textarea,
  • Rich Text Box,
  • Select (hardcoded list or obtained from API),
  • Datepicker,
  • Timepicker,
  • Checkbox,
  • Files,
  • NEW! Dynamic (user can select field type separately for each record),
  • NEW! Custom (with slots)

Support for mobile devices

App layout on desktop...

app layout on desktop

... and on mobile device

app layout on mobile device

Demo versions

Credentials with limited privileges (readonly):
Login: [email protected]
Pass: ajSGenC0
To get full user account, contact me on my company site.

Quick start

Do you want to test the application quickly, and you do not have an API ready? No problem, you can use the ready-made example in the examples folder. The API for this example is available on the internet, so you can connect to it by entering its address in the configuration file.

Steps

  1. Clone Vue CRUD:
git clone [email protected]:what-crud/vue-crud.git
  1. Type following commands:
yarn
:: or
npm install
  1. Choose one of the following templates:
  • empty,
  • simple-crud,
  • sandbox,
  • crm,
  • cms

...and type e.g.:

yarn load-template simple-crud
:: or
npm run load-template simple-crud
  1. If you have your own API prepared, modify src/config/api.js file.

  2. Serve your app:

yarn serve
:: or
npm run serve
  1. Your app is already running (probably at http://localhost:8080).

Usage

The simplest possible code that supports CRUD operations for one table will look something like this:

<template>
  <div>
    <crud
      :prefix="prefix"
      :path="path"
      :page-title="pageTitle"
      :fields-info="fieldsInfo"
      :details-title="$t('detailsTitle')"
    >
    </crud>
    <alert-box></alert-box>
  </div>
</template>

<script>
  import Crud from '@/utils/crud/components/Crud.vue'
  import AlertBox from "@/utils/app/components/AlertBox.vue";
  export default {
    data() {
      return {
        prefix: 'demo',
        path: 'tasks',
        pageTitle: 'demo.tasks',
      }
    },
    computed: {
      fieldsInfo() {
        return [{
            text: this.$t('fields.id'),
            name: 'id',
            details: false,
          },
          {
            type: 'input',
            column: 'name',
            text: this.$t('fields.name'),
            name: 'name',
            multiedit: false
          },
          {
            type: 'input',
            column: 'description',
            text: this.$t('fields.description'),
            name: 'description',
            required: false
          },
        ]
      },
    },
    components: {
      Crud,
      AlertBox,
    },
    i18n: {
      messages: {
        en: {
          detailsTitle: 'Task',
          fields: {
            id: 'Id',
            name: 'Name',
            description: 'Description'
          }
        }
      }
    },
  }
</script>

API

The application requires a connection with the appropriate API. API can be created in any technology - the condition is its compliance with the Vue CRUD communication specification. If you need to create your API and do not know how to get started, and you don't mind PHP and Laravel, download or clone the Laravel CRUD API project.

Documentation

To check out docs, visit :

Contributing

If you have an idea about improving Vue CRUD, do not hesitate.

Developers interested in contributing should read the Code of Conduct.

License

MIT

Copyright (c) 2018-present, Szczepan Masny

vue-crud's People

Contributors

a2u avatar dependabot[bot] avatar jpinnix avatar szczepanmasny avatar thalesrup avatar yajuve 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

vue-crud's Issues

CMS example

  • Needed some components:
    • settings table,
    • treeview (for menus)

Improve rich text box field

Is your feature request related to a problem? Please describe.
Rich text box field is underdeveloped:

  • active buttons aren't highlighted,
  • some important buttons are missing

Describe the solution you'd like

  • add active buttons highlighting,
  • add link and image button,
  • add buttons list customization

pouchdb

I wonder if it would be feasible to use this with pouchdb.

[Feature Request] Replace Laravel as reference implementation

IMO, Laravel, per definition, is the opposite of the dynamic goals of this project and should be replaced as default/reference implementation.

For someone who never had to work with laravel before, it's a pain in the *** to untie the intricacies and understand whats going on. But on the other hand, it would be fairly easy for everyone experienced with laravel, to see through, say, a implementation using a basic PSR-7 framework.
Furthermore, i would say that 20% of all issues opened are directly or indirectly related to the unnecessary complexity of the current laravel integration respectively the lack of a unmistakably clear and intelligible-to-everyone reference implementation.

As an advancement that perfectly fits the idea behinde vue-crud, i recommend using TreeQL (resp. PHP-CRUD-API) as it is almost the server-side equivalent of vue-crud. One single PHP file that auto-generates a RESTful API from an underlying Database including authentication/authorization, GraphQL-esque responses, middlewares, xsrf blocking, firewall and so on.

If that is not suitable, for whatever reasons, i suggest improving the project by switching to slim Framework for its simple yet powerful API building tools.
I would even prefer slim, cause i love to have the convenience (Router, Middleware, PSR-7, DI) without loosing complete control over whats going on or beeing forced to bloat my apps.

But, as both are based on similar concepts, both outpace laravel with ease.

Last not least, the whole backend could be excluded too, letting a demo implementation be written against fake data. Maybe this would be the most "readable" solution, as you dont have to comprehend the communication between front- and backend. But even if this would be the least convenient solution, i would prefer it over using a fat-framework like Laravel, if only because the only thing you learn from using Laravel is how to use Laravel.

A less emotional argument wanted?
Laravel footprint > 200 MB
Slim = 853 kB
PHP-CRUD-API > 260 kB

crm demo login failed?

Yesterday, it's OK.

Today, I cannot login with the given guest user account {user: '[email protected]', pw: 'ajSGenC0'} , and error message pop out 'Login attempt unsuccessful' .

Is that REST API service stop working now?

[Vue warn]: Avoid mutating a prop directly since the value

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "value"

found in

---> at src/utils/crud/components/field-types/Date.vue
at src/utils/crud/components/ItemDetailsField.vue

Administration -> routes -> user-types ERROR

Describe the bug
Code from "cms" template added to "crm" template for "Administration" -> "User - Types" throws exception/error but, "cms" code works as expected.

To Reproduce
Steps to reproduce the behavior:

  1. Add code from cms template to create "src/routes/app/routes/administration/routes/user-types" and "routes/app/Index.vue" item
  2. Start development server
  3. Open application using "Chrome"
  4. Open "Chrome" -> "Dev Tools"
  5. Click on "Administration/User - Types"
  6. See error in "Dev Tools" -> "Console" tab

Expected behavior
Expected to see populated "User Types" grid in UI

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Device: Dell XPS 8700
  • OS: Windows 10 Home
  • Browser: Chrome - Version 80.0.3987.116 (Official Build) (64-bit)

UserTypes_ERROR

Additional context
Compared "crm" "yarn.lock" file to "cms" "yarn.lock" file, they are identical.

[Question] - General Questions

I am keen to try out your template. But, I have a few questions:

  • Looking at the api config, it seems one cannot specify multiple api configurations, example: in my use case I have a separate API for my data entities, and one specifically for auth. How would this work, using this template?
  • I have a JWT workflow for my auth, i.e. login will get an access and refresh tokens. WHen the token expires, I will call refresh to get a new token. Logout will delete from localstorage. How will I be able to implement this workflow, using your template? Or, I can use my own auth mechanism?
  • Are you planning to add any of the other vuetify components to Field Options? Example: Autocomplete, Slider, etc?
  • Can the table view include custom components in cells? Example: I have a UserCard component (which includes name, job title, avatar, etc) that I want to display in the table cell.
  • There are some sections missing in the documentation. When will these be added?

Test

Hello, excellent job!
I can't start a test. I have an API in: 3000 with the "products" table (id: code: name ...) but I don't understand how to make it work.
Could you help me?
I have configured the api.js file as: url: 'http://127.0.0.1:3000' but it always reads port 8080.
Thank you.

yarn serve. please help this error

$ yarn serve
yarn run v1.13.0
$ vue-cli-service serve
INFO Starting development server...
94% after seal

ERROR Failed to compile with 9 errors 5:58:59 PM

These dependencies were not found:

  • @/config/api.js in ./src/store/state.js
  • @/config/field-modifiers.js in ./src/helpers/functions.js
  • @/config/params.js in ./src/plugins/vuetify.js, ./src/store/getters.js and 1 other
  • @/config/store-modules.js in ./src/store/index.js

To install them, you can run: npm install --save @/config/api.js @/config/field-modifiers.js @/config/params.js @/config/store-modules.js

These relative modules were not found:

  • ./config/api in ./src/main.js
  • ./locales/index.js in ./src/main.js
  • ./routes/main/router.js in ./src/router.js

Question on using simple-crud

Describe the issue
-Blank browser screen.
-index.js - Uncaught RangeError: Duplicate use of selection JSON ID cell

To Reproduce
Steps to reproduce the behavior:
-on ubuntu 16.04 command line server
-mkdir /srv/file/test
-cd /srv/file/test
-mkdir vuecrud
-git clone https://github.com/what-crud/vue-crud.git vc-k7016
-cd vc-k7016
-npm i
-npm run load-template simple-crud
-npm run serve
-get error above.

Expected behavior
see the crud on screen

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: I tried two. win10 and ubuntu 16.04 server
  • Browser chrome in win. firefox on ubuntu xfce4
  • Version - firefox 70.0

Smartphone (please complete the following information):

Additional context
Just trying to use it as delivered.

2019-11-04 13_14_07-vue-crud

2019-11-04 13_40_33-redwe458 desk@ad - AnyDesk

Server side search does not work properly

Describe the bug
Server side search box does not work properly when user quickly adds and removes character from from input. App does not wait for user's inaction but sends many requests to api.

Data not shown in ItemDetails Form

Describe the bug
Hi,
Bug: empty fields in itemDetails Form

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Companies'
  2. Open a item from data-table and remember the ID
  3. no need to do anything just close it again
  4. Go to 'Company Types' without doing anything go back to 'Companies'
  5. Open the same row from Data table the Form is empty

i use chrome browser

best regards

michi

CRM example Child Tables

In the CRM example, the child tables are not populated in the goToItem view due to the getChild action never getting dispatched. The script errors out due to no data existing when the childrenList() function is called.

It feels like part of the code is missing there.

PS: Great project, thank you for the source!

Update dependencies

Please update all dependencies, almost all of them are outdated, even Vue.js is pretty old now.

After clone, yarn command fails

I'm following the guide to get it installed here: https://vue-crud.github.io/guide/essentials/installation.html

After cloning and running yarn I hit an error:

chad:Sites chadhutchins$ git clone [email protected]:szczepanmasny/vue-crud.git
Cloning into 'vue-crud'...
remote: Enumerating objects: 158, done.
remote: Counting objects: 100% (158/158), done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 2801 (delta 53), reused 124 (delta 36), pack-reused 2643
Receiving objects: 100% (2801/2801), 1.51 MiB | 3.84 MiB/s, done.
Resolving deltas: 100% (1413/1413), done.
chad:Sites chadhutchins$ cd vue-crud/
chad:vue-crud chadhutchins$ yarn
yarn install v1.16.0
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
warning "tiptap-extensions > [email protected]" has unmet peer dependency "prosemirror-model@^1.0.0".
warning " > [email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0".
[4/4] ๐Ÿ”จ  Building fresh packages...
[1/2] โ ‚ fsevents
warning Error running install script for optional dependency: "/Users/chadhutchins/Sites/vue-crud/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install

Any ideas?

Publish on a package repository

Hi @szczepanmasny,

Since you are already packing some releases onto GitHub, it would be great if you could also package and publish on npmjs.com so people just have to add the package and import right components without dealing with it locally.

It would make easier updates...

Thank you for your work! I'm going through all features ๐Ÿ˜„

Graphql?

Hey.
On VUE there is no admin which can work with graphql api.
Maybe it would be a good decision to add support?

Create Tree-view

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

API url not changing no matter what I do

Describe the bug

I changed the API url in both api.js and auth.js, yet Chrome is still somehow calling 127.0.0.1:8000

Steps to reproduce the behavior:

edit auth.js and api.js to change API url
npm load-template crm
npm run serve
try to login
check chrome console
Failed to load resource: 127.0.0.1:8000 net::ERR_CONNECTION_REFUSED
clear all caches
try incognito

Expected behavior
the login should call the new url specified.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: mac Os - Catalina 10.15
  • Browser : Chrome
  • Version 77.0.3865.75

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.