{"id":20417663,"url":"https://github.com/serhiinikif/todo-list-express","last_synced_at":"2026-04-15T05:31:28.649Z","repository":{"id":159876546,"uuid":"616513033","full_name":"SerhiiNikif/todo-list-express","owner":"SerhiiNikif","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-25T13:12:35.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-05T12:40:27.182Z","etag":null,"topics":["bcrypt","cors","docker-compose","dotenv","error-handling","expressjs","joi","jwt","middleware","mocha-chai","mongoose","nodejs","openapi3","rest-api","swagger-ui","typescript","yml"],"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/SerhiiNikif.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}},"created_at":"2023-03-20T14:32:14.000Z","updated_at":"2023-08-28T06:21:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"ffa5d8bd-cc4a-4629-951b-773e9ef8ce0c","html_url":"https://github.com/SerhiiNikif/todo-list-express","commit_stats":null,"previous_names":["serhiinikif/todo-list-swagger-docker","serhiinikif/todo-list-express","serhiinikif/node-rest-api-swagger-docker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SerhiiNikif/todo-list-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerhiiNikif%2Ftodo-list-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerhiiNikif%2Ftodo-list-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerhiiNikif%2Ftodo-list-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerhiiNikif%2Ftodo-list-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SerhiiNikif","download_url":"https://codeload.github.com/SerhiiNikif/todo-list-express/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerhiiNikif%2Ftodo-list-express/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31828530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bcrypt","cors","docker-compose","dotenv","error-handling","expressjs","joi","jwt","middleware","mocha-chai","mongoose","nodejs","openapi3","rest-api","swagger-ui","typescript","yml"],"created_at":"2024-11-15T06:26:39.593Z","updated_at":"2026-04-15T05:31:28.631Z","avatar_url":"https://github.com/SerhiiNikif.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# todo-list-express\n\nThis is a restful-api for two types of users - `ADMIN`, `USER`. Two models are implemented: users and to-do lists. You can register/login. You can also reset your passwor, after which you will receive an email. After logging in, each user can create to-do lists. A usual user can perform CRUD operations on their profile and only for their to-do lists, an administrator can perform CRUD operations on any users and to-do lists.\n# Knowledge Cover\n\n- Node.js (Express.js)\n- TypeScript\n- SOA\n- Rest API\n- MongoDB \u0026 Mongoose\n- CRUD Operation\n- API documentation on Swagger\n- APIs Authorization (JWT)\n- Reset password (Nodemailer gmail)\n- CORS\n- Field validation\n- Error handling\n- Mocha, Chai\n- Docker\n\n# How to use\n\n## 1. Clone Project into your local machine\n```\ngit clone https://github.com/SerhiiNikif/todo-list-express.git\n```\n\n## 2. Go into project folder\n\n```\ncd todo-list-express\n```\n\n## 3. Setting environment file .env.\nCreate an `.env` file in the root of the project and fill it with the values ​​from the `.env.sample` file.\n\n```\nMONGO_LOCAL_URI=mongodb://localhost:27017/db\nMONGO_LOCAL_PORT=27017\nNODE_LOCAL_PORT=3000\n\nMONGO_DOCKER_URI=mongodb://mongo:27017/node-app\nMONGO_DOCKER_PORT=27017\nNODE_DOCKER_PORT=4000\n\nJWT_SECRET=SECRET_VALUE\nBCRYPT_SALT=10\nEMAIL_HOST=smtp.gmail.com\nEMAIL=your_email\nGOOGLE_GEN_PASSWORD=your_google_app_password\nFROM_EMAIL=your_email\nTEXT_FOR_EMAIL=The text of the letter itself\n```\n\n## 4. Start project\n\u003e #### Docker need to be installed in your OS. To install Docker, please click [here](https://docs.docker.com/get-docker/).\nDevelopment:\n```\nnpm run docker-compose-up:dev\n```\nProduction:\n```\nnpm run docker-compose-up:prod\n```\n\n## 5. Play with APIs now !\nNow, you are ready to test all APIs.\nJust simply open your browser http://localhost:3000/api-docs.\n\n\n\n## 6. Use app locally:\n\u003e #### Please make sure you have followed Step 1 ~ Step 3 as above.\nPlease make sure mongoDB Server service is installed and running on your localhost:27017.\n\n```\nnpm install\n```\n\n```\nnpm run dev-local\n```\nOpen your browser http://localhost:3000/api-docs.\n\n\n## 7. Test project\n\n```\nnpm run test\n```\n\n# Access rights\n\nAPIs implement access logic for `ADMIN` and `USER` [roles](#table)\n\n# APIs Authorization\n\n\u003e All APIs are protected by accessToken (JWT).\n\n## When calling these protected APIs, make sure you add %BearerToken% in `Authorization` request Header.\n\n```\nAuthorization: Bearer \u003caccessToken\u003e\n```\n\n## How to get accessToken ?\n\nWhen user login sucessfully, an unique accessToken will be returned.\n\n# Available APIs\n\n## Auth\n\u003e When creating a user, we specify a role and this gives us access to certain APIs.\n\n| APIs                           | Method |         Desc                                    |\n| -------------------------------| :----: | :---------------------------------------------: |\n| /api/auth/registration         |  POST  | Register user account                           |\n| /api/auth/login                |  POST  |      User Login                                 |\n| /api/auth/requestResetPassword |  POST  | Password reset request, send an email to gmail  |\n| /api/auth/resetPassword        |  POST  | Password reset, send an email to gmail          |\n\n\u003ca id=\"table\"\u003e\u003c/a\u003e\n## APIs for the ADMIN role\n\n| APIs                 | Method  |         Desc           |\n| -------------------- | :-----: | ---------------------- |\n| /api/users/          |  GET    | Get all users          |\n| /api/users/          |  POST   | Create a new user      |\n| /api/users/{userID}  |  GET    | Get a user by ID       |\n| /api/users/{userID}  |  PATCH  | Update a user by ID    |\n| /api/users/{userID}  |  DELETE | Delete a user by ID    |\n\n| APIs                 | Method  |         Desc           |\n| -------------------- | :-----: | ---------------------- |\n| /api/todos/          |  GET    | Get all todos          |\n| /api/todos/          |  POST   | Create a new todo      |\n| /api/todos/{todoID}  |  GET    | Get a todo by ID       |\n| /api/todos/{todoID}  |  PATCH  | Update a todo by ID    |\n| /api/todos/{todoID}  |  DELETE | Delete a todo by ID    |\n\n## APIs for the USER role\n\n| APIs                 | Method  |         Desc                     |\n| -------------------- | :-----: | -------------------------------- |\n| /api/users/          |  GET    | Get the logged in user           |\n| /api/users/{userID}  |  PATCH  | Update the logged in user by ID  |\n\n\u003e For this role, the user can only work with those todos that he __himself__ created.\n\n| APIs                 | Method  |         Desc        |\n| -------------------- | :-----: | ------------------- |\n| /api/todos/          |  GET    | Get all todos       |\n| /api/todos/          |  POST   | Create a new todo   |\n| /api/todos/{todoID}  |  GET    | Get a todo by ID    |\n| /api/todos/{todoID}  |  PATCH  | Update a todo by ID |\n| /api/todos/{todoID}  |  DELETE | Delete a todo by ID |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserhiinikif%2Ftodo-list-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserhiinikif%2Ftodo-list-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserhiinikif%2Ftodo-list-express/lists"}