{"id":28028447,"url":"https://github.com/cheft/riot-isomorphic-template","last_synced_at":"2025-07-16T14:33:24.687Z","repository":{"id":33747998,"uuid":"37402969","full_name":"cheft/riot-isomorphic-template","owner":"cheft","description":"a riot isomorphic project template","archived":false,"fork":false,"pushed_at":"2015-09-06T07:17:17.000Z","size":10538,"stargazers_count":28,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-21T10:51:21.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/cheft.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":"2015-06-14T07:12:48.000Z","updated_at":"2023-08-17T19:56:20.000Z","dependencies_parsed_at":"2022-09-16T13:11:34.528Z","dependency_job_id":null,"html_url":"https://github.com/cheft/riot-isomorphic-template","commit_stats":null,"previous_names":["cheft/cheft"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cheft/riot-isomorphic-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Friot-isomorphic-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Friot-isomorphic-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Friot-isomorphic-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Friot-isomorphic-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheft","download_url":"https://codeload.github.com/cheft/riot-isomorphic-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Friot-isomorphic-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261110484,"owners_count":23111046,"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":"2025-05-11T07:14:39.210Z","updated_at":"2025-07-16T14:33:24.639Z","avatar_url":"https://github.com/cheft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cheft\na riot isomorphic framework base on riot \u0026 express\n\n## Fatures\n* JS fast rendering\n* SEO friendly\n* Support html5 pushState\n* Support hashchange if IE \u003c 10\n* Support IE9+\n\n## [Demo](http://echoboxd.coding.io/)\n![Login](snapshot/login.png)\n![Index](snapshot/index.png)\n\n    npm install\n\n\tnpm run watch\n\n\u003e tip: username/password is admin/admin\n\n\n## Notes\n\n### library\n* [riot](https://muut.com/riotjs/)\n* [express](http://expressjs.com)\n* [waterline](https://github.com/balderdashy/waterline-docs)\n* [superagent](https://github.com/visionmedia/superagent)\n\n### Cheft Element\n\n#### client\nclient.js\n\n\tvar client = require('./lib/client');\n\tvar config = require('./config');\n\tvar router = require('./app/router');\n\tvar app = window.app = client(config, router);\n\t...\n\tapp.start();\n\n#### server\nserver.js\n\n\tvar server = require('./lib/server');\n\tvar config = require('./config');\n\tvar router = require('./app/router');\n\tvar dbconfig = require('./db');\n\tvar app = root.app = server(config, router, dbconfig);\n\t...\n\tapp.start();\n\n#### common router\napp/router.js\n\n\tmodule.exports = function(router) {\n\t\trouter.get('/', function(req, rep) {\n\t\t\treturn rep.render('messages');\n\t\t});\n\n\t\trouter.get('/login', function(req, rep) {\n\t\t\treturn rep.render('login', {template: 'login.html'});\n\t\t});\n\n\t    router.get('/messages/:id', function(req, rep) {\n\t        return rep.render('message-detail', {params: [req.params.id]});\n\t    });\n\n\t    router.get('/news/:id', function(req, rep) {\n\t        return rep.render('new-detail', {params: [req.params.id]});\n\t    });\n\n\t\trouter.get('/:tagName', function(req, rep) {\n\t\t\treturn rep.render(req.params.tagName, {params: [req.params.tagName]});\n\t\t});\n\t}\n\n* template - public/*.html, default _index.html_\n* params -  tag.opts.params\n\n#### tag \n{tagName}/index.html\n\n\t\u003c{tagName}\u003e\n\t\t\u003cscript\u003eapp.mixin(this, require('mixin'));\u003c/script\u003e\n\t\t\u003cdiv\u003e\n\t\t\t...\n\t\t\u003c/div\u003e\n\t\t\u003cstyle\u003c/style\u003e\n\t\u003c/{tagName}\u003e\n\n{tagName}/mixin.js\n\n\tmodule.exports = {\n\t\ton: {\n\t\t\tinit    :  function() {}\n\t\t\tload    :  function() {}\n\t        mount   :  function() {}\n\t        update  :  function() {}\n\t        updated :  function() {}\n\t        unmount :  function() {}\n\t        custom  :  function(data) {}\n\t\t},\n\t\tdo: {\n\t\t\tclicked : function(e) {\n\t\t\t\tthis.trigger('custom', 'hello');\n\t\t\t}\n\t\t}\n\t}\n\n\u003e server only run init and initData event,  such window, docuemnt don't use on init and initData\n\n#### server router\n{tagName}/router.js\n\n\tmodule.exports = function(router) {\n\t \n\t    router.get('/:id', function(req, rep) {\n\t    \t...\n\t    });\n\n\t    router.get('/', function(req, rep) {\n\t        ...\n\t    });\n\n\t    router.post('/', function(req, rep) {\n\t        ...\n\t    });\n\n\t    router.put('/:id', function(req, rep) {\n\t        ...\n\t    });\n\n\t    router.delete('/:id', function(req, rep) {\n\t        ...\n\t    });\n\t};\n\n\u003e router's access uri: config.apiPrefix + {tagName} + current route\n\n\n#### model\n{tagName}/model.js\n\n\tmodule.exports = {\n\t    identity: 'messages',\n\t    connection: 'myLocalDisk',\n\t    autoRoute: true,\n\t    attributes: {\n\t        name: 'string',\n\t        email: 'string',\n\t        subject: 'string',\n\t        message: 'string'\n\t    }\n\t}\n\n* autoRoute is true, Can auto generate CRUD　route.\n* base waterline, call method such: app.model.user.find({}, cb)\n\n### rest, support client and server\nbase superagent, app.rest.\n\n* get(url, data, cb)\n* post(url, data, cb)\n* put(url, data, cb)\n* del(url, data, cb)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheft%2Friot-isomorphic-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheft%2Friot-isomorphic-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheft%2Friot-isomorphic-template/lists"}