{"id":13555558,"url":"https://github.com/inventures/hatchjs","last_synced_at":"2025-04-03T08:31:39.765Z","repository":{"id":15176506,"uuid":"17904326","full_name":"inventures/hatchjs","owner":"inventures","description":"Hatch.js - not officially supported","archived":false,"fork":false,"pushed_at":"2020-04-07T20:30:03.000Z","size":11126,"stargazers_count":72,"open_issues_count":14,"forks_count":32,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-11-04T04:32:03.140Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inventures.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-19T13:04:22.000Z","updated_at":"2024-06-18T08:39:01.000Z","dependencies_parsed_at":"2022-08-25T10:02:09.812Z","dependency_job_id":null,"html_url":"https://github.com/inventures/hatchjs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inventures%2Fhatchjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inventures%2Fhatchjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inventures%2Fhatchjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inventures%2Fhatchjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inventures","download_url":"https://codeload.github.com/inventures/hatchjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246965897,"owners_count":20861954,"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-08-01T12:03:16.973Z","updated_at":"2025-04-03T08:31:34.754Z","avatar_url":"https://github.com/inventures.png","language":"JavaScript","readme":"(Hatch.js is no longer officially supported. Please feel free to fork, chop and change, use as reference)\n\n# Hatch.js documentation\n\nHatch.js is CMS platform with social features. This package is an\n[Express][express] application which can be extended with additional modules. All parts of\nthis application are accesible via [CompoundJS API][compound-api].\n\n## License\n\nHatch.js dual-licensed under AGPL and Hatch Commercial License. AGPL means that if you fork the Hatch.js code or write a derivative application (an application which runs on the same CPU process), you must open-source and distribute your project freely under the same AGPL terms. Alternatively a commercial closed-source license is available. More details on [our website][pricing].\n\n#### Partner with us\n\nWe believe Hatch.js is a great platform for building social web applications. We are actively seeking partnerships with companies to build commercial products for any purpose on top of the platform. [Contact us][contact] for more information.\n\n## Dependencies\n\nHatch.js requires [Node 0.8+][node], [Redis 2.6+][redis] and imagemagick to be installed. Bower is also required to install client-side dependencies.\n\n\tnpm install -g bower\n\n## Installation\n\nUse Hatch.js as an npm. Please see the [examples][examples] for how to use Hatch.js in this way:\n\n\tnpm install hatchjs\n\nOr standalone:\n\n\tgit clone https://github.com/inventures/hatchjs\n\nThen:\n\n\tnpm install\n\tbower install\n\n## Running Hatch.js\n\nLike most node apps, Hatch.js listens by default on port 3000. We recommend using Nginx or similar to \nproxy requests via port 80 or 443.\n\n\tnode server\n\nRunning in production mode is strongly recommended for live sites. Assets are automatically combined, minified and strongly cached, view templates are pre-compiled resulting in better performance all round:\n\n\tNODE_ENV=production node .\n\tNODE_ENV=production CLUSTER=1 node .\n\nVisit [http://hostname:3000][localhost] to get started with your first group.\n\nBy default Hatch.js connects to Redis DB 0 on 127.0.0.1. You can change this by modifying `./config/database.js`.\n\n## Package Structure Overview\n\n### [./server.js](./server.js)\n\nExports application server builder function. This is main entry point to\napplication. \n\n### [./app][app]\n\nHatch.js is express app structurized with [Compound MVC][compound], so this is standard directory structure for MVC app. It contains core models, controllers, views, helpers, assets and mailers.\n\n### [./app/models][models]\n\nHatch.js models define all of the business object classes within the application. These can be extended by placing model class files within the `/app/models` folder of your app or your app's modules.\n\nModels are accessed via the application context as follows:\n\n```JavaScript\nc.ModelName.functionName();\n```\n\nE.g.\n\n```JavaScript\nc.Content.all({ where: { groupId: 1 }}, function (err, posts) { \n\t// do some stuff with the results\n});\n```\n\nHatch.js uses the RedisHQ driver which is part of [JugglingDB][jugglingdb]. Redis may seem like an unusual choice for a primary database. It was chosen because the requirements of Hatch.js and derived apps are usually fairly data-light + traffic-heavy. Redis is an ideal choice because of it's lightning quick performance. Due to the asynchronous nature of Node.js + Redis and the optimised implementation of MULTI batching within the [RedisHQ][redishq] driver, multiple duplicate requests within the same i/o callback context are also able to share queries and results-sets meaning that performance and scalability of the solution is significantly improved over what is achievable using a more conventional database such as MongoDB or MySQL. On rudimentary hardware (e.g. a standard 1 thread AWS micro instance), Hatch.js is easily able to cope with significant levels of traffic and a large number of concurrent users. We estimate the base performance is roughly 20-30x that of platforms such as Wordpress.\n\nThe Hatch.js database schema is self-explanatory and can be found [here](./db/schema.js).\n\n### [./lib][lib]\n\nHatch core. Contains API and core implementation. Hatch APIs are accessible via the context in code as follows:\n\n```JavaScript\nc.compound.hatch.apiName.functionName();\n```\n\t\nOr globally:\n\n```JavaScript\nvar compound = require('compound');\ncompound.hatch.apiName.functionName();\n```\n\nThe available APIs, documentation and their functions can be found here: [./lib/api][apis]\n\n### [./hatch_modules][modules]\n\nBuilt-in modules for Hatch.js. Each module is separate application mounted to root\napplication on `/do/{moduleName}` route.\n\nModules can modify the existing functionality or models or provide new features.\nThey can be enabled or disabled on a per-group or per-application basis via the\nmanagement area of each group.\n\nModules documentation can be found within the [README][modules-readme].\n\n### [./test][tests]\n\nBefore running tests ensure you have installed dev dependencies:\n\n    npm install\n    bower install\n\nUse `make test` command to run all tests. While debugging / TDD use `make\ntesting` command which is the same as previous, but with `--watch` flag. For\nverbose output run `make test-verbose`.\n\nEvery piece of code should be tested (ideally). Make sure tests included in pull request.\n\n[contact]: http://hatchjs.com/contact\n[pricing]: http://hatchjs.com/pricing\n[examples]: ./examples\n[express]: http://expressjs.com/\n[node]: http://nodejs.org/\n[redis]: http://redis.io/\n[compound]: https://github.com/1602/compound\n[redishq]: https://github.com/jugglingdb/redis-hq-adapter\n[jugglingdb]: http://jugglingdb.co/\n[models]: /app/models\n[apis]: /lib/api/index.js\n[localhost]: http://localhost:3000\n[tests]: ./test\n[server.js]: ./server.js\n[app]: ./app\n[lib]: ./lib\n[modules]: ./hatch_modules\n[modules-readme]: ./hatch_modules/README.md\n[pull]: ./README.md#11-make-pull-pulling-changes\n[feature]: ./README.md#2-make-feature-working-on-feature\n[pr]: ./README.md#3-make-pr-make-pull-request\n[compound-api]: http://compoundjs.github.com/guides\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/inventures/hatchjs/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n![GA Badge](https://ga-beacon.appspot.com/UA-20455884-4/inventures/hatchjs)\n","funding_links":[],"categories":["Node-Powered CMS Frameworks","JavaScript","others","Node-Powered CMS Frameworks [🔝](#readme)","基于 Node 的 CMS 框架"],"sub_categories":["Runner","运行器","运行器e2e测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finventures%2Fhatchjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finventures%2Fhatchjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finventures%2Fhatchjs/lists"}