drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.41k stars 1.09k forks source link

Rapid Web Application Development #893

Closed KaungZawHtet closed 4 months ago

KaungZawHtet commented 3 years ago

We can find rapid web application development is an advantage in php and javascript world. We wish to find it on drogon also and then small business can more easily enjoy this.

There is some code generation things we wish for RAD ideology:

  1. drogon_ctl create rad_project your_project_name (just example)
  2. bravely select an frontend framework easy to handle in the project creation ( I prefer bootstrap 5 and it's easiest to handle for RAD )
  3. built-in layout system in project creation for UI (admin panel or something related to the frontend framework)
  4. MVC code generation from database table (consider idea from gii of yii2 framework) As far as I know, gii's code generation is most balanced in productivity n flexibility
KaungZawHtet commented 3 years ago

Gii's code generation

Screen Shot 2021-06-16 at 01 40 36
marty1885 commented 3 years ago

@KaungZawHtet May you elaborate more about it? We have discussed internally if we should support a more advanced layout system. But voted not to because a) the core devs prefer client side rendering b) don't want to introduce new attack surfaces.

Drogon does support CSP with syntax extension for VSCode. A quick layout and template system. It works more or less like PHP. I use it to quickly spin up pages:

Ex: image

KaungZawHtet commented 3 years ago

Yes, I mean sort of that CSP feature with more complete built-in preparation for RAD.

When I start run a framework (In here, I use Yii2 but most other web framework do the same ), I start seeing this welcome page:

Screen Shot 2021-06-16 at 16 33 00

What is this mean? This mean:

  1. They already choose frontend framework as client-side asset. In here Bootstrap 4.
  2. They already prepare common features. (Log in,Sign up, Contact,about). If u don't like, just remove the code within some seconds.
  3. They already prepare layout system. ( All we need to do is write business logic with the help of code generation tool ). To know the view's layout, I think you need to peek into code of those frameworks.

My suggestion is to peek into the Django, the one loved by many small businesses n freelancers because most of web frameworks for RAD work under the same ideology.

rbugajewski commented 3 years ago

Thanks so much for the valuable input. I think these are great ideas to position Drogon more into the front of frontend developers. As @marty1885 already mentioned, some parts from your initial message are already possible with Drogon and its CSP templating system. All other things are slightly out of scope for the main project, and there is a general consensus that they should be part of a plugin / extensions tightly integrated into the core.

@KaungZawHtet Do you think you could make a PR for this?

KaungZawHtet commented 3 years ago

Yes, these RAD things shouldn't be in the core but as a plugin or a template or may be a drogon_cl option. For clean n well designed PR, I think I need more time to do it.