Skeleton application: a fully fledged skeleton suitable for big applications #40

Closed
qiangxue opened this Issue Mar 29, 2013 · 36 comments

Comments

Projects
None yet
@qiangxue
Member

qiangxue commented Mar 29, 2013

The skeleton should contain multi-tier directory structure (something similar to http://www.yiiframework.com/wiki/155/the-directory-structure-of-the-yii-project-site).

It should contain tools supporting environment switching, deployment, etc.

It should contain a ready-to-use backend, and a nearly empty frontend.

TODO:

  • rename backstagebackend

frontend

  • Login/signup via Facebook (extension?)
  • Signup.
  • Password reset.

backstage

  • Backstage layout.
  • RBAC-controller controller permissions.
  • Ability to generate frontend URLs.
  • Error log viewer.

console

  • Ability to generate frontend URLs.
@andersonamuller

This comment has been minimized.

Show comment
Hide comment
@andersonamuller

andersonamuller Apr 5, 2013

Contributor

My initial proposal:
https://github.com/andersonamuller/php-app-structure-proposal
I didn't have the time to documented it yet, but I hope it will raise some discussion/comments.
Some files like www/index.php, app/test-drive/bootstrap.php also have some prove test.

Contributor

andersonamuller commented Apr 5, 2013

My initial proposal:
https://github.com/andersonamuller/php-app-structure-proposal
I didn't have the time to documented it yet, but I hope it will raise some discussion/comments.
Some files like www/index.php, app/test-drive/bootstrap.php also have some prove test.

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Apr 5, 2013

Contributor

My proposal: https://github.com/phundament/app - the directory structure is totally flexible.

Contributor

schmunk42 commented Apr 5, 2013

My proposal: https://github.com/phundament/app - the directory structure is totally flexible.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Apr 5, 2013

Contributor

Yii-boilerplate maybe, no?

Contributor

Ragazzo commented Apr 5, 2013

Yii-boilerplate maybe, no?

@Pulgafree

This comment has been minimized.

Show comment
Hide comment
@Pulgafree

Pulgafree Apr 9, 2013

I am with @schmunk42 proposal

I am with @schmunk42 proposal

@waitekk

This comment has been minimized.

Show comment
Hide comment
@waitekk

waitekk Apr 12, 2013

Agree with @schmunk42, this slightly reminds of SF2 structure, no app code in document root, only entry point script + published assets; vendor libs stored separately.

waitekk commented Apr 12, 2013

Agree with @schmunk42, this slightly reminds of SF2 structure, no app code in document root, only entry point script + published assets; vendor libs stored separately.

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Apr 12, 2013

Contributor

Just to note that: some things are different from Symfony2.

AFAIK (just have been to a SF2 Session) in SF2 the app folder is more like your application configuration, while in src are the classes of your application.

In Phundament your application is in app, which is equivalent to protected in the WebApp Skeleton. In src there's only the ComposerCallback class, which hooks yiic commands into the composer process.

The locations can be changed and are fully customizable via composer.json and config/main.php.

Contributor

schmunk42 commented Apr 12, 2013

Just to note that: some things are different from Symfony2.

AFAIK (just have been to a SF2 Session) in SF2 the app folder is more like your application configuration, while in src are the classes of your application.

In Phundament your application is in app, which is equivalent to protected in the WebApp Skeleton. In src there's only the ComposerCallback class, which hooks yiic commands into the composer process.

The locations can be changed and are fully customizable via composer.json and config/main.php.

@resurtm

This comment has been minimized.

Show comment
Hide comment
@resurtm

resurtm May 23, 2013

Contributor

Voting for architecture and structure which is utilized by YiiBoilerplate and recommended in Qiang's article.

Contributor

resurtm commented May 23, 2013

Voting for architecture and structure which is utilized by YiiBoilerplate and recommended in Qiang's article.

@ghost ghost assigned samdark May 23, 2013

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark May 23, 2013

Member

I'll create a pull request for it.

Member

samdark commented May 23, 2013

I'll create a pull request for it.

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue May 23, 2013

Member

@samdark It would be great if you could describe the dir structure here first before you start implementation.

I'm thinking we should rename "bootstrap" to "simple", and this to "advanced". For "simple", perhaps we should revert back to the "protected" folder structure since that is the easiest way for shared hosting users.

We should also think about the features to be provided by "advanced". Here are my suggestions. Your suggestions are welcome!

  • The app should be backed by a MySQL database. We should provide SQLs for generating other kinds of database.
  • The front end should consist of a home page, a login page supporting login via Facebook, a signup page supporting signup via Facebook, a password reset page.
  • The back end should consist of a login page, an application log display page, an application stats page, a set of user management pages
  • The back end should be designed such that it is easy and straightforward to add the management pages for new type of data. This is very important.
  • The back end may be integrated with the RBAC module
  • The "console" app should consist some commonly used commands.
Member

qiangxue commented May 23, 2013

@samdark It would be great if you could describe the dir structure here first before you start implementation.

I'm thinking we should rename "bootstrap" to "simple", and this to "advanced". For "simple", perhaps we should revert back to the "protected" folder structure since that is the easiest way for shared hosting users.

We should also think about the features to be provided by "advanced". Here are my suggestions. Your suggestions are welcome!

  • The app should be backed by a MySQL database. We should provide SQLs for generating other kinds of database.
  • The front end should consist of a home page, a login page supporting login via Facebook, a signup page supporting signup via Facebook, a password reset page.
  • The back end should consist of a login page, an application log display page, an application stats page, a set of user management pages
  • The back end should be designed such that it is easy and straightforward to add the management pages for new type of data. This is very important.
  • The back end may be integrated with the RBAC module
  • The "console" app should consist some commonly used commands.
@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 May 23, 2013

Contributor

Proposals:

  • The app should be backed by a MySQL database. We should provide migrations for generating other kinds of database.
  • The back end should be designed such that it is easy and straightforward to add the management pages for new type of data. This is very important. Use bootstrap as the default backend theme and components.
Contributor

schmunk42 commented May 23, 2013

Proposals:

  • The app should be backed by a MySQL database. We should provide migrations for generating other kinds of database.
  • The back end should be designed such that it is easy and straightforward to add the management pages for new type of data. This is very important. Use bootstrap as the default backend theme and components.
@resurtm

This comment has been minimized.

Show comment
Hide comment
@resurtm

resurtm May 23, 2013

Contributor

I'd like to see (and i almost sure everyone else would use it) shared/common URL manager rules feature. I always came across tasks when i have to generate URLs to the frontend application controllers from console or backend codebase, but default URL manager implementation doesn't allows this (rules from different applications clashes).

Example of how i'm solving it now:

  1. Shared/application specific rules set with context: https://github.com/resurtm/yii2-acme/blob/master/common/config/main.php#L68-L86
  2. Custom URL rule class with context property: https://github.com/resurtm/yii2-acme/blob/master/common/components/UrlRule.php
  3. This is how i use shared frontend rules to generate blog post link (no matter what application uses Post model at certain time): https://github.com/resurtm/yii2-acme/blob/master/common/models/Post.php#L141-L142
Contributor

resurtm commented May 23, 2013

I'd like to see (and i almost sure everyone else would use it) shared/common URL manager rules feature. I always came across tasks when i have to generate URLs to the frontend application controllers from console or backend codebase, but default URL manager implementation doesn't allows this (rules from different applications clashes).

Example of how i'm solving it now:

  1. Shared/application specific rules set with context: https://github.com/resurtm/yii2-acme/blob/master/common/config/main.php#L68-L86
  2. Custom URL rule class with context property: https://github.com/resurtm/yii2-acme/blob/master/common/components/UrlRule.php
  3. This is how i use shared frontend rules to generate blog post link (no matter what application uses Post model at certain time): https://github.com/resurtm/yii2-acme/blob/master/common/models/Post.php#L141-L142
@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 May 23, 2013

Contributor

I have a general question. Why do you separate frontend & backend at all?

Contributor

schmunk42 commented May 23, 2013

I have a general question. Why do you separate frontend & backend at all?

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark May 23, 2013

Member

Because on some projects it is easier to work with such structure:

  • Some actions aren't really required to be in frontend. Examples are: reports, moderation queues, resetting another user's password, UI translation etc.
  • Backend often uses its own layout and config.
  • It's a bit more secure. For example, you can add only some IPs or even not expose it to network outside of your office.
Member

samdark commented May 23, 2013

Because on some projects it is easier to work with such structure:

  • Some actions aren't really required to be in frontend. Examples are: reports, moderation queues, resetting another user's password, UI translation etc.
  • Backend often uses its own layout and config.
  • It's a bit more secure. For example, you can add only some IPs or even not expose it to network outside of your office.
@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 May 23, 2013

Contributor

Do you split/distribute the application across servers?

I'd say the access and security should be handled by the application, eg. gii is part of the core in Yii 1 and also uses IP filters. Backend and frontend layout (theme) should be handled easily in Yii2.
Personally, I think this layout is caused by some limitations in Yii 1.

Anyway, there are three commonly used layouts (using yiinitializer terms):

  • basic (with protected folder)
  • intermediate (app, www, vendor folder; phundament)
  • advanced (frontend, backend, common, vendor)

I think the most important thing is to keep the app templates really slim and have the extensions working in every setup.
Related Issue: #389

Contributor

schmunk42 commented May 23, 2013

Do you split/distribute the application across servers?

I'd say the access and security should be handled by the application, eg. gii is part of the core in Yii 1 and also uses IP filters. Backend and frontend layout (theme) should be handled easily in Yii2.
Personally, I think this layout is caused by some limitations in Yii 1.

Anyway, there are three commonly used layouts (using yiinitializer terms):

  • basic (with protected folder)
  • intermediate (app, www, vendor folder; phundament)
  • advanced (frontend, backend, common, vendor)

I think the most important thing is to keep the app templates really slim and have the extensions working in every setup.
Related Issue: #389

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark May 23, 2013

Member

When extra security needed we may deploy backend to the server not accessible from internet at all.

Member

samdark commented May 23, 2013

When extra security needed we may deploy backend to the server not accessible from internet at all.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo May 24, 2013

Contributor

hm, what about this one? https://github.com/tonydspaniard/yiinitializr-advanced I think at the moment it is most powerful, no?

Contributor

Ragazzo commented May 24, 2013

hm, what about this one? https://github.com/tonydspaniard/yiinitializr-advanced I think at the moment it is most powerful, no?

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark May 24, 2013

Member

Yes, that's very close.

Member

samdark commented May 24, 2013

Yes, that's very close.

@tonydspaniard

This comment has been minimized.

Show comment
Hide comment
@tonydspaniard

tonydspaniard May 24, 2013

Contributor

For various types of bootstraps, please see Yiinitializer removed lots of garbish from YiiBoilerplate (far too many configurations) and took lots of ideas and conceptions from other Yii project structures available (even Phundament - thanks to Tobias).

Contributor

tonydspaniard commented May 24, 2013

For various types of bootstraps, please see Yiinitializer removed lots of garbish from YiiBoilerplate (far too many configurations) and took lots of ideas and conceptions from other Yii project structures available (even Phundament - thanks to Tobias).

@samdark

This comment has been minimized.

Show comment
Hide comment
Member

samdark commented May 24, 2013

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Jun 26, 2013

Contributor

References:
Backstage layout: Examples from Yii Forum Discussion
Login/signup via Facebook (extension?): Best rated extensions from Yii1 eoauth, hoauth

Contributor

schmunk42 commented Jun 26, 2013

References:
Backstage layout: Examples from Yii Forum Discussion
Login/signup via Facebook (extension?): Best rated extensions from Yii1 eoauth, hoauth

@egorio

This comment has been minimized.

Show comment
Hide comment
@egorio

egorio Jun 27, 2013

Contributor

More ideas about design look at https://wrapbootstrap.com/themes/admin.

Some of that themes with extended license are not expensive (for example - https://wrapbootstrap.com/theme/metro-admin-theme-metro-king-WB0GRG7H2).

I can take part in the purchase. Bonus - more widgets to the backend app.

Contributor

egorio commented Jun 27, 2013

More ideas about design look at https://wrapbootstrap.com/themes/admin.

Some of that themes with extended license are not expensive (for example - https://wrapbootstrap.com/theme/metro-admin-theme-metro-king-WB0GRG7H2).

I can take part in the purchase. Bonus - more widgets to the backend app.

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Jun 27, 2013

Contributor

@egorio I thought about the same. But does the extended license cover this?

Contributor

schmunk42 commented Jun 27, 2013

@egorio I thought about the same. But does the extended license cover this?

@egorio

This comment has been minimized.

Show comment
Hide comment
@egorio

egorio Jun 27, 2013

Contributor

@schmunk42 I do not know much about licenses, but about BSD nothing written :( - https://wrapbootstrap.com/help/licenses. I think, if we take this way, we can negotiate with the owner.

Contributor

egorio commented Jun 27, 2013

@schmunk42 I do not know much about licenses, but about BSD nothing written :( - https://wrapbootstrap.com/help/licenses. I think, if we take this way, we can negotiate with the owner.

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Jan 10, 2014

Member

Spent some time drawing a possible layout for backend of advanced app:

yii-admin

Thoughts?

Member

samdark commented Jan 10, 2014

Spent some time drawing a possible layout for backend of advanced app:

yii-admin

Thoughts?

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Jan 10, 2014

Contributor

I though about a mechanism for registering navigation items by extension in the left menu bar.
Eg. user or rights extensions could register their own submenu or toolbar icon in the backend.

Furthermore I'd like to see the the debug-toolbar enhanced, so that it can also be used for switching between frontend and backend, but also to edit the current page in the frontend for example.
I think with a slight update to the filter/access options, this should be pretty easy. See also #838

Contributor

schmunk42 commented Jan 10, 2014

I though about a mechanism for registering navigation items by extension in the left menu bar.
Eg. user or rights extensions could register their own submenu or toolbar icon in the backend.

Furthermore I'd like to see the the debug-toolbar enhanced, so that it can also be used for switching between frontend and backend, but also to edit the current page in the frontend for example.
I think with a slight update to the filter/access options, this should be pretty easy. See also #838

@andersonamuller

This comment has been minimized.

Show comment
Hide comment
@andersonamuller

andersonamuller Jan 10, 2014

Contributor

About the layout, it's pretty similar to this free template designed for Bootstrap 3, maybe it can be usefull and save some of your time:

http://startbootstrap.com/sb-admin

sb-admin

Contributor

andersonamuller commented Jan 10, 2014

About the layout, it's pretty similar to this free template designed for Bootstrap 3, maybe it can be usefull and save some of your time:

http://startbootstrap.com/sb-admin

sb-admin

@schmunk42 schmunk42 referenced this issue Jan 10, 2014

Closed

Debug toolbar enhancements #838

3 of 6 tasks complete
@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Jan 10, 2014

Contributor

The markup of the backend views has to follow a specific form, like:

<h1>Module Name<small>View</small></h1>
<div class="breadcrumbs">
   ... breadcrumb-widget, data handled by controller... 
</div>
<div class="content">
   ... rows and spans, whatever you like ... 
</div>

This should be very close to the Bootstrap 3 classes, if not identical. (Yes, I think we have to stick with bootstrap here ;))
I haven't looked into the above, but many admin themes defined a lot of additional classes to create the style for the boxes, etc...

If Bootstrap 3 is extended, then we have to provide the theme, along with a nice mechanism to apply it for certain controllers.

Contributor

schmunk42 commented Jan 10, 2014

The markup of the backend views has to follow a specific form, like:

<h1>Module Name<small>View</small></h1>
<div class="breadcrumbs">
   ... breadcrumb-widget, data handled by controller... 
</div>
<div class="content">
   ... rows and spans, whatever you like ... 
</div>

This should be very close to the Bootstrap 3 classes, if not identical. (Yes, I think we have to stick with bootstrap here ;))
I haven't looked into the above, but many admin themes defined a lot of additional classes to create the style for the boxes, etc...

If Bootstrap 3 is extended, then we have to provide the theme, along with a nice mechanism to apply it for certain controllers.

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Jan 10, 2014

Member

@schmunk42 debug is definitely not for production.

Registering icons and menu items is planned.

@andersonamuller quite similar. Mine was insprired by Wordpress admin panel.

Member

samdark commented Jan 10, 2014

@schmunk42 debug is definitely not for production.

Registering icons and menu items is planned.

@andersonamuller quite similar. Mine was insprired by Wordpress admin panel.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jan 11, 2014

Contributor

@samdark you designed debug panel interface or for what is it?))

Contributor

Ragazzo commented Jan 11, 2014

@samdark you designed debug panel interface or for what is it?))

@angelcoding

This comment has been minimized.

Show comment
Hide comment
@angelcoding

angelcoding Feb 4, 2014

Just in case it's still relevant/useful there's a very good MIT licensed Bootstrap admin template I found here..
https://github.com/onokumus/Bootstrap-Admin-Template
demo - http://demo.onokumus.com/metis/dashboard.html

Just in case it's still relevant/useful there's a very good MIT licensed Bootstrap admin template I found here..
https://github.com/onokumus/Bootstrap-Admin-Template
demo - http://demo.onokumus.com/metis/dashboard.html

@kmindi

This comment has been minimized.

Show comment
Hide comment
@kmindi

kmindi Feb 4, 2014

Contributor

@angelcoding that looks pretty good ;)

Contributor

kmindi commented Feb 4, 2014

@angelcoding that looks pretty good ;)

@qiangxue qiangxue modified the milestones: 2.0 RC, 2.0 Beta Mar 15, 2014

@qiangxue qiangxue modified the milestones: 2.0 GA, 2.0 RC Apr 16, 2014

@samdark samdark modified the milestones: 2.0 GA, 2.0 RC Jun 23, 2014

@rubenheymans

This comment has been minimized.

Show comment
Hide comment
@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Feb 26, 2015

Contributor

Just adding this one for reference https://github.com/dmstr/yii2-adminlte-asset

Contributor

schmunk42 commented Feb 26, 2015

Just adding this one for reference https://github.com/dmstr/yii2-adminlte-asset

@tsvetkovpro

This comment has been minimized.

Show comment
Hide comment
@tsvetkovpro

tsvetkovpro Jun 6, 2016

Что с этим вопросом ? никак не пойму почему не закрывают баг?

Что с этим вопросом ? никак не пойму почему не закрывают баг?

@samdark samdark modified the milestones: 2.2.x, 2.1.x Jun 6, 2016

@samdark samdark closed this Jun 6, 2016

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Jun 6, 2016

Member

It's more or less done. Closing since it's a meta-issue.

Member

samdark commented Jun 6, 2016

It's more or less done. Closing since it's a meta-issue.

@cebe cebe removed this from the 2.2.x milestone Jun 9, 2016

samdark pushed a commit that referenced this issue Mar 30, 2018

Merge pull request #40 from jtcczu/doc
translate rest-routing.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment