{"id":20556632,"url":"https://github.com/clevertech/yiibackboneboilerplate","last_synced_at":"2025-04-14T13:08:22.393Z","repository":{"id":4623574,"uuid":"5767629","full_name":"clevertech/YiiBackboneBoilerplate","owner":"clevertech","description":"YiiBackboneBoilerplate","archived":false,"fork":false,"pushed_at":"2012-11-25T17:50:11.000Z","size":14635,"stargazers_count":45,"open_issues_count":8,"forks_count":21,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-28T02:12:30.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clevertech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-11T17:05:31.000Z","updated_at":"2021-07-03T09:56:52.000Z","dependencies_parsed_at":"2022-08-06T17:16:24.178Z","dependency_job_id":null,"html_url":"https://github.com/clevertech/YiiBackboneBoilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clevertech%2FYiiBackboneBoilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clevertech%2FYiiBackboneBoilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clevertech%2FYiiBackboneBoilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clevertech%2FYiiBackboneBoilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clevertech","download_url":"https://codeload.github.com/clevertech/YiiBackboneBoilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886316,"owners_count":21177643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T03:30:39.335Z","updated_at":"2025-04-14T13:08:21.890Z","avatar_url":"https://github.com/clevertech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YiiBackboneBoilerplate\nWe at [***Clevertech***](http://clevertech.biz) use this folder structure setup for our own projects when developing [BackboneJS](http://www.backbonejs.org) applications.\n\n### Overview\n\n**YiiBackboneBoilerplate**, aims to provide *Yii Backbone developers* with an application folder to ease the startup of their projects. It uses the flexibility of our [**YiiBoilerplate**](https://github.com/clevertech/YiiBoilerplate) with a *twist* for BackboneJS applications.\n\n#### What is BackboneJS?\nBackbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.\n \nYou may be thinking that Yii is too powerful to be used just as a RESTful service. That for this purpose it could be done with [NodeJS](http://nodejs.org) or any of the other libraries available, but it is the power of Yii and for the sake of application scalability that we decided to use it.\n\n### BackboneJS + Yii \nWe love to work at [***Clevertech***](http://clevertech.biz) with [Yii](http://www.yiiframework.com), in fact, it is one of the biggest assets of our company nowadays. Nevertheless, we are very aware of the new trends, and we had the opportunity to work with [BackboneJS](http://www.backbonejs.org). So we  decided that it could be good to provide a project startup for our developers, and allow us to get the best out of both worlds.\n \n\n### Backbone Overall Folder Structure\nThis document will be focused mainly in the folder structure that we set for the Backbone application. Please, read [YiiBoilerplate's README](https://github.com/clevertech/YiiBoilerplate) for a deeper explanation of the main [Yii](http://www.yiiframework.com)\nfolder structure setup.\n\nBelow the directory structure we are using:\n\n\t/\n    backend/\n        ...\n    common/\n        ...\n    console/\n\t\t...\n    frontend/\n\t\t...\n\t\twww/\n\t    \tapp/\n\t            css/\n\t            img/\n\t            js/\n\t                boilerplate/\n\t                collections/\n\t                libs/\n\t                models/\n\t                views/\n\t                app.js\n\t                controller.js\n\t                main.js\n\t                router.js\n\t                vent.js\n\t            templates/\n    tests/\n        ...\n\n\n####Backbone Application Directories\nIn the js directory, we have:  \n  \n* ***boilerplate***: we have created a set of elements for you to create a model, collection, module and/or view. Please, note that the basic application skeleton that we have setup for you is based on  [Backbone.Marionette](https://github.com/marionettejs/backbone.marionette), and the views are different from normal Backbone views.\n* ***collections***: this is were we place the Backbone collections for our application.   \n* ***libs***: holds the main libraries. We included the ones we thought would be the most useful.  \n* ***models***: this is were we place the Backbone models for our application.\n* ***views***: and this is where we place the backbone views.\n\nA special note regarding the ***templates*** directory. This folder is normally within the ***js*** folder, but we thought that it would be better to separate UI design from the business logic of the javascript files. \n\n###The _runpostdeploy_ script\nThis section is actually extracted from [YiiBoilerplate](https://github.com/clevertech/YiiBoilerplate), but it is worth repeating the procedure.  \n\nThe project has a very handy script that automatically creates the required and folders that are **not** shared for a Yii application, the **runtime** and **assets** folders, extracts the configuration settings specified for a specific environment then copies them to the ****-env.php*** files, and then runs migrations when not on private environments --we believe that migrations should be always run manually by developers on their machines.\n\nTo use this, from the application's root folder, simply run:\n\n```\n./runpostdeploy environmentType migrations\n```\n\n* **environmentType** (required): can be \"any\" of the ones you configure on the **environments** folders (i.e. `./runpostdeploy private` to use ****-private.php*** configurations)\n* **migrations** (optional): could be \"**migrate**\"\" or \"**no-migrate**\". \n\t* migrate: will run migrations\n\t* no-migrate: will not run migrations (on private we won't run them anyway)\n\n###YiiBooster library\nWe have included [YiiBooster](http://yii-booster.clevertech.biz) widget library to the boilerplate. For more information regarding this library and its use\nplease visit [YiiBooster Site](http://yii-booster.clevertech.biz).\n\t\n###Final Notes\nWe would like to inform that this is just a startup **boilerplate** for your own projects. It is not intended by any means to be used ***'AS IS'***, but rather as a base to scale to more complicated structures.   \n\nNeverteless, we have included a couple of goodies that we hope to improve with the help of the community. \n\n====\n\n\u003e [![Clevertech](http://clevertech.biz/images/slir/w54-h36-c54:36/images/site/index/home/clevertech-logo.png)](http://www.clevertech.biz)    \nwell-built beautifully designed web applications  \n[www.clevertech.biz](http://www.clevertech.biz)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevertech%2Fyiibackboneboilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclevertech%2Fyiibackboneboilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevertech%2Fyiibackboneboilerplate/lists"}