{"id":13805047,"url":"https://github.com/broerse/ember-cli-blog","last_synced_at":"2025-05-13T18:33:09.630Z","repository":{"id":20045900,"uuid":"23314223","full_name":"broerse/ember-cli-blog","owner":"broerse","description":"Tom Dale's blog example updated for the Ember CLI","archived":false,"fork":true,"pushed_at":"2024-09-19T07:19:35.000Z","size":6445,"stargazers_count":86,"open_issues_count":1,"forks_count":35,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-18T21:46:54.184Z","etag":null,"topics":["authentication","couchdb","deploy","ember","ember-cli","example","filter","pagination","pouchdb"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"balupton/ember-cli-blog","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/broerse.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":"2014-08-25T13:15:15.000Z","updated_at":"2024-09-19T07:19:39.000Z","dependencies_parsed_at":"2023-01-16T21:46:09.361Z","dependency_job_id":null,"html_url":"https://github.com/broerse/ember-cli-blog","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/broerse%2Fember-cli-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broerse%2Fember-cli-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broerse%2Fember-cli-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broerse%2Fember-cli-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/broerse","download_url":"https://codeload.github.com/broerse/ember-cli-blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254003484,"owners_count":21997896,"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":["authentication","couchdb","deploy","ember","ember-cli","example","filter","pagination","pouchdb"],"created_at":"2024-08-04T01:00:56.889Z","updated_at":"2025-05-13T18:33:08.890Z","avatar_url":"https://github.com/broerse.png","language":"JavaScript","readme":"# Myapp\n\n[![Known Vulnerabilities](https://snyk.io/test/github/broerse/ember-cli-blog/badge.svg)](https://snyk.io/test/github/broerse/ember-cli-blog)\n\nThis README outlines the details of collaborating on this Ember application.\n\n## Working example\n\n[https://bloggr.exmer.com/](https://bloggr.exmer.com/)\n\n## Prerequisites\n\nYou will need the following things properly installed on your computer.\n\n* [Git](https://git-scm.com/)\n* [Node.js](https://nodejs.org/) (with npm)\n* [Ember CLI](https://cli.emberjs.com/release/)\n* [Google Chrome](https://google.com/chrome/)\n\n## Installation\n\nTo get up and running with this project:\n\n* `git clone` this repository and cd into it `cd ember-cli-blog`\n* `npm install` to install npm dependencies\n* `ember s` to start the server!\n\nData will be stored in an in memory database and if configured, also replicated to a CouchDB instance.\n\n## Optional Installation\n\nTo setup CouchDB data replication, configure `ENV.remote_couch` inside `./config/environment.js` to point to your CouchDB location.\n\nTo setup a CouchDB instance on your own machine:\n\n* install couchDB from http://couchdb.apache.org/\n* `npm install -g add-cors-to-couchdb`\n* `add-cors-to-couchdb`\n* update `config/environment.js` `local_couch` and `remote_couch` to your CouchDB\n  instance name.\n* update `config/environment.js` `ENV.rootURL` in the production environment\n* To use deploy create a file `.env.deploy.production` in the root of this project containing something like `db=https://username:password@my.couchcluster.com/bloggr`\n\n\n## Running\n\n* `ember s`\n* Visit your app at [http://localhost:4200](http://localhost:4200).\n\n## Running Tests\n\n* `ember test`\n* `ember test --server`\n\n\n## Building\n\n* `ember build` (development)\n* `ember build --environment production` (production)\n\n## Deploy\n\nTo deploy to your CouchDB cluster\n\n* `ember deploy production` (Set your credentials in the `.env.deploy.production` file)\n\n## Authentication\n\nember-simple-auth-pouch authenticator with custom data adapter to setup push replication after login. See `/src/simple-auth/authenticators/pouch.js` and `/src/data/models/application/adapter.js` for further details.\n\n## Authorization\n\n### CouchDB write protected database:\n\nRegistration required example for write permission: Add users in the normal CouchDB way.\nFor example by adding the following document to the `_users` database:\n```\n{\n  \"_id\": \"org.couchdb.user:test\",\n  \"name\": \"test\",\n  \"password\": \"test\",\n  \"roles\": [\n    \"user\"\n  ],\n  \"type\": \"user\"\n}\n```\n\nAfter that you can protect your `bloggr` database from unauthorized writes by adding the following design document to the `bloggr` database.\n```\n{\n  \"_id\": \"_design/only_users_write\",\n  \"validate_doc_update\": \"function (newDoc, oldDoc, userCtx) {\\n\\tif (userCtx.roles.indexOf(\\\"user\\\") == -1 \u0026\u0026 userCtx.roles.indexOf(\\\"_admin\\\") == -1) {\\n\\t\\tthrow({unauthorized: \\\"Only registered users can save data!\\\"});\\n\\t}\\n}\"\n}\n```\n\nFor the free [CloudStation](https://cloudstation.com) you have to create an User and a Database and insert the userdocument from above. Make sure to update your `config/environment.js` `remote_couch` and `rootURL` to match your production settings. Typical `rootURL` values are `/` and `/yourdb/_design/myapp/_rewrite/` If you run your own CouchDB you can use the Hoodie [CouchDB User Management App](https://gr2m.github.io/couchdb-user-management-app/) to create users.\n\n### Secret route\n\nThere is one `secret` route setup to demonstrate how to use ember-simple-auth to protect routes. More instructions can be read there.\n\n## Further Reading / Useful Links\n\n* [ember.js](http://emberjs.com/)\n* [ember-cli](http://ember-cli.com/)\n* [ember-cli-deploy-couchdb](https://github.com/martinic/ember-cli-deploy-couchdb)\n* [ember-simple-auth](https://ember-simple-auth.com/)\n* [ember-simple-auth-pouch](https://github.com/martinic/ember-simple-auth-pouch)\n\n* Development Browser Extensions\n  * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)\n  * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)\n","funding_links":[],"categories":["Packages"],"sub_categories":["Blogging"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroerse%2Fember-cli-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbroerse%2Fember-cli-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroerse%2Fember-cli-blog/lists"}