{"id":26769896,"url":"https://github.com/bbuck/node-trees","last_synced_at":"2025-08-12T16:38:08.648Z","repository":{"id":4019910,"uuid":"5119518","full_name":"bbuck/node-trees","owner":"bbuck","description":"For now, reserving the name 'trees'","archived":false,"fork":false,"pushed_at":"2017-03-31T15:47:09.000Z","size":88,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T22:46:22.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/bbuck.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-07-20T05:32:51.000Z","updated_at":"2017-03-31T15:47:11.000Z","dependencies_parsed_at":"2022-08-06T14:30:33.186Z","dependency_job_id":null,"html_url":"https://github.com/bbuck/node-trees","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bbuck/node-trees","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fnode-trees","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fnode-trees/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fnode-trees/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fnode-trees/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbuck","download_url":"https://codeload.github.com/bbuck/node-trees/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fnode-trees/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270098959,"owners_count":24527021,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-03-28T22:46:21.355Z","updated_at":"2025-08-12T16:38:08.618Z","avatar_url":"https://github.com/bbuck.png","language":"JavaScript","readme":"**THIS PROJECT IS NO LONGER ACTIVE**\r\n\r\n# Trees\r\n\r\nTrees is a wrapper around the very awesome express.js module that provides a\r\nmore structured and common MVC framework to work with. You gain the benefit of\r\ntested MVC structure and the stability and features of express (a win/win)!\r\n\r\n# Usage\r\n\r\n**NOTE:** It's important to note that Trees in a _very_ early alpha stage and\r\nthese instructions are almost guaranteed to change soon or break.\r\n\r\n### Install\r\n\r\nInstall the trees module globally first.\r\n\r\n```\r\n$ npm install -g tree-server\r\n```\r\n\r\n### Create a New Trees Application\r\n\r\n```\r\n$ trees new application\r\n$ cd application\r\n$ npm install\r\n```\r\n\r\n### Create A Controller\r\n\r\nReview the default generated controller. You should see:\r\n\r\n```javascript\r\nvar ooj = require(\"ooj\"),\r\n    BaseController = require(\"tree-server\").BaseController;\r\n\r\n// Define our Pages Controller, the use of OOJ is here to make extending\r\n// the BaseController simpler and less involved.\r\nmodule.exports = ooj.Class({\r\n  // Grab functionality in the Base Controller\r\n  extend: BaseController,\r\n\r\n  // This is the home action, actions are just named functions inside of a\r\n  // controller\r\n  home: function() {\r\n    // Anything attached to viewData will be passed to the view when it is\r\n    // rendered.\r\n    this.viewData.name = \"World\";\r\n\r\n    // There was no render or send call specified, which means that trees\r\n    // will look for app/views/pages/home.jade to render. We can specify\r\n    // a render if we want something different\r\n    //   this.render(\"alt_home\");\r\n    // The above will look for app/views/pages/alt_home.jade\r\n  }\r\n});\r\n```\r\n\r\nCheck the `config/routes.js` and see how trees knows which controller and action\r\nto perform for which route. You can see we've defined the root path (`/`) to point\r\nto the `pages` controllers `home` action.\r\n\r\n```javascript\r\nvar app = require(\"../scripts/app\");\r\n\r\napp.trees.router.draw(function() {\r\n  // You should set a default route for your root path\r\n  //   this.root({to: {controller: \"controller\", action: \"action\"}});\r\n  //  OR\r\n  //   this.root({to: \"controller#action\"});\r\n  //  OR\r\n  //   this.root(\"controller#action\");\r\n\r\n  this.root(\"pages#home\");\r\n\r\n  // Use match to match arbitrary routes\r\n  //   this.match(\"posts\", {handler: \"posts#index\", via: \"get\"});\r\n\r\n  // Use specific methods if you need to.\r\n  //  this.get(\"post/:post_id/comments\", \"post#comments\");\r\n  //  this.delete(\"post\", \"post#delete\");\r\n\r\n  // Use resources to specify standard CRUD routes for a certain resource\r\n  //   this.resources(\"posts\");\r\n  // Gives you:\r\n  //   GET /posts =\u003e \"posts#index\"\r\n  //   GET /posts/new =\u003e \"posts#new\"\r\n  //   POST /posts =\u003e \"posts#create\"\r\n  //   (express param) :post_id =\u003e \"posts#load_post\"\r\n  //   GET /posts/:post_id =\u003e \"posts#show\"\r\n  //   GET /posts/:post_id/edit =\u003e \"posts#edit\"\r\n  //   PUT/PATCH /posts/:post_id =\u003e \"posts#update\"\r\n  //   DELETE /posts/:post_id =\u003e \"posts#delete\"\r\n\r\n  // Use namespaces to group routes\r\n  //   this.namespace(\"admin\", function() {\r\n  //     this.root({to: \"admin#home\"}); // =\u003e GET /admin\r\n  //     this.get(\"control_panel\", \"admin#control_panel\"); // GET /admin/control_panel\r\n  //   });\r\n});\r\n```\r\n\r\n**NOTE:** The `resources` has not yet been implemented and `namespace` has not\r\nbeen fully tested so may not function properly with views/controllers.\r\n\r\nFinally we'll check the view that is rendered at `app/views/pages/home.jade`:\r\n\r\n```jade\r\nextends ../layouts/application\r\n\r\nblock body\r\n  div\r\n    h1 Hello, #{name}\r\n```\r\n\r\nThis view extends the base application layout and simply outputs a `div` with\r\nan `h1` inside of it.\r\n\r\n### Run Trees!\r\n\r\nFinally, run your server! For now, we do it all manually. I'm planning on adding\r\nin a `trees server` that will run the server with a live reload feature (etc...)\r\nin the future.\r\n\r\n```\r\n$ node index.js\r\n```\r\n\r\nAnd finally, go to `localhost:3000` in your browser!\r\n\r\n# Author\r\n\r\nBrandon Buck \u003clordizuriel@gmail.com\u003e\r\n\r\n# Licence\r\n\r\n[MIT](http://opensource.org/licenses/MIT)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuck%2Fnode-trees","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbuck%2Fnode-trees","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuck%2Fnode-trees/lists"}