{"id":22542566,"url":"https://github.com/devawal/api","last_synced_at":"2025-03-28T07:43:46.978Z","repository":{"id":42951143,"uuid":"214668347","full_name":"devawal/api","owner":"devawal","description":"A simple Lumen based lightweight task management application with simple UI and API endpoint","archived":false,"fork":false,"pushed_at":"2022-03-26T00:55:28.000Z","size":74,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T08:29:39.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/devawal.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-10-12T15:16:51.000Z","updated_at":"2019-10-15T19:06:44.000Z","dependencies_parsed_at":"2022-08-23T20:11:26.721Z","dependency_job_id":null,"html_url":"https://github.com/devawal/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/devawal%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devawal%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devawal%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devawal%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devawal","download_url":"https://codeload.github.com/devawal/api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991561,"owners_count":20706126,"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":[],"created_at":"2024-12-07T13:11:08.845Z","updated_at":"2025-03-28T07:43:46.954Z","avatar_url":"https://github.com/devawal.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Task Management Application\n\nA simple Lumen based lightweight task management application with simple UI and API endpoint. Each task can have subtasks and tasks without subtasks have points. That means parent task has a sum of points from subtasks. What is more, if all subtasks of a task are done, then task also is done. If at least one subtask of a task marked as not done then it also becomes not done.\n\n## About this application\n\n1. The application is using PHP Lumen framework;\n2. The application have a simple UI and required API endpoints;\n3. It is follow PSR-2 style guide;\n4. The Application is written in OOP;\n5. The code in simple and clean;\n6. The code is tested in PHPUnit test.\n\n## Environment setup\n\nFirst clone this repository by using `git clone https://github.com/devawal/api.git`\nAnd run `composer install`\n\n## Third party dependencies\n\n1. PHP Unit is used for unit testing.\n2. [PHP Coding Standards Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) is usse for maintain `PSR-2` coding standerd\n\n## Database\n\nThe application is using `MySQL` database and use default connection settings. To connect and create table at first create a database with a name and configure it in `.env` file. In this application I used `tasks_management`.\nRun the migration command by typing console command `php artisan migrate:install` it will create migration table then run `php artisan migrate` to install the migration in the database.\n\n## User data source\n\nThe application is using users from the following link\n`https://gitlab.iterato.lt/snippets/3/raw`\n\nThe URL can be updated from `App\\Http\\Controllers\\TasksController` in \n\n```\n/**\n * The user data source URL.\n *\n * @var string\n */\nprotected $userSource = 'https://gitlab.iterato.lt/snippets/3/raw';\n\n```\n\n## Create task\n\nEnd point for create task is: `http://your_host/api/task` which accept HTTP `POST` request whth the following input parameters\n\n### Input data\n```\n{\n\t\"parent_id\":null,\n\t\"user_id\":1,\n\t\"title\":\"Task 1\",\n\t\"points\":5,\n\t\"is_done\":1,\n\t\"email\":\"john.doe@email.com\"\n}\n``` \n\n### Output\n\nThe application API will return `201` status code if it passed all validations otherwise it will throw `400` status code with validation message\n\n```\n{\n    \"parent_id\": null,\n    \"user_id\": 2,\n    \"title\": \"Task 1\",\n    \"points\": 5,\n    \"is_done\": 1,\n    \"created_at\": \"2019-10-12 14:34:15\",\n    \"updated_at\": \"2019-10-12 14:34:15\",\n    \"id\": 1\n}\n```\n\n## Update task\n\nEnd point for update task is: `http://your_host/api/task/{task_id}` which accept HTTP `PUT` request with the following input parameters\n\n### Input data\n```\n{\n\t\"parent_id\":null,\n\t\"user_id\":2,\n\t\"title\":\"Task 1\",\n\t\"points\":10,\n\t\"is_done\":1,\n\t\"email\":\"john.doe@email.com\"\n}\n```\n\n### Output\n\nThe application API will return `201` status code if it passed all validations otherwise it will throw `400` status code with validation message\n\nAll other internal errors will return `500` with error message\n\n## View task list\n\nEnd point for all task: `http://your_host/tasks`\n\n# Testing\n\nThe application is tested with random data set using `faker`. For Unit test following is the command `./vendor/bin/phpunit`\n\nTest class `tests\\TasksTest`\nTest configuration file `phpunit.xml`\n\n## Test output from windows\n```\n$ ./vendor/bin/phpunit\nPHPUnit 6.5.14 by Sebastian Bergmann and contributors.\n\n..                                                                  2 / 2 (100%)\n\nTime: 1.83 seconds, Memory: 10.00MB\n\nOK (2 tests, 2 assertions)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevawal%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevawal%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevawal%2Fapi/lists"}