- Please install composer and make its installation global. Read here
- To install laravel, run in a shell
composer global require laravel/installer - Read about setting composer vendor bin as global here. This will also be a helper on how to install Laravel.
- Clone this repo
git clone https://github.com/TipsByPullak/basic_task_manager - cd into this repo
cd basic_task_managerand runphp artisan serve - See the API Endpoints section at the end for reference.
Run the following commands-
git clone https://github.com/TipsByPullak/basic_task_managergit checkout -b add_docker origin/add_dockercp .env.example .env
Now, set up the relevant variables in .env file. Make sure thatDB_HOSTis set asdb. You may need to customiseDockerfileanddocker-compose.yamlto suit your needs.
Now, run the following commands-docker-compose builddocker-compose up -d
This will set up all relevant containers in your docker. The API is now accessible at http://0.0.0.0:8009. (The default port is 8009 and hostIP is 0.0.0.0, you might have changed it).
You can administrate the database using phpMyAdmin at http://0.0.0.0:8090
POST /teamsrequest:
{
"name":"Platform",
}
response:
{
"id":"b7f32a21-b863-4dd1-bd86-e99e8961ffc6",
"name": "Platform",
}
id should be uuid,name should be stringGET /teams/:idresponse:
{
"id":"b7f32a21-b863-4dd1-bd86-e99e8961ffc6",
"name": "Platform"
}POST /teams/:id/memberrequest:
{
"name": "Vv",
"email": "venkat.v@razorpay.com"
}
Response:
{
"id": "b7f32a21-b863-4dd1-bd86-e99e8961ffc6",
"name": "Vv",
"email": "venkat.v@razorpay.com"
}
In case email is already associated with someone in the team, throw an error message saying"Email already associated with a team member"DELETE /teams/:id/members/:id2response:HTTP 204 No ContentIn case there are tasks assigned to the member, show a message saying:"Member cannot be deleted, please reassign all tasks from this member to someone else before trying again"POST /teams/:id/tasksrequest:
{
"title": "Deploy app on stage", //mandatory"description" : "We have built a new app which needs to be tested thoroughly", //optional"assignee_id": "some member id from the same team", // optional "status": "todo"
}
response:
{
"id": "2a913e52-81ea-4987-874d-820969a62ea6",
"title": "Deploy app on stage", //mandatory"description" : "We have built a new app which needs to be tested thoroughly", //optional"assignee_id": "some member id from the same team", // optional"status": "todo" }
assignee_id should belong to the same team as the task. Else raise an errorStatus can be todo or doneGET /teams/:id/tasks/:id2response:
{
"id": "2a913e52-81ea-4987-874d-820969a62ea6",
"title": "Deploy app on stage", //mandatory"description" : "We have built a new app which needs to be tested thoroughly", //optional"assignee_id": "some member id from the same team", // optional"status": "todo" }PATCH /teams/:id/tasks/:id2request:
{
"title": "Deploy app on preprod",//optional"description":"new description",//optional"assignee_id": "745dbe00-2520-420a-985d-0c3f5d280e57",//optional"status": "done"
}
response:
{
"id": "2a913e52-81ea-4987-874d-820969a62ea6",
"title": "Deploy app on preprod",//optional"description":"new description",//optional"assignee_id": "745dbe00-2520-420a-985d-0c3f5d280e57",
"status": "done"
}
assignee_id should belong to the same team as the task. Else raise an errorStatus can be todo or doneGET /teams/:id/tasks/response:
[
{
"id": "2a913e52-81ea-4987-874d-820969a62ea6",
"title": "Deploy app on preprod",//optional"description":"new description",//optional"assignee_id": "745dbe00-2520-420a-985d-0c3f5d280e57",
"status": "todo"
},
]
List of all tasks for a team in todo statusGET /teams/:id/members/:id2/tasks/response:
[
{
"id": "2a913e52-81ea-4987-874d-820969a62ea6",
"title": "Deploy app on preprod",//optional"description":"new description",//optional"assignee_id": "745dbe00-2520-420a-985d-0c3f5d280e57",
"status": "todo"
},
]
List of all tasks for a member in the team in todo status