The Wayback Machine - https://web.archive.org/web/20210901030036/https://github.com/mevdschee/php-crud-api/issues/713
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

Fully functional bootstrapped application #713

Open
vascanera opened this issue Oct 7, 2020 · 6 comments
Open

Fully functional bootstrapped application #713

vascanera opened this issue Oct 7, 2020 · 6 comments

Comments

@vascanera
Copy link

@vascanera vascanera commented Oct 7, 2020

Hello Maurits,
This is more of a request than it is an actual issue, but I think the value in this request is really high (for newcomers, especially - but not limited to).
Could you please add a COMPLETE application example of using the API (with user authentication, maybe even with the user-creation SQL script, table authorization, etc).
This would be really really helpful as a quickstart / bootstrap for new applications.
Maybe create it as a separate project (in its own repo) that we can further extend to cover more and more of the existing functionality and middlewares.
Or, is there anything like that already available? (and I am not aware of).
Thanks a lot! Keep up the good work!

@mevdschee mevdschee self-assigned this Oct 7, 2020
@mevdschee
Copy link
Owner

@mevdschee mevdschee commented Oct 7, 2020

First of all: thank you for your kind words!

Could you please add a COMPLETE application example

I agree that "the value in this request is really high" and I did do some efforts in that direction.

On the other hand I cannot anticipate how people use this technology as it really is a building block with many ways to use or incorporate it and it is not an application in itself. Also many people want to "keep it simple", so "complete" may mean different things to different people.

Below you find some of my efforts. Maybe the community has some more examples.

@mevdschee
Copy link
Owner

@mevdschee mevdschee commented Oct 7, 2020

Did you see php-crud-ui? It may not be the architecture you had in mind, but I can assure you that it is fast and easy to debug/extend. It is a lot of work to create a good (and complete) application on top of this, but I did try :-). Suggestions, additions and/or improvements are very welcome!

Did you see vue-crud-ui? It may not be complete at all, but it was fun to build and should be easy to extend. I'm not much of a front-end guy, so I haven't updated this project in a while. It may be close to what you have in mind, or isn't it?

@mevdschee
Copy link
Owner

@mevdschee mevdschee commented Oct 7, 2020

I agree that adding security is difficult, but there are many ways to deal with authentication and authorization:

  • On database level, using roles and grants on SQL level (reconnect middleware).
  • Using authorization middleware
  • Multi-tenancy (many customers in one database)
  • etc..

Same goes for authentication:

  • Basic auth
  • External identity provider
  • Username/password
  • Passwordless login
  • OTP / 2FA
  • Intruder detection
  • Audit logging
  • etc...

There are so many options for each of these problems and I intend to support them all. That's why I made the project loadable as a library in Laravel, Symfony and SlimPHP. But please tell me, what would you consider "complete"?

@vascanera
Copy link
Author

@vascanera vascanera commented Oct 7, 2020

I would consider username/password authentication as "complete" - at least from a newcomer's perspective. Maybe later, JWT or something like that.
The idea is to copy/clone the bootstrap application and to be able to create an API using as little php code as possible. Only the bare minimum configuration code should do the trick. Nothing too fancy.

@mevdschee
Copy link
Owner

@mevdschee mevdschee commented Oct 7, 2020

The idea is to copy/clone the bootstrap application and to be able to create an API using as little php code as possible.

What if you use a Laravel example application and add this lib for the REST API? Would that fit your goal?

In the following blog post I've explained how to add the API to an existing Laravel (demo) application:

https://tqdev.com/2019-automatic-rest-api-laravel

NB: If you want to build such a demo application, then I'm happy to contribute to it and to promote it (as good as I can)!

@vascanera
Copy link
Author

@vascanera vascanera commented Oct 10, 2020

Hello. Regarding the Laravel example, I think it defeats the purpose of simplicity. A Laravel basic application using php-crud-api, compared to a php-only "setup-the-config-and-go" application looks like a convoluted mess - and by this, I mean there are just too many steps to accomplish in setting it up (I know, for a Laravel accustomed dev it looks really simple and short!). I appreciate Laravel and other "big boy" frameworks for what they are and for the problems they solve, but there's just too much boilerplate code for the same return (of investment). Let's say I don't want to learn any (new) php framework, I just need the API to work, to expose a DB and have some user/pass authentication, and that's all. The rest should be just fine-tuning that config object for api.php for some custom table/column/path rules. I might start building such an example application myself, but my time is a bit tight right now. I hope I have explained my request a little better this time. Keep it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants