rcarvello / webmvcframework

PHP MVC framework for bulding web applications
http://www.webmvcframework.com
Other
53 stars 16 forks source link

Feature request: Login, register, Ajax and WebRTC #1

Closed DeRaja closed 6 years ago

DeRaja commented 6 years ago

Hello Rosario,

Thanks for your such a nicely designed PHP MVC Framework. Very good work. I have studied it in details. I now have a few questions:

1) What is the login password in the default database? This is md5 encrypted. But which password it is you did not mentioned it anywhere in the Readme file or here.

2) Well, now that you already have login, why not extend it a bit to register function too. Do you plan to implement this?

3) How about integrating Ajax possibility everywhere? Which means all pages will be responsive to Ajax. Do you plan to implement this?

4) How about integrating an example of WebRTC within this framework? Do you plan to implement this?

5) How about making some examples of push notifications, like for Chat or any other updates?

Because the way you designed the scripts, many things should be possible now in there, right? BTW, I am not a programmer and could only understand or tweak scripts. So I cannot join you in development.

DeRaja commented 6 years ago

Hi,

Just to let you know that the well known md5 decrypt of password, that is currently in the database as default password DOES NOT work for login. I do not know if there is something in my computer that prevents. But it would be better to revisit this.

DeRaja commented 6 years ago

Hi,

Amazing. I traced the problem and found it out. Solved.

In framework/User.php, Line 117, there is {$this->userTable} in Select Query. In a normal case, it would work because it would understand the user table.

In my case, I added a prefix, master_user.

Naturally it could not find the user table because the scripts does not know that {$this->userTable} == master_user!

Now I could login without any problems. It works like charm...

rcarvello commented 6 years ago

Hi For passwords: https://github.com/rcarvello/webmvcframework/wiki/Setup#setup-and-configuration

or look inside https://github.com/rcarvello/webmvcframework/blob/master/sql/mrp.sql (line 291)

rcarvello commented 6 years ago

To set up your custom user table see and change:

https://github.com/rcarvello/webmvcframework/blob/master/config/security.config.php

rcarvello commented 6 years ago

2 Well, now that you already have login, why not extend it a bit to register function too. Do you plan to implement this?

Answer: At the moment, for managing users, you can use "UserAcconts" and "UserAccount" Controllers (by calling http:/YOUR_HOST/YOUR_APP/common/user_accounts) . Note that "UserAccouns" is a simple back-office facility to manage users. It requires you logged in with admin rights. No registration process is developed right now. It is an application requirement (not of the framework).

rcarvello commented 6 years ago

4 . How about integrating an example of WebRTC within this framework? Do you plan to implement this?

Answer: No at the moment

DeRaja commented 6 years ago

Hello Rosario,

Rosario, do you know that your work is excellent? Keep it up!

I really think you should rethink and reconsider integration of Push/Pull, Callbacks, WebRTC, Ajax, etc. in this framework. Because you already have developed capabilities of generating classes, etc. all this combined and put togather it will come out to be a very good alternative to other frameworks. It has to be different in the first place. Yours is the one. The only problem is that the development is too slow (which I can really understand...).

Uh, the line 291 in my SQL file DOES not include the "password" in my copy. This means I had a different zip file downloaded, perhaps an older version But anyway, I googled and found it out. The problem was different and it was solved. Thanks for your answer.

There is a zero chance for me to agree with your answer on user registration. You thought wrong. By having this, everyone could use your framework OUT-OF-THE-BOX. The usability with expand to many thousand users instantly.

Of course, an user registration is not a framework requirement. In examples you provide, all of them are NOT framework requirements. So on one side you provide non-framework examples and on the otherside you reject user registration example.

My suggestion related to providing it as an example and to develop the entire framework to react to this extremely important and unavoidable aspect of it. For any sensible usability of this framework by public, one cannot disregard it. By not having this as an out-of-the-box example, you restrict and exclude all users who need them.

In the framework, it could embedd certain specific features and security mechanism required during registration process. A simple security mechanism would be to de-activate multiple registration based on IP. Thus, it needs to have Beans and framework logic.

Once the user registration process is provided as an example and - based on this - this area covering registration process is developed within the framework, once could apply on a more complex activity and of coding logic. Had it been there, then I would develop my coding logic to log bad bots by capturing their IP and blocking those one - at a later date - to stop their revsit.

Is my argument above enough to convince you to develop framework logic and provide generators to developers for them to use it and incorporate it in their work?

rcarvello commented 6 years ago

Hello, These are all very interesting topics worthy of consideration. Thanks for the advices Too bad that part of them takes a long time to be developed.

The examples I have developed illustrate the basic functionalities of the framework. I do not exclude that other examples, such as registration or even e-commerce cart, etc. can increase the use of the framework. Login and Registration are definitely "Cross-Cutting" aspects that could be released as reusable and configurable subsystems. But they are subsystems and not frameworks.

Examples of user login and management are just minimal examples of how a subsystem can be shared by different applications. They do not claim to exhaust the whole authentication and registration process.

Surely some generic and reusable Class for the management of IP, BOT, etc. could be developed in '/ framework / classes' to constitute reusable Helpers during the development of applications that require these needs.

Unfortunately, at the moment I'm focused on documenting the framework. I'm also developing a new version that extends the previous one with new features such as concurrent update / synchronization on database, dynamic binding, security and more.

But it is certain that I will remember well how much you suggested to me on WebRTC, Pull and Registration.

DeRaja commented 6 years ago

Hello Rosario,

Thanks for the reply. Wait a moment and let me once again clearify the very central issue of my feature request. Of course, I mentioned that an example of registration could be very helpful. BUT THATS NOT THE CENTRAL ISSUE!

The central Issue I raised here is the following:

1) To develop the framework in such a manner so as to have generic reusable classes, which are sensitive to important aspects of the website, especially considering security and harrasement in todays date.

2) It should also become sentive to dynamic page loading with push-pull and realtime loading techniques.

These two areas are the most wanted in a framework. Not many support these and thus, if not developed or not developed in time, becomes outdated. When I was looking for a good framework in the last week, I found many of them outdated as they were not properly developed. So the challenge is here have a good framework with an inbuilt capability of generating classes, redesign it and have it on the latest.

While there are many fantastic ideas and fanticies, which we in this area could think about, the most urgent ones are really non-other than a) security and b) realtime sensitivity.

If I were to choose and give priority on your framework related to "concurrent update / synchronization on database, dynamic binding", then I would give urgency to realtime. But thats just my humble opinion to express my views on what I think. Your future ideas may obviously differ.

Show me one real framework which has security and realtime builtin, which is just soooo easy to develop and work with out-of-the-box? None. This could be yours...

DeRaja commented 6 years ago

Hello Rosario,

How about integrating the following in your project:

https://github.com/ajaxboy/cjax

Because Cajax is MVC based, it could be easily be integrated . Inside, there is even a sample for CodeIgnitor. If you find another one better than this, I would be happy to work on it too.

If you do not want to integrate it, how about helping me out here to integrate. Then others could follow from your instruction for its integration. At least this would be an option until you come up with something else in your project. If yes, I think we should open a new thread to setup instructions. I could help you in correcting in English.

rcarvello commented 6 years ago

The central Issue I raised here is the following:

To develop the framework in such a manner so as to have generic reusable classes, which are sensitive to important aspects of the website, especially considering security and harrasement in todays date.

At the moment current framework release implements the following security features:

A new but still under development release also includes:

In a future release: ... Computing ....please wait ;)

It should also become sentive to dynamic page loading with push-pull and realtime loading techniques.

Now, allow me to express only these few considerations:

The reasons why you decide to use one framework rather than another can be different and not just those that depend on the size of its features. When starting a project, thinking of doing everything, very often leads to doing nothing. I have given myself some priorities. The guidelines that led the development process of WebMVC are the need to having a design environment in which many key principles of software engineering could be easily applied when developing web applications. Particularly:

Many of the examples I built are regarding these principles. (and certainly having many others would increase the understanding of the framework).

I am perfectly aware that they are not the only reasons to characterize a framework but I will try to implement these as best I can. At the same time, I always take great care of any requests, problems and anything else is suggested to me by users and externals.

DeRaja commented 6 years ago

Hello Rosario,

Grrrrrrrrr, you are one of the most interesting man I know. All you wrote above was in my mind and you put them in words! I love this discussion. Above all, you are not only creative and competent but also very open and helpful. And thats great, a typical and famous italian quality.

Ooops, I need this: Polling features are just developed but undocumented right now. I do not need any documentation. As you read above, I want to have cjax integrated because there is nothing else out there. Here, if I could have your work available soon without any docs, I would be very happy. I feel so lucky to have begun my work with your project because there a something bombastic coming up...

DeRaja commented 6 years ago

Lets make a deal: We help each other. I help you in making language translations in English and German. You help me in having some things integrated, like cajax and make your project better. Deal accepted?

rcarvello commented 6 years ago

Feel free to participate as much as you can. If you wish you can fork the project and create your own wiki by copying the pages from my (https://github.com/rcarvello/webmvcframework/wiki), correcting English and/or translating into German.

However, I can not guarantee to develop your requests not because I do not consider them valid but only for reasons of time. When I have the time to do the things you have requested, it will certainly be thanks to your suggestions (I am already thinking about the wonderful WebRTC).

I work on many projects, paid by customers, and I must necessarily prioritize them.

As, during the course of my profession, I took a lot from the web I just thought of making my contribution to the web by making "Open" Web MVC Framework.

rcarvello commented 6 years ago

Preview regarding the ajax polling for managing of "concurrent update lost on DB " due to the HTTP stateless protocol.

Open the following link in two different PCs (or also two different browsers of the same PC, for example, Chrome and Internet Explorer) for simulating two different users that access a DB

Link (on my personal raspberry test server) http://einternet.no-ip.org/webmvc/home_controller

Suppose we call S1 and S1 the screens of the two different users.

Even if you change data directly from the DB, for example by using PHPMyAdmin, and data were currently displayed on S1 and S2 (or ... Sn) the framework will automatically dispatch updates on any affected clients. This is the real MVC Desing Pattern. Views showing data must automatically observe and refresh themselves with the data changes also when DB changes were done outside the application.

For example in Windows, if you open two windows of the "file manager" shomìwing the same files, and then, from the first, you delete a file, the second window will be automatically refreshed by the system. Windows (and all OS) uses a real MVC implementation.

Do you think that all the web PHP MVC frameworks work in this way?

In my framework, this is a Controller feature implemented by a single method setASObserver. It automatically generates and embeds all js/ajax call in the View/HTML Template and also the server side PHP code needed to "Observe" data changes on the DB/Screen/Context.

Tips: On your browser click Inspectand then Console for seeing the ajax calls inaction regarding the observing of the DB changes

DeRaja commented 6 years ago

Hello Rosario, Thanks for explaining all this. This is fascinating to read.

In my framework, this is a Controller feature implemented by a single method setASObserver.
It automatically generates and embeds all js/ajax call in the View/HTML Template and also the server side PHP code needed to "Observe" data changes on the DB/Screen/Context.

I have just started working on my application from scratch and plan to user your framework. So I am with the basics of learning its power. What you explain will help me in the advanced version of my work. But for now, I still need to use some Ajax framework integration, if I correctly understand.

Let me make an example here on which I am currently working on, which I will modify at a later date.

I want to generate dynamically four drop downs, where the first is pulled from the DB, the others are pulled from the db according to the values chosen by the user. This is currently not possible in the current framework state because it will not process response and get into a loop of pull<--->response of four steps, right? I also need to use for other such dynamic calls in my application. Here, the setASObserver will not help, right? This will make some concurrent updating, from what I understand.

As an example, I use Continents, Countries, States and Cities dropdown. The continents will be generated as default. The other regions will be dynamically loaded and stored in the user table.

My question, to have a start:

Can one use any method to achieve this Ajax calls capturing responses loop starting from Continents and putting the valued values of Countries, States and Cities in the drop down?

I think this is currently not possible. Thus, I am thinking of integrating Cjax, and also for other reasons.

The advantage of Cjax is that it gets embedded tightly within the MVC framework and - occasionally - uses jQuery. This is very similar to Xajax, which is abandoned since many years for its restrictive approach now. So, even if Cjax is not - and perhaps will not be - developed further, it still does its job wonderfully.

What do you think of the above example? If you think this could be good to have it, then lets open a different thread on Regions drop down and integrate it.

DeRaja commented 6 years ago

Hello Rosario,

After you draw my attention on Wiki pages, which are just marvellously documents in excellent english langauge, I went through some of them and found out many things, amongst others many exiting things.

To achieve the above example of dependent dropdown of regions, I now believe that the following could achieve this target:

public function doAction($continent_id,$continent)

And this is already very good news. The MVC framework is really sensitive to Ajax already. I will let you know about its success.

Your work - and this I MUST appreciate it again - is well thought and is just wonderful. It has a lot of potential. I wish you had completed so many things already in the past. I just cannot wait for all these things I read in the Wiki there, which are being cooked in your mind or if beyond that in your Raspberry.

DeRaja commented 6 years ago

Hello Rosario,

I forgot to mention. After reading the Wiki - partly - I ended up under the impression that you have not documented on the Ajax usability within the MVC Framework at all. People, who visit these pages, would not even know about the power of your MVC framework.

May be you could introduce a new Chapter under "Advanced concepts" of introduce a new Section "Realtime/Response Technology" and mention in there on Ajax calls and how responses will be taken care of by the framework infrastructure without having to load the page again in full.

rcarvello commented 6 years ago

Hello,

Thank you very much for your appreciation. The wiki is not yet complete. I hope to do it as soon as possible. Writing effective documentation is very hard, especially if it is related to examples.

You gave me excellent advice regarding the "Realtime / Response Technology" section. Thank you. In addition, in the next release of the framework I will try to enhance the Ajax features, maybe even taking concepts from cjax. I'll have to reflect a bit. :)

DeRaja commented 6 years ago

Hello Rosario,

After playing with your and other MVC Frameworks, I thought it may help you to give a feedback.

First, I withdraw from my suggestion of Cjax. JQuery, or any other popular script is better from the point of view of Mobile applications. Cjax also loads and works with Javascript cjax.js. This may not be available on every CDN Edge nodes globally. JQuery Mobile or any other standard ones will be. So to load specifically 60 KB of cjax.js for an easy php coding is a bit too much. Still, one needs to load other things making the whole project unavailable in some countries or mobiles with low speeds.

Second, Your WebMVC Framework is a bit restrictive for my needs. I had difficulties, for e. g., to add a column in Users table. May be an expert may not have this. Of course, at that time, I did not know much about these scripts. But the fact is that the WebMVC has a tight integration, which others do not.

Thirdly, it would be helpful to stop development in other areas and polish the current state of the WebMVC Framework for one to use it OUT-OF-THE-BOX with many ready examples. All excellent docs helps after but ready made examples helps before. With these ready made examples, one could see how the Framework could be of use to oneself. These ones should be of diversity as much as possible, like 50 - 70 of them. Then, it will help visitors to understand faster than docs. At this moment, you yourself would realize difficulties in creating them and what should be done to make things better.

Fourth, if there is some enhanced capability built-in to generate codes or classes with an advanced configuration GUI, of course without much in details, then it would be really helpful to standardize things. For e.g. a Generator for forms, Email controller, Login Controller, or for specific aspect, etc. Thus, it becomes not only a Framework for function but also has an integrated Generator.

Fifth, make this Framework predominantly with Ajax, response and responsive. This should be so strikingly different than others. Even now, it already have capabilities. It needs to be polished and presented properly. Have a look at Bonfire and FuelCMS that works with CodeIgnitor. This WebMVC Framework must have some of this basics functionality, although they differ in functions. Because the foundation is already in there, you only need to extend and make it available. After it is properly presented with examples, it has a great potential to work with.

So, overall I see this one that has a terrific potential in this framework. I can see that after half a year, you would have come far to deliver something that one could use it on an enterprise level. So, keep it up.