{"id":20911590,"url":"https://github.com/toslimarif/todo-api","last_synced_at":"2025-05-13T07:32:23.500Z","repository":{"id":42330670,"uuid":"201128760","full_name":"toslimarif/todo-api","owner":"toslimarif","description":"REST API designed in Node.js for a TODO application","archived":false,"fork":false,"pushed_at":"2022-12-11T01:12:30.000Z","size":74,"stargazers_count":9,"open_issues_count":6,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-07T03:27:17.641Z","etag":null,"topics":["express","mongo","mongodb","mongoose","nodejs","openapi-specification","rest-api","restful-api","todo","todo-api","todo-list","todoapp"],"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/toslimarif.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":"2019-08-07T21:12:42.000Z","updated_at":"2022-12-28T08:58:21.000Z","dependencies_parsed_at":"2023-01-26T12:15:26.153Z","dependency_job_id":null,"html_url":"https://github.com/toslimarif/todo-api","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toslimarif%2Ftodo-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toslimarif%2Ftodo-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toslimarif%2Ftodo-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toslimarif%2Ftodo-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toslimarif","download_url":"https://codeload.github.com/toslimarif/todo-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225189117,"owners_count":17435191,"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":["express","mongo","mongodb","mongoose","nodejs","openapi-specification","rest-api","restful-api","todo","todo-api","todo-list","todoapp"],"created_at":"2024-11-18T14:22:42.089Z","updated_at":"2024-11-18T14:22:42.730Z","avatar_url":"https://github.com/toslimarif.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TODO App - REST API Documentation\nRESTful API Designed in Node.js for a very simple TODO application.\n\n## Index\n* [Requirements](#requirements)\n* [Installation](#installation)\n* [Schema](#schema)\n* [Authentication](#authentication)\n* [Root End-Point](#root-end-point)\n* [Core Resources](#core-resources)\n* [Documentation](#documentation)\n* [Request \u0026 Response Examples](#request--response-examples)\n\n## Requirements\n\n- [node \u0026 npm](http://nodejs.org)\n- [MongoDB](https://www.mongodb.com/): Make sure you have your own local or remote MongoDB database URI configured in `credentials/mongo.js`\n- [PostMan](https://www.getpostman.com/)\n\n## Installation\n\n1. Clone the repository: `git clone git@github.com:toslimarif/todo-api.git`\n2. Install the application: `npm install`\n3. Place your own MongoDB URI in `credentials/mongo.js`\n3. Start the server: `node server.js` or `node .`\n4. Open PostMan and make a `GET` request to `http://localhost:3000/api/info/`\n\n## Schema\n\n1. All API access is over HTTP, and accessed from `http://localhost:3000/api/v1`.\n2. All data is sent and received as JSON.\n3. Blank fields are included as `null` instead of being omitted.\n4. All timestamps return in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`\n\n## Authentication\nThere are no authentication implemented yet. So, all the end-points are open.\n\n## Root End-Point\n`http://localhost:3000/api/v1`\n\n## Core Resources\n### Todo\n`Todo` object represents snapshot of a specific Todo with a unique Id. You can retrieve it to see details about the Todo.\n\n#### Schema\n```javascript\n{\n    title: {\n        type: String,\n        required: true\n    },\n    description: {\n        type: String,\n        required: true,\n        default: 'N/A'\n    },\n    onDate: {\n        type: Date,\n        required: true,\n        default: Date.now\n    },\n    cardColor: {\n        type: String,\n        required: true,\n        default: '#cddc39'\n    },\n    isCompleted: {\n        type: Boolean,\n        required: true,\n        default: false\n    },\n    timestamps: {\n        createdOn: {\n            type: Date,\n            required: true,\n            default: Date.now\n        },\n        modifiedOn: {\n            type: Date,\n            required: true,\n            default: Date.now\n        },\n        completedOn: {\n            type: Date,\n            default: null\n        }\n    }\n}\n```\n#### End-Points\n| Method | End-Point | Description |\n| --- | --- | --- |\n| `GET` | `/todo` | List all *todos* |\n| `POST` | `/todo` | Create a new *todo* |\n| `GET` | `/todo/:id` | Fetch a specific *todo* |\n| `PUT` | `/todo/:id` | Edit existing *todo* |\n| `PATCH` | `/todo/:id` | Mark an existing *todo* as complete |\n| `DELETE` | `/todo/:id` | Delete existing *todo* |\n\n## Documentation\nhttps://documenter.getpostman.com/view/8474302/SVfGyBSu\n\n## Request \u0026 Response Examples\n\n### API Resources\n  - [GET /todo](#get-todo)\n  - [GET /todo/:todoId](#get-todotodoId)\n  - [POST /todo](#post-todo)\n  - [PUT /todo/:todoId](#put-todotodoId)\n  - [PATCH /todo/:todoId](#patch-todotodoId)\n  - [DELETE /todo/:todoId](#delete-todotodoId)\n\n### GET /todo\nTo get the list of all *todos*\n#### Resourse Url\n`http://localhost:3000/api/v1/todo`\n#### Request Params\n`N/A`\n#### Request Body\n`N/A`\n#### Response\n```javascript\n{\n    \"status\": \"Success\",\n    \"message\": \"Todos Fetched Successfully!\",\n    \"todos\": [\n        {\n            \"timestamps\": {\n                \"completedOn\": null,\n                \"createdOn\": \"2019-08-16T17:07:07.171Z\",\n                \"modifiedOn\": \"2019-08-16T17:07:07.171Z\"\n            },\n            \"description\": \"Write documentation for Todo API\",\n            \"cardColor\": \"#ff7043\",\n            \"isCompleted\": false,\n            \"_id\": \"5d56e2bbc2a36326a0a57c19\",\n            \"title\": \"Write Documentation\",\n            \"onDate\": \"2019-08-16T15:47:30.889Z\",\n            \"__v\": 0\n        },\n        {\n            \"timestamps\": {\n                \"completedOn\": null,\n                \"createdOn\": \"2019-08-16T17:08:48.376Z\",\n                \"modifiedOn\": \"2019-08-16T17:08:48.376Z\"\n            },\n            \"description\": \"Write Test-Cases for Todo API\",\n            \"cardColor\": \"#4dd0e1\",\n            \"isCompleted\": false,\n            \"_id\": \"5d56e320c2a36326a0a57c1a\",\n            \"title\": \"Write Test-Cases\",\n            \"onDate\": \"2019-08-16T15:47:30.889Z\",\n            \"__v\": 0\n        }\n    ],\n    \"todoCount\": 2\n}\n```\n\n### GET /todo/:todoId\nTo get a specific *todo*\n#### Resourse Url\n`http://localhost:3000/api/v1/todo/{{TODO_ID}}`\n#### Request Params\n`{{TODO_ID}}`\n#### Request Body\n`N/A`\n#### Response\n```javascript\n{\n    \"status\": \"Success\",\n    \"message\": \"Todo Fetched Successfully!\",\n    \"todo\": {\n        \"timestamps\": {\n            \"completedOn\": null,\n            \"createdOn\": \"2019-08-16T17:07:07.171Z\",\n            \"modifiedOn\": \"2019-08-16T17:07:07.171Z\"\n        },\n        \"description\": \"Write documentation for Todo API\",\n        \"cardColor\": \"#ff7043\",\n        \"isCompleted\": false,\n        \"_id\": \"5d56e2bbc2a36326a0a57c19\",\n        \"title\": \"Write Documentation\",\n        \"onDate\": \"2019-08-16T15:47:30.889Z\",\n        \"__v\": 0\n    }\n}\n```\n\n### POST /todo\nTo create a new *todo*\n#### Resourse Url\n`http://localhost:3000/api/v1/todo`\n#### Request Params\n`N/A`\n#### Request Body\n```javascript\n{\n    \"title\": \"Write Test-Cases\",\n    \"description\": \"Write Test-Cases for Todo API\",\n    \"onDate\": \"2019-08-16T15:47:30.889Z\",\n    \"cardColor\": \"#4dd0e1\"\n}\n```\n#### Response\n```javascript\n{\n    \"status\": \"Success\",\n    \"message\": \"Todo Created SuccessFully!\",\n    \"todo\": {\n        \"timestamps\": {\n            \"completedOn\": null,\n            \"createdOn\": \"2019-08-16T17:08:48.376Z\",\n            \"modifiedOn\": \"2019-08-16T17:08:48.376Z\"\n        },\n        \"description\": \"Write Test-Cases for Todo API\",\n        \"cardColor\": \"#4dd0e1\",\n        \"isCompleted\": false,\n        \"_id\": \"5d56e320c2a36326a0a57c1a\",\n        \"title\": \"Write Test-Cases\",\n        \"onDate\": \"2019-08-16T15:47:30.889Z\",\n        \"__v\": 0,\n        \"todoId\": \"5d56e320c2a36326a0a57c1a\"\n    }\n}\n```\n\n### PUT /todo/:todoId\nTo edit an existing *todo*\n#### Resourse Url\n`http://localhost:3000/api/v1/todo/{{TODO_ID}}`\n#### Request Params\n`{{TODO_ID}}`\n#### Request Body\n```javascript\n{\n    \"title\": \"UPDATED: Write Documentation\",\n    \"description\": \"UPDATED: Write documentation for Todo API\"\n}\n```\n#### Response\n```javascript\n{\n    \"status\": \"Success\",\n    \"message\": \"Todo Updated Successfully!\",\n    \"todo\": {\n        \"timestamps\": {\n            \"completedOn\": \"2019-08-16T18:10:33.224Z\",\n            \"createdOn\": \"2019-08-16T17:07:07.171Z\",\n            \"modifiedOn\": \"2019-08-16T18:14:13.499Z\"\n        },\n        \"description\": \"UPDATED: Write documentation for Todo API\",\n        \"cardColor\": \"#ff7043\",\n        \"isCompleted\": true,\n        \"_id\": \"5d56e2bbc2a36326a0a57c19\",\n        \"title\": \"UPDATED: Write Documentation\",\n        \"onDate\": \"2019-08-16T15:47:30.889Z\",\n        \"__v\": 0\n    }\n}\n```\n### PATCH /todo/:todoId\nTo mark a *todo* as Complete\n#### Resourse Url\n`http://localhost:3000/api/v1/todo/{{TODO_ID}}`\n#### Request Params\n`{{TODO_ID}}`\n#### Request Body\n`N/A`\n#### Response\n```javascript\n{\n    \"status\": \"Success\",\n    \"message\": \"Todo Marked as Completed!\",\n    \"todo\": {\n        \"timestamps\": {\n            \"completedOn\": \"2019-08-16T18:10:33.224Z\",\n            \"createdOn\": \"2019-08-16T17:07:07.171Z\",\n            \"modifiedOn\": \"2019-08-16T18:10:33.224Z\"\n        },\n        \"description\": \"Write documentation for Todo API\",\n        \"cardColor\": \"#ff7043\",\n        \"isCompleted\": true,\n        \"_id\": \"5d56e2bbc2a36326a0a57c19\",\n        \"title\": \"Write Documentation\",\n        \"onDate\": \"2019-08-16T15:47:30.889Z\",\n        \"__v\": 0\n    }\n}\n```\n\n### DELETE /todo/:todoId\nTo delete an existing *todo*\n#### Resourse Url\n`http://localhost:3000/api/v1/todo/{{TODO_ID}}`\n#### Request Params\n`{{TODO_ID}}`\n#### Request Body\n`N/A`\n#### Response\n```javascript\n{\n    \"status\": \"Success\",\n    \"message\": \"Todo Deleted Successfully!\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoslimarif%2Ftodo-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoslimarif%2Ftodo-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoslimarif%2Ftodo-api/lists"}