{"id":20581230,"url":"https://github.com/jonathas/todo-api","last_synced_at":"2025-04-14T19:52:04.505Z","repository":{"id":141968391,"uuid":"96017330","full_name":"jonathas/todo-api","owner":"jonathas","description":":calendar: A TODO list API in Node.js","archived":false,"fork":false,"pushed_at":"2023-01-07T13:17:24.000Z","size":440,"stargazers_count":34,"open_issues_count":0,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T08:11:41.389Z","etag":null,"topics":["docker","javascript","mocha","mongodb","nodejs","todo","todolist","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathas.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-02T10:53:39.000Z","updated_at":"2024-08-29T17:21:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"54d74e43-3f71-44c0-b1a7-41894a994ad7","html_url":"https://github.com/jonathas/todo-api","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/jonathas%2Ftodo-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathas%2Ftodo-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathas%2Ftodo-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathas%2Ftodo-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathas","download_url":"https://codeload.github.com/jonathas/todo-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248951807,"owners_count":21188419,"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":["docker","javascript","mocha","mongodb","nodejs","todo","todolist","typescript"],"created_at":"2024-11-16T06:27:32.435Z","updated_at":"2025-04-14T19:52:04.495Z","avatar_url":"https://github.com/jonathas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TODO List API\n\n[![Build Status](https://travis-ci.org/jonathas/todo-api.svg?branch=master)](https://travis-ci.org/jonathas/todo-api) [![Coverage Status](https://coveralls.io/repos/github/jonathas/todo-api/badge.svg?branch=master)](https://coveralls.io/github/jonathas/todo-api?branch=master)\n\n## Disclaimer (January of 2023)\n\nI've implemented this example in 2017, when API development was very different from today.\nNow in the beginning of 2023 I thought about updating it but then decided to keep it as it is for historical reasons and because there are just way too many things I'd change, so it would be better to start a similar project from scratch.\n\nLet me list below what I would do different if this was done today:\n\n- Use swagger (documentation in a json file) instead of apidoc\n- Follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.2/#summary) for writing the commit messages\n- Versioning done with the help of [release-it](https://www.npmjs.com/package/release-it)\n- Drop gulp and use only typescript instead.\n- jest instead of mocha for the tests\n- jest instead of istanbul for code coverage\n- fastify instead of express\n- eslint instead of tslint\n- Enforce proper rules with eslint. [Example here](https://gist.github.com/jonathas/c6b5f110e1eaf92d94ac976a19a3a178)\n- nodemon is not needed anymore\n- bluebird is not needed anymore\n- pino instead of winston\n\nTruth be told, nowadays I'd recommend to start an API in Node.js using [Nest](https://nestjs.com/), which already gives you a well implemented architecture to start your project with. So I might be creating a similar project soon, but using Nest instead, and then we can compare the differences.\n\n## Intro\n\nThis is a todo list API I decided to develop in order to show a little bit of what I can currently do with Node.js and related technologies.\n\nHere I'm using Node.js with Express, TypeScript, MongoDB and Docker.\n\n## Documentation - Avaliable endpoints\n\nCurrently there's a Task controller with all the possible operations and some endpoints related to it.\nIn order to see which endpoints are available, you need to have gulp installed:\n\n```bash\n$ npm i -g gulp\n$ cd api \u0026\u0026 gulp apidoc\n```\n\nThis will generate the documentation for the API inside docs/apidoc.\n\n## Running the infrastructure with Docker\n\nInstall [Docker](https://www.docker.com/) and docker-compose. If you use Windows, click on the icon that will appear on your tray and [enable Shared Drives](https://docs.docker.com/docker-for-windows/#general).\n\nEnter the api directory and run:\n```bash\n$ yarn install \u0026\u0026 gulp\n```\n\nThen go back to the root of the project, enter the infra directory and:\n```bash\n$ docker-compose up\n```\n\nThis will use the docker-compose.yml file inside the infra directory to download and prepare what is needed to run the API.\nIt uses Nginx as reverse proxy on port 80 that sits in front of the Node server, pm2 as process manager for Node.js and MongoDB as the database, so we have 3 Docker containers.\n\nIf you need to run pm2 in development mode so it reloads after every code change, run instead:\n\n```bash\n$ docker-compose -f docker-dev.yml up\n```\n\n## Testing and checking code coverage report\n\nIn order to test, you need to have the packages installed and infra running (previous step).\n\nAfter that is done, run the following command:\n```bash\n$ npm test\n```\n\nThis command will use gulp to transpile the typescript files to the api/bin directory, then mocha to run the tests and istanbul to generate the code coverage report.\nAfter all is done, you will find the report inside api/coverage/lcov-report/index.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathas%2Ftodo-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathas%2Ftodo-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathas%2Ftodo-api/lists"}