Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you continue the development of NestJS CRUD? #670

Open
afilp opened this issue Oct 19, 2023 · 10 comments
Open

Can you continue the development of NestJS CRUD? #670

afilp opened this issue Oct 19, 2023 · 10 comments
Assignees
Labels
question Further information is requested

Comments

@afilp
Copy link

afilp commented Oct 19, 2023

Feature Request

It appears that due to your passion and deep knowledge you are the perfect developer to create the best NestJS CRUD library out there.

So, a humble request, can you please, please fork this abandoned NestJS CRUD library and continue its development? It used to be a great library and still is, but has some problems now as the years passed.

nestjsx/crud#710

P.S. This is a fork with some new commits but with no feature development, just trying to be compatible with the latest NestJS version:
https://github.com/gid-oss/dataui-nestjs-crud#readme

@afilp afilp changed the title Can you take over NestJS CRUD? Can you continue the development of NestJS CRUD? Oct 25, 2023
@samchon samchon self-assigned this Oct 27, 2023
@samchon samchon added the question Further information is requested label Oct 27, 2023
@samchon
Copy link
Owner

samchon commented Oct 27, 2023

As I'm using not typeorm but prisma instead, I'm not familiar with above libraries.

At least to support those automatic CRUD, you should suggest the detailed specs what you want.

@afilp
Copy link
Author

afilp commented Oct 27, 2023

You are using typeorm or prisma? Not sure I understood. Thanks!

@samchon
Copy link
Owner

samchon commented Oct 27, 2023

Not typeorm, but prisma

@afilp
Copy link
Author

afilp commented Oct 27, 2023

You could create the best NestJS CRUD library out there, by forking the existing abandoned one and merging all PRs that address many issues!

For example, we would really need this feature to exist in the NestJS CRUD package:
nestjsx/crud#754

Yes, it is in TypeORM but it seems that could do that too, based on your good work in nestia.

We are thousands of NestJS developers out there that are left behind.

See for example how many weekly downloads exist, despite the package is abandoned:

image

We are all in a great need to see this package supporting many more missing features (like querying in an array and many more, see PRs).

Thanks a lot!

@samchon
Copy link
Owner

samchon commented Oct 28, 2023

Analyzed the target libraries and understood that your suggestion can be accomplished just by developing an abstract class capsuled in a function, so that need not to make independent library. I will show you the abstract class and its utilization case detaily at tomorrow. For reference, the abstract class would not be affected whatever your ORM is.

export function CrudController(props: CrudController.IProps) {
    @Controller(props.path)
    class CrudController {
        ....
    }
    return CrudController;
}

@samchon
Copy link
Owner

samchon commented Oct 28, 2023

@afilp Here is the example.

As you can see, no special library required.

Just copy and paste the abstract controller class and customize for your use case.

  1. Abstract CRUD controller class: AuthorizedCrudController
  2. Derived class utilizing the abstract CRUD class: BbsArticlesController
  3. Test functions for demonstration
    i. test_api_bbs_article_create
    ii. test_api_bbs_article_update
    iii. test_api_bbs_article_delete

Github Actions Result: https://github.com/samchon/nestia-auto-crud-example/actions/runs/6677610452/job/18147796260

@afilp
Copy link
Author

afilp commented Oct 28, 2023

Thanks @samchon , I am not sure I get this, is what you propose a replacement of the NestJS CRUD library?
If yes, does it have all the support for filters, plus filtering inside an array (that is missing), etc.?

@samchon
Copy link
Owner

samchon commented Oct 28, 2023

If you need additional features, define them into the abstract class.

@afilp
Copy link
Author

afilp commented Oct 29, 2023

Ok, if we were to migrate from that package to yours, do you have utilities for easy CRUD development? (with all the filters that they support, etc.?).
For example, filters are here (but also look at all other features please) :
https://github.com/nestjsx/crud/wiki/Requests#filter-conditions

Thanks a lot!

@samchon
Copy link
Owner

samchon commented Oct 29, 2023

I have not abstracted such detailly because I think that each API has each story. Also, I do not design database table to be correspondent with DTO schema to be 1:1 relationship. I think that as basic principle of database and DTO structures are different, they've to be different. Furthermore, as I'm using Prisma ORM, which supports type safe APIs, so that taking advantages from auto-completions with type hints, I don't need such features.

Therefore, I can't understand why such features are required. It is your mind that defining such deeply abstracted abstract class, but I won't support it.

Anyway, I've just made utility functions like pagination case of below.

In my commercial project, there're a little bit more utility components, but it is not possible to disclose them publictly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants