apollo-universal-starter-kit
apollo-universal-starter-kit copied to clipboard
CRUD cli
We need to finish off Mitja's work on CRUD cli to the point we merge everything into the kit and domain-schema.
Example video by @mitjade of what can be done with cli-crud branch, that he has been working on for a while: video link: https://www.youtube.com/watch?v=g37rGxuPJaM
Example code: https://github.com/sysgears/apollo-universal-starter-kit/tree/cli-crud-example
Roadmap for changes needed to be done. This is a rough list that will get more in depth TODOs added over time:
CLI
- [ ] Refactor module.js, to make modifications easier and more clear what is going on.
- [ ] Utalize
yarn cli updatemodule
on initial module creation and remove all unneeded data defined byyarn cli addcrud
- [ ] Add possibility do add items to schema on initial module create through cli inputs.
Backend (Prisma Like)
Add missing functionality, that matches Prisma. This way we can later on switch to Prisma if needed and everything is already proven to work and documented.
- [ ] Add missing filter variants schema.graphql.
- [ ] Refactor CreateInput and UpdateInput to add _Module_CreateWithout_LinkedModule_Input, needed for multiple creates and updates .
- [ ] Allow different names for db table entries and schema entries.
UI specific
- [ ] Add support for Bootstrap UI for web.
- [ ] Add support for native ui-antd-mobile and ui-native-base.
Domain Schema
- [ ] Move all reusable functionality that is not CLI specific to Domain Schema respected packages.
- [ ] Add knex functionality to version newly added items to schema, or allow to add them manually -> database/migrations/_Module.js.
General improvements
- [x] Refactor ListView.web.jsx, to allow notifications on delete and update actions. (158b55e), (82b8a5e)
- [ ] WIP (mitjade) Refactor ModuleList.jsx, by extracting code to separate helpers, so in case of later changes, not all already generated modules would get affected .
- [ ] Research if refactoring ModuleList.jsx HOCs could be replaced with Query and Mutation components from the new Apollo 2.1 package.
- [ ] Add functionality to sort related items in form. (For example for sorting products under category).
- [ ] Add component for filtering booleans.
- [ ] Fix sort functionality to reorder all needed entries, not just switching the two entries -> crud.js
Please contact mitjade in case any of the TODOs are not clear, or just to discuss ideas how to go around implementing certain things.
Some thoughts on why CLI-CRUD came to be and what I am trying to archive with it
This functionality was inspired by symfony, that offered CLI CRUD generation for modules. It allows you to quickly generate a fully functional graphql
CRUD operations similar to Prisma, but using node
and knex
, with the addition to create a fully working administration for this modules, based on this kit modules approach and build using Domain Schema, to provide a single source of truth for your data. Most importantly you should be able to customize every part of the generated module.
My initial goal is to provide a fully working functionality that can already be used in production. This is already partially achieved, since I do already use it in production my self. Some code still needs to be refactored, so in case of future changes to cli-crud
, minimal changes would be needed to existing already generated modules. This is where most of my focus was spent till now, since I already have 50+ generated modules and updating all of them becomes tedious work over time. Later on I would like to clean up all the code, making in maintainable and scalable for future. This is where I would need some additional help, since it is too big of a task just for one programer. I created some TODOs in above post, to point potential contributors on where things can be improved.
@mitjade @Werter12
Possible plan to merge and develop CRUD cli, for discussion:
- Check all current functionality of CRUD cli and fix all issues, that are relatively easy to fix
- Merge CRUD cli in its current form to the master branch of the kit.
- After initial merge - move parts of CRUD cli to the Domain Schema that should be there based on common sense.
- Extend CRUD cli with various features.
@vlasenko I agree with the plan.
why writing documents if it still not available ?