{"id":19560898,"url":"https://github.com/tsoliangwu0130/todo-list-api","last_synced_at":"2026-04-11T09:05:28.963Z","repository":{"id":92493016,"uuid":"96043156","full_name":"tsoliangwu0130/todo-list-api","owner":"tsoliangwu0130","description":"A Node.js to-do list RESTful API with security and authentication supported.","archived":false,"fork":false,"pushed_at":"2017-08-28T15:03:04.000Z","size":43,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T08:43:19.398Z","etag":null,"topics":["docker","docker-compose","express","jwt","mocha","mongodb","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsoliangwu0130.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-02T19:00:42.000Z","updated_at":"2018-04-05T21:04:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebccd6c1-2924-425f-8050-177a96aad986","html_url":"https://github.com/tsoliangwu0130/todo-list-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsoliangwu0130/todo-list-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoliangwu0130%2Ftodo-list-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoliangwu0130%2Ftodo-list-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoliangwu0130%2Ftodo-list-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoliangwu0130%2Ftodo-list-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsoliangwu0130","download_url":"https://codeload.github.com/tsoliangwu0130/todo-list-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoliangwu0130%2Ftodo-list-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31674624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","docker-compose","express","jwt","mocha","mongodb","nodejs","rest-api"],"created_at":"2024-11-11T05:09:05.403Z","updated_at":"2026-04-11T09:05:28.947Z","avatar_url":"https://github.com/tsoliangwu0130.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# To-do List API [![Build Status](https://travis-ci.org/tsoliangwu0130/todo-list-api.svg?branch=master)](https://travis-ci.org/tsoliangwu0130/todo-list-api) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nA [Node.js](https://nodejs.org/en/) to-do list RESTful API with security and authentication supported.\n\n## Prerequisite\n\n### MongoDB\n\nYou'll need to run [MongoDB](https://www.mongodb.com/) on your machine in order to support CRUD operations for this API. Simply install MongoDB with [Homebrew](https://brew.sh/):\n\n```\n$ brew install mongodb\n```\n\nThen run MongoDB with [mongod](https://docs.mongodb.com/manual/reference/program/mongod/#bin.mongod) process:\n\n```\n$ mongod --dbpath ~/data/db\n```\n\n### Configuration\n\nYou'll also need to create a `config.json` file to setup the environment and place it under `server/config/`. The following is a simple example of `config.json`:\n\n```json\n{\n  \"test\": {\n    \"PORT\": 3000,\n    \"MONGODB_URI\": \"mongodb://localhost:27017/TodoAppTest\",\n    \"JWT_SECRET\": \"jwtsecret\"\n  },\n  \"development\": {\n    \"PORT\": 3000,\n    \"MONGODB_URI\": \"mongodb://localhost:27017/TodoApp\",\n    \"JWT_SECRET\": \"jwtsecret\"\n  }\n}\n```\n\n## Usage\n\nTo install app dependencies, simply run:\n\n```\n$ npm install\n```\n\nStart the app at [localhost:3000](http://localhost:3000):\n\n```\n$ npm start\n```\n\n## Docker Compose\n\nYou can also run this app in [Docker](https://www.docker.com/) containers with [Docker Compose](https://docs.docker.com/compose/). To do so, just ensure you have `docker` and `docker-compose` installed and have the `config.json` file prepared, then simply run:\n\n```\n$ docker-compose up\n```\n\n## Resources\n\n### todos\n\nThe following sections are all supported operations for todos resource.\n\n#### GET /todos\n\nRetrieve all todos for the same user with `x-auth` token.\n\n```\nGET /todos HTTP/1.1\nx-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTY5MWM4MDJkODIxYmExNTU3YjczZTciLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTAwMDYwODAwfQ.af2PQl2HMduHU3FeXFMjxTShO97l1QYAclvweh5lBsc\n```\n\n```\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 327\nContent-Type: application/json; charset=utf-8\nDate: Fri, 14 Jul 2017 19:58:44 GMT\nETag: W/\"147-iRd3m2buVy9hAeukGKbirv8+2qE\"\nX-Powered-By: Express\n\n{\n    \"todos\": [\n        {\n            \"_id\": \"596921872d821ba1557b73ea\",\n            \"text\": \"Something to do from Postman\",\n            \"_creator\": \"59691c802d821ba1557b73e7\",\n            \"__v\": 0,\n            \"completedAt\": null,\n            \"completed\": false\n        },\n        {\n            \"_id\": \"596922362d821ba1557b73eb\",\n            \"text\": \"Another thing to do from Postman\",\n            \"_creator\": \"59691c802d821ba1557b73e7\",\n            \"__v\": 0,\n            \"completedAt\": null,\n            \"completed\": false\n        }\n    ]\n}\n```\n\n#### GET /todos/:id\n\nRetrieve one specific todo with todo's unique ID and `x-auth` token.\n\n```\nGET /todos/596921872d821ba1557b73ea HTTP/1.1\nx-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTY5MWM4MDJkODIxYmExNTU3YjczZTciLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTAwMDYwODAwfQ.af2PQl2HMduHU3FeXFMjxTShO97l1QYAclvweh5lBsc\n```\n\n```\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 164\nContent-Type: application/json; charset=utf-8\nDate: Fri, 14 Jul 2017 20:01:44 GMT\nETag: W/\"a4-DaODaXXlg9LzU2j5ykmjVxLzdQs\"\nX-Powered-By: Express\n\n\"todo\": {\n    \"_id\": \"596921872d821ba1557b73ea\",\n    \"text\": \"Something to do from Postman\",\n    \"_creator\": \"59691c802d821ba1557b73e7\",\n    \"__v\": 0,\n    \"completedAt\": null,\n    \"completed\": false\n}\n```\n\n#### POST /todos\n\nCreate a new todo with `x-auth` token.\n\n```\nPOST /todos HTTP/1.1\nContent-Type: application/json\nx-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTY5MWM4MDJkODIxYmExNTU3YjczZTciLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTAwMDYwODAwfQ.af2PQl2HMduHU3FeXFMjxTShO97l1QYAclvweh5lBsc\n\n{\n  \"text\": \"Something to do from Postman\"\n}\n```\n\n```\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 155\nContent-Type: application/json; charset=utf-8\nDate: Fri, 14 Jul 2017 19:54:47 GMT\nETag: W/\"9b-/Cw9g9LnPK/vccqDh4CDbsKF6/g\"\nX-Powered-By: Express\n\n{\n    \"__v\": 0,\n    \"text\": \"Something to do from Postman\",\n    \"_creator\": \"59691c802d821ba1557b73e7\",\n    \"_id\": \"596921872d821ba1557b73ea\",\n    \"completedAt\": null,\n    \"completed\": false\n}\n```\n\n#### PATCH /todos/:id\n\nUpdate an existed todo with `x-auth` token.\n\n```\nPATCH /todos/596921872d821ba1557b73ea HTTP/1.1\nContent-Type: application/json\nx-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTY5MWM4MDJkODIxYmExNTU3YjczZTciLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTAwMDYwODAwfQ.af2PQl2HMduHU3FeXFMjxTShO97l1QYAclvweh5lBsc\n\n{\n  \"text\": \"Update something to do from Postman\"\n}\n```\n\n```\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 171\nContent-Type: application/json; charset=utf-8\nDate: Fri, 14 Jul 2017 20:05:01 GMT\nETag: W/\"ab-BNMBZIQUdHOHuFYjlMapv2Aln0g\"\nX-Powered-By: Express\n\n{\n    \"todo\": {\n        \"_id\": \"596921872d821ba1557b73ea\",\n        \"text\": \"Update something to do from Postman\",\n        \"_creator\": \"59691c802d821ba1557b73e7\",\n        \"__v\": 0,\n        \"completedAt\": null,\n        \"completed\": false\n    }\n}\n```\n\n#### DELETE /todos/:id\n\nDelete an existed todo with `x-auth` token.\n\n```\nDELETE /todos/596921872d821ba1557b73ea HTTP/1.1\nx-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTY5MWM4MDJkODIxYmExNTU3YjczZTciLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTAwMDYwODAwfQ.af2PQl2HMduHU3FeXFMjxTShO97l1QYAclvweh5lBsc\n```\n\n```\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 171\nContent-Type: application/json; charset=utf-8\nDate: Fri, 14 Jul 2017 20:09:11 GMT\nETag: W/\"ab-BNMBZIQUdHOHuFYjlMapv2Aln0g\"\nX-Powered-By: Express\n\n{\n    \"todo\": {\n        \"_id\": \"596921872d821ba1557b73ea\",\n        \"text\": \"Update something to do from Postman\",\n        \"_creator\": \"59691c802d821ba1557b73e7\",\n        \"__v\": 0,\n        \"completedAt\": null,\n        \"completed\": false\n    }\n}\n```\n\n### users\n\nThe following sections are all supported operations for users resource.\n\n#### GET /users/me\n\nRetrieve user information with `x-auth` token.\n\n```\nGET /users/me HTTP/1.1\nx-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTY5MWM4MDJkODIxYmExNTU3YjczZTciLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTAwMDYxNDI2fQ.P7FAUrarx_DWHmNs68weR4Y27_5afuoeDztVRY_GDAg\n```\n\n```\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 69\nContent-Type: application/json; charset=utf-8\nDate: Fri, 14 Jul 2017 19:46:50 GMT\nETag: W/\"45-dUoPLW+UATlB6Fe/8Qblx7oi9CY\"\nX-Powered-By: Express\n\n{\n    \"_id\": \"59691c802d821ba1557b73e7\",\n    \"email\": \"tsoliangwu0130@gmail.com\"\n}\n```\n\n#### POST /users\n\nCreate a new user and login.\n\n```\nPOST /users HTTP/1.1\nContent-Type: application/json\n\n{\n  \"email\": \"tsoliangwu0130@gmail.com\",\n  \"password\": \"password!\"\n}\n```\n\n```\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 69\nContent-Type: application/json; charset=utf-8\nDate: Fri, 14 Jul 2017 19:33:20 GMT\nETag: W/\"45-dUoPLW+UATlB6Fe/8Qblx7oi9CY\"\nX-Powered-By: Express\nx-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTY5MWM4MDJkODIxYmExNTU3YjczZTciLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTAwMDYwODAwfQ.af2PQl2HMduHU3FeXFMjxTShO97l1QYAclvweh5lBsc\n\n{\n    \"_id\": \"59691c802d821ba1557b73e7\",\n    \"email\": \"tsoliangwu0130@gmail.com\"\n}\n```\n\n#### POST /users/login\n\nLogin an existed user with email and password.\n\n```\nPOST /users/login HTTP/1.1\nContent-Type: application/json\n\n{\n  \"email\": \"tsoliangwu0130@gmail.com\",\n  \"password\": \"password!\"\n}\n```\n\n```\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 69\nContent-Type: application/json; charset=utf-8\nDate: Fri, 14 Jul 2017 19:43:46 GMT\nETag: W/\"45-dUoPLW+UATlB6Fe/8Qblx7oi9CY\"\nX-Powered-By: Express\nx-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTY5MWM4MDJkODIxYmExNTU3YjczZTciLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTAwMDYxNDI2fQ.P7FAUrarx_DWHmNs68weR4Y27_5afuoeDztVRY_GDAg\n\n{\n    \"_id\": \"59691c802d821ba1557b73e7\",\n    \"email\": \"tsoliangwu0130@gmail.com\"\n}\n```\n\n#### DELETE /users/me/token\n\nLog out the current user with `x-auth` token.\n\n```\nDELETE /users/me/token HTTP/1.1\nx-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1OTY5MWM4MDJkODIxYmExNTU3YjczZTciLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTAwMDYxNDI2fQ.P7FAUrarx_DWHmNs68weR4Y27_5afuoeDztVRY_GDAg\n```\n\n```\nHTTP/1.1 200 OK\nConnection: keep-alive\nContent-Length: 0\nDate: Fri, 14 Jul 2017 19:50:57 GMT\nX-Powered-By: Express\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsoliangwu0130%2Ftodo-list-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsoliangwu0130%2Ftodo-list-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsoliangwu0130%2Ftodo-list-api/lists"}