delight-im / PHP-Auth

Authentication for PHP. Simple, lightweight and secure.
MIT License
1.08k stars 233 forks source link

Is there any kind of starter/boiler template for the frontend forms? #303

Open vbmark opened 4 months ago

vbmark commented 4 months ago

Do there exist any kind of pre-built starter templates for the common forms like register, login, forgot, etc.?

Something already wired to use PHP-Auth as a foundation?

Thank you!

ocram commented 4 months ago

The server-side part should be covered fairly well with the examples from the README, right? So that shouldn’t be too complex or leave open too many questions.

As for the client-side part, the README doesn’t really provide anything, that’s right. But that’s because it’s highly dependent on what client-side technologies or frameworks you are using, and this library should be usable with whatever you use on the front-end side.

What would you suggest? That the README provides examples for the front-end part for these forms for a variety of popular frameworks and technologies? Or that we provide a plain HTML form example for every action?

vbmark commented 4 months ago

Yes, the server side documentation is great.

If there were, "...examples for the front-end part for these forms for a variety of popular frameworks and technologies" that would be great too but I know that's a big ask.

Even if you went completely opinionated and picked one, like a simple bootstrap boilerplate with JavaScript, or whatever you would enjoy building around, seeing how well you did the server-side code I'm sure that whatever you went with would be a great basis upon which others could build.

But if that doesn't sound appealing then plain HTML form examples would be greatly appreciated also.

Thank you.

ocram commented 3 months ago

So I don’t know if it would be helpful to provide boilerplates for the forms for React or Vue or any front-end framework. But either Bootstrap or plain HTML could be done and may provide some value.

For example, if we had the following boilerplate:

<form action="/login" method="post">
<input type="text" name="username" placeholder="Username" /> 
<input type="text" name="password" placeholder="Password" /> 
<input type="checkbox" name="remember" value="1" />
<button type="submit">Log in</button>
</form>

… but not just for the login with a username, but for every single action or task – would you consider that helpful? I mean, you would probably still need to change a lot there (target URL, field names, translations, CSS classes, HTML elements, etc.). But maybe it would still help, I don’t know.

vbmark commented 3 months ago

I found this: https://github.com/schnoog/PHPBoilerPlate

It's a little old but seems to work fine for what I'm looking for. Maybe link to it as a starting point, or fork it and update it if needed.

kagankongar commented 2 weeks ago

I found this: https://github.com/schnoog/PHPBoilerPlate

It's a little old but seems to work fine for what I'm looking for. Maybe link to it as a starting point, or fork it and update it if needed.

careful! The kind author made the code dependent to an .htaccess file inside public. Using/testing without Apache is only possible if you edit lines 9-10 of pageroute.php file.