{"id":26714304,"url":"https://github.com/ngantrandev/todo-list-api","last_synced_at":"2026-04-14T14:32:24.583Z","repository":{"id":283594259,"uuid":"951109862","full_name":"ngantrandev/todo-list-api","owner":"ngantrandev","description":"A simple API for managing Todo List","archived":false,"fork":false,"pushed_at":"2025-03-21T03:25:13.000Z","size":173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T04:21:27.942Z","etag":null,"topics":["docker","expressjs","jwt","restful-api","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ngantrandev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-19T07:10:11.000Z","updated_at":"2025-03-21T03:49:18.000Z","dependencies_parsed_at":"2025-03-21T04:21:33.915Z","dependency_job_id":"ca5ad92e-3e64-4e54-8ef7-99d5af790426","html_url":"https://github.com/ngantrandev/todo-list-api","commit_stats":null,"previous_names":["ngantrandev/todo-list-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ngantrandev/todo-list-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngantrandev%2Ftodo-list-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngantrandev%2Ftodo-list-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngantrandev%2Ftodo-list-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngantrandev%2Ftodo-list-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngantrandev","download_url":"https://codeload.github.com/ngantrandev/todo-list-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngantrandev%2Ftodo-list-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31801317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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","expressjs","jwt","restful-api","typescript"],"created_at":"2025-03-27T13:19:07.993Z","updated_at":"2026-04-14T14:32:24.554Z","avatar_url":"https://github.com/ngantrandev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TODO LIST API\n\n- Plan: https://docs.google.com/document/d/1HzEkPgcPmaZr2aXNdBmNr2lR0lxgDbRHEJrFaxJjstc/edit?usp=sharing\n\n- Documents folder: database and postman collection\n\n## SUMMARY\n\n- [1. What is this project used for?](#1-what-is-this-project-used-for)\n- [2. What does this project can do?](#2-what-does-this-project-can-do)\n- [3. 🚀 What technologies does this project use?](#3-what-technologies-does-this-project-use)\n- [4. What is circular dependency?](#4-what-is-circular-dependency)\n  - [4.1. Definition](#41-definition)\n  - [4.2. How to detect it](#42-how-to-detect-it)\n- [5. How to run this project?](#5-how-to-run-this-project)\n  - [5.1. First method: with docker](#51-first-method-with-docker)\n  - [5.2. Second method: without docker](#52-second-method-without-docker)\n\n## 1. What is this project used for?\n\nThis project is a simple API for managing todo list.\n\n## 2. What does this project can do?\n\n- Create a new task\n- Update a task\n- Delete a task\n- Get all tasks\n- Get a task by id\n- Get all parent tasks of a task\n- Create / Delete a reference between tasks\n- Detect a circular dependency in tasks\n- Prevent circular dependency when adding new reference\n- Periodically check tasks that are about to expire and send email notifications \n\n## 3. 🚀 What technologies does this project use?\n\n- NodeJS\n- ExpressJS\n- MySQL\n- Redis\n- Nodemailer\n- JWT\n- Docker\n\n## 4. What is circular dependency?\n\n### 4.1. Definition\n\n- Firstly, you can see the image below describe how task reference each other\n- Each task can have multiple parent tasks and multiple child tasks\n\n- \u003ccode\u003eCircular dependency\u003c/code\u003e problem occurs when \u003ccode\u003eTask 3\u003c/code\u003e depends on \u003ccode\u003eTask 6\u003c/code\u003e and \u003ccode\u003eTask 6\u003c/code\u003e depends on \u003ccode\u003eTask 7\u003c/code\u003e and \u003ccode\u003eTask 7\u003c/code\u003e depends on \u003ccode\u003eTask 3\u003c/code\u003e and... We have now got a circular dependency.😒😒\n\n![circular-dependency](./documents//circular_dependency.png)\n\n### 4.2. How to detect it\n\n- Look at the image, we can see that like a graph, where each Node depends on other Nodes.\n- So, how to detect it? The idea is when a Node is seen, but it is not resolved yet, we can say that we have a circular dependency.\n- For example, we have a graph with path: **3 -\u003e 6 -\u003e 7 -\u003e 3**\n- Task 3 in the end of path is seen at the top, but it is not resolved yet, because of Task 3 depends on Task 6 and so on.\n\n**This is how we can detect it by Pseudocode**\n\n```bash\nfunction dep_resolve(node, visited, unFinished) {\n\n  unFinished.push(node);\n\n  for parentNode in node.parents {\n\n    if parentNode not in visited {\n      if parentNode in unFinished {\n\n        // we detected circular dependency here\n      }\n      dep_resolve(parentNode, visited, unFinished);\n    }\n  }\n  visited.push(node);\n  unFinished.remove(node);\n}\n\n// call function\n\ntype Node = {\n  id: number,\n  parents: Node[]\n}\n\nlet firstNode : Node = {\n  id: ...,\n  parents: [ ... ]\n}\n\ndep_resolve(firstNode, [], []);\n```\n\n## 5. How to run this project?\n\n### 5.1. First method: with docker\n\n- Clone this project\n- Create \u003ccode\u003e.env\u003c/code\u003e file in the root directory with following format\n\n```bash\n  APP_PORT= 8000\n\n  DB_HOST= localhost                     (OPTIONAL)\n  DB_PORT= 3306                          (OPTIONAL)\n  DB_USER= root                          (OPTIONAL)\n  DB_PASS= password                      (OPTIONAL)\n  DB_NAME= tododb                        (OPTIONAL)\n\n  REDIS_HOST= localhost                  (OPTIONAL)\n  REDIS_PORT= 5678                       (OPTIONAL)\n  REDIS_PASSWORD= password               (OPTIONAL)\n\n  JWT_SECRET_KEY=secret\n  ACCESS_TOKEN_EXPIRES_IN=1d\n\n  EMAIL_USER = your@gmail.com            (OPTIONAL)\n  EMAIL_PASS = 'umtj jklmn mvtg wrnz'    (OPTIONAL)\n  EMAIL_HOST = gmail                     (OPTIONAL)\n```\n\n- Run the following command:\n\n```bash\n  docker-compose up --build\n```\n\n### 5.2. Second method: without docker\n\n- Clone this project\n- Create \u003ccode\u003e.env\u003c/code\u003e file in the root directory with following format\n\n```bash\n  APP_PORT= 8000\n\n  DB_HOST= localhost\n  DB_PORT= 3306\n  DB_USER= root\n  DB_PASS= password\n  DB_NAME= tododb\n\n  REDIS_HOST= localhost\n  REDIS_PORT= 5678\n  REDIS_PASSWORD= password\n\n  JWT_SECRET_KEY=secret\n  ACCESS_TOKEN_EXPIRES_IN=1d\n\n  EMAIL_USER = your@gmail.com\n  EMAIL_PASS = 'umtj jklmn mvtg wrnz'\n  EMAIL_HOST = gmail\n```\n\n- Run the following command:\n\nStep 1: Install dependencies\n\n```bash\n  npm install\n```\n\nStep 2: Run project\n\nOption 1:\n\n```bash\n  npm run dev    # for development\n```\n\nOption 2:\n\n```bash\n  npm run build  # for build\n  npm run start  # for run bundle code\n```\n\n[✨ Made by NodeJS with ❤️](https://github.com/ngantrandev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngantrandev%2Ftodo-list-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngantrandev%2Ftodo-list-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngantrandev%2Ftodo-list-api/lists"}