{"id":20695701,"url":"https://github.com/ibm-cloud/todo-apps","last_synced_at":"2025-04-05T15:06:45.686Z","repository":{"id":16563806,"uuid":"19317653","full_name":"IBM-Cloud/todo-apps","owner":"IBM-Cloud","description":"Sample ToDo application (various languages) running on IBM Cloud","archived":false,"fork":false,"pushed_at":"2021-05-18T06:30:36.000Z","size":777,"stargazers_count":208,"open_issues_count":4,"forks_count":292,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-03-29T14:08:12.336Z","etag":null,"topics":["bluemix","cloud-foundry","cloudant","couchdb","java","mongodb","nodejs","php","python","rails","swift"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IBM-Cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-04-30T15:11:14.000Z","updated_at":"2025-03-08T05:01:35.000Z","dependencies_parsed_at":"2022-07-26T13:48:09.619Z","dependency_job_id":null,"html_url":"https://github.com/IBM-Cloud/todo-apps","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/IBM-Cloud%2Ftodo-apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM-Cloud%2Ftodo-apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM-Cloud%2Ftodo-apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM-Cloud%2Ftodo-apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IBM-Cloud","download_url":"https://codeload.github.com/IBM-Cloud/todo-apps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353745,"owners_count":20925329,"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":["bluemix","cloud-foundry","cloudant","couchdb","java","mongodb","nodejs","php","python","rails","swift"],"created_at":"2024-11-17T00:10:33.667Z","updated_at":"2025-04-05T15:06:45.663Z","avatar_url":"https://github.com/IBM-Cloud.png","language":"Java","readme":"about\n================================================================================\n\nThe ToDo sample apps are meant to be simple demos of how you can take advantage\nof Bluemix and a database service.  In addition it shows how to take advantage\nof both the [built-in](https://www.ng.bluemix.net/docs/starters/rt_landing.html) and [community buildpacks](https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks) \nto deploy your app using whatever runtime you choose.\n\nThe ToDo app is pretty simple, it allows you to add an persist ToDos that you\nneed to get done.  As you complete different ToDos you can mark them done and\neventually delete them from the list.  The ToDos are stored in a database.\n\nAll implementations support two different database backends, \n[Mongo DB](https://www.mongodb.org/) and [Couch DB](http://couchdb.apache.org/) \nvia [Cloudant](https://cloudant.com/).  If you want to use Cloudant see the\nsection of this README titled \"Couch DB and Cloudant\".\n\n\n\nbackground\n================================================================================\n\nThe front-end UI for the ToDo app uses a slightly modified version of the\nBackbone sample from [TodoMVC.com](http://todomvc.com/architecture-examples/backbone/).  The main change was\nto change the `collections/todo.js` file to not use `localStorage`,\nbut to instead set the `url` to `apis/todos`,\nso that the ToDos are retrieved from the server instead of from localStorage.\n\nThe original `collections/todo.js` file is\n[here](https://github.com/tastejs/todomvc/blob/gh-pages/architecture-examples/backbone/js/collections/todos.js).\n\nThere are various implementation for the back-end of the ToDo app.\nWe have implemented the back-end currently in\nJava, Node.js, Sinatra, Python, and PHP.  If you want to contribute a backend\nin another language we enchourage you to do.  See the \"adding new implementations\"\nsection.\n\nAll of the implementations are similar; they serve up the files in the\n`frontend` directory as static web resources - html, css, js files.  And they\nalso expose an api at the uri `api/todos` to query and modify the ToDos.\n\nNote that this isn't really a realistic ToDo app, at present, since it maintains\na global list of Todos that the entire world shares.  The intent is just to\nshow using an existing simple front-end application with a simple database\nback-end.  A real example would probably include user authentication, storing\nToDo's on a per-user basis, etc.\n\n\ngetting the code\n================================================================================\n\nTo get the code you can just clone the repo.\n\n    git clone git@github.com:IBM-Bluemix/todo-apps.git\n\nThe repository contains a directory for each implementation, and the\n`frontend` directory contains the web resources that are used by each\nimplementation.\n\n\n\nrunning the samples\n================================================================================\n\nTo run the samples on Bluemix you must have signed up for Bluemix and have \ninstalled the Cloud Foundry command line tool.  To sign up for Bluemix head to\n[bluemix.net](https://console.ng.bluemix.net/?cm_mmc=Display-GitHubReadMe-_-BluemixSampleApp-Todo-_-Node-Compose-_-BM-DevAd) and register.\n\nYou can download the Cloud Foundry command line tool by following the steps in the [README file](https://github.com/cloudfoundry/cli).\n\nAfter you have installed the Cloud Foundry command line tool you need to point it\nat Bluemix so it knows where to deploy the applications.  You can do this by running\n\n    cf login -a https://api.ng.bluemix.net\n\nThis will prompt you to login with your Bluemix user ID and password which is the\nsame as your IBM ID and password.  You should only need to do this once, the command\nline tool will remember this information.\n\nMost of the projects use build technologies that are specific to the runtime the ToDo\napp is written in to deploy the app to Bluemix (Maven, Rake, Paver, etc).  The assumption \nis that these are tools developers who are using these runtimes are familiar with.  \nUnder the covers they are using the Cloud Foundry command line to deploy the apps.  \nThe benefit is that you don't need to remember verbose commands (in most cases) and\ncontinue to use tools you are comfortable with.  See the individual runtime folders\n(java, node, php, python, sinatra) for more details on how to deploy the various \nversions.\n\n\nadding new implementations\n================================================================================\n\nFeel free to expand upon this project by adding new implementations in your\nfavorite runtime or framework.  Below is a simple specification you should keep\nin mind when adding new implementations.\n\n### REST Endpoints\n\n*  The server implementation should support GET, POST, PUT, and DELETE.\n\n\n#### GET Request - Gets all ToDos\n\n    GET /api/todos\n\nGET Response\nThe response should be a JSON array of all ToDos.\n\n    [{\"completed\":false,\"id\":\"001fbbe7bd708a34624b47526cd6ac89\",\"order\":1,\"title\":\"test\"},{\"completed\":false,\"id\":\"4d6153cf4bc3bdaf9c6c7eebf42d67a6\",\"order\":2,\"title\":\"1\"},{\"completed\":false,\"id\":\"be3855e004dd5d74c802992c09ea8d28\",\"order\":3,\"title\":\"2\"},{\"completed\":false,\"id\":\"e7cb7149098961e5dc182715f1cb0e9d\",\"order\":4,\"title\":\"3\"},{\"completed\":false,\"id\":\"9368ccc4629a1c8dfd99a9e741d01c44\",\"order\":5,\"title\":\"4\"},{\"completed\":false,\"id\":\"e5752d462b83f13da3d8dced1c15eb43\",\"order\":6,\"title\":\"5\"}]\n\n\n\n#### POST Request - Creates a new ToDo\n\n    POST /api/todos/\n\nPOST Body\n\n    {\"title\":\"another\",\"order\":7,\"completed\":false}\n\nPOST Response\nThe response should be a JSON representation of a ToDo with the id field\npopulated.\n\n{\"completed\":false,\"id\":\"f76424cc41f1ee8c2682a37069098794\",\"order\":7,\"title\":\"another\"}\n\n\n\n#### PUT Request - Updates a ToDo\n\n    PUT /api/todos/[id]\n\nPUT Body\n\n    {\"completed\":true,\"id\":\"4d6153cf4bc3bdaf9c6c7eebf42d67a6\",\"order\":2,\"title\":\"1\"}\n\nPUT Response\nThe response should be a JSON representation of the updated ToDo.\n\n    {\"completed\":true,\"id\":\"4d6153cf4bc3bdaf9c6c7eebf42d67a6\",\"order\":2,\"title\":\"1\"}\n\n\n#### DELETE Request - Deletes a ToDo\n\n    DELETE /api/todos/[id]\n\nDELETE Response\nThe response should be a 204.\n\n\n### Mongo\n\n*  The Mongo implementation should use a collection called \"todos\".\n*  You should create a Mongo DB service with the name \"todo-mongo-db\" or \"todo-compose-mongo-db\", depending on which Mongo provider you choose.\n\n#### Setting Up a Mongo DB server Locally\n\nIt will most likely be useful to have a local Mongo DB server for testing\nwhen adding new implementations.\n\nSee the Mongo DB [install instructions](http://docs.mongodb.org/manual/installation/) \nfor your platform to install a local Mongo DB server.\n\n### Couch DB / Cloudant\n\n*  You should create a Cloudant service with the name \"todo-couch-db\".\n\n*  The name of the Couch DB / Cloudant database to use is \"bluemix-todo\".\n\n\u003cb\u003eView\u003c/b\u003e\n\nThe application code should create a view document, if one doesn't already exist,\nin the bluemix-todo database with the following JSON.\n\n    {\n      views: {\n        allTodos: {\n          reduce: \"_count\",\n          map: \"function(doc){if(doc.title \u0026\u0026 doc.completed != null){emit(doc.order,{title: doc.title,completed: doc.completed})}}\"\n        }\n      }\n    }\n\n\n#### Setting Up CouchDB Server Locally\n\nIt will most likely be useful to have a local Couch DB server for testing\nwhen adding new implementations.\n\nRelax, this is very easy!\n\nHead over to the official home of CouchDB - \u003chttp://couchdb.apache.org/\u003e - and\nclick the red \"DOWNLOAD\" link.  Follow the instructions to download a verison\nof CouchDB for your platform.\n\nWhen running the Mac version of CouchDB, you'll have a menu bar tool-button you can\nuse to start and manage the database.\n\nThe implementations will run locally as long as the CouchDB server is running.\nBy default the Couch DB will be running at http://127.0.0.1:5984.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm-cloud%2Ftodo-apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibm-cloud%2Ftodo-apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm-cloud%2Ftodo-apps/lists"}