Skip to content

m4salah/task-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task-tracker

This is a Dockerized Task-tracker app, using PHP / Laravel

  • PHP version:- 8.1.6

  • Laravel version:- 9.19

Dependencies

  • a clone of this repo on your machine
  • Docker

Run the app in your machine: -

  • clone the project and setup the env file
git clone https://github.com/mohamedspicer/task-tracker
cd task-tracker
  • rename the .env-example to .env and edit the environment variable as you like

  • run the docker-compose

docker-compose up -d

Services

  • the application
  • mysql

API Endpoints

Default Path

/api/v1/

GET /

Verifies that application is up and running.

Sample response
{
    "status": 1, 
    "message": "Task-Tracker is runnig",
    "data": null 
}

User related Endpoints

POST

/user/register

Creates a new user by register.

Sample body request (required)
{
    "email": "test123@test.com",
    "password": "1234567",
    "password_confirmation": "1234567",
    "is_admin": 1,
    "name": "Test User"
}
Sample response
{
    "status": 1,
    "message": "User Registers succefully",
    "data": {
        "user": {
            "email": "test123@test.com",
            "is_admin": 1,
            "name": "Test User",
            "updated_at": "2022-08-28T17:42:58.000000Z",
            "created_at": "2022-08-28T17:42:58.000000Z",
            "id": 2
        },
        "token": "3|4I88V1vcMdOJy9J7EybXMsinXfWLqX0ytkGEvRsf"
    }
}

POST

/user/login

user login and retrieve token.

Sample body request (required)
{
    "email": "test123@test.com",
    "password": "1234567",
}
Sample response
{
    "status": 1,
    "message": "User Logged",
    "data": {
        "user": {
            "id": 1,
            "name": "Mohamed",
            "email": "test123@com.com",
            "email_verified_at": null,
            "created_at": "2022-08-28T16:49:21.000000Z",
            "updated_at": "2022-08-28T16:49:21.000000Z",
            "is_admin": 0
        },
        "api_token": "6|dAYhLX3HNNNFr5KUSUCFfNDXUkNbst04r9pb2iV2"
    }
}

GET

/user/logout

user logout and revoke his tokens.

Sample response
{
    "status": 1,
    "message": "Logout successfully",
    "data": null
}

Project related Endpoints

GET

/projects/all

Displays all projects that admin created (Allowed for admins only)

Sample response
{
    "status": 1,
    "message": "All projects admin created",
    "data": [
        {
            "id": 1,
            "title": "titleProject",
            "description": "description Project"
        },
        {
            "id": 2,
            "title": "titleProject1",
            "description": "description Project1"
        },
        {
            "id": 3,
            "title": "titleProject2",
            "description": "description Project2"
        }
    ]
}

POST

/projects/create

Create new project (Allowed for admins only)

Sample body request (required)
{
    "title": "titleProject",
    "description": "description Project"
}
Sample response
{
    "status": 1,
    "message": "project created succefully",
    "data": null
}

POST

/projects/update/{id}

Update existing project (Allowed for admins only)

Sample body request (required)
{
    "title": "editedTitleProject",
}
Sample response
{
    "status": 1,
    "message": "Project updated successfully",
    "data": null
}

POST

/projects/delete/{id}

Delete existing project (Allowed for admins only). if project contains tasks the project will not deleted

Sample response
{
    "status": 1,
    "message": "Project deleted successfully",
    "data": null
}

Task related Endpoints

POST

/tasks/all

Displays all tasks that admin created for specific project (Allowed for admins only)

Sample body request (required)
{
    "project_id": 2
}
Sample response
{
    "status": 1,
    "message": "All tasks",
    "data": [
        {
            "id": 1,
            "title": "title task",
            "description": "description task",
            "project_id": 2,
            "assigned_to": 1,
            "created_at": "2022-08-28T18:28:20.000000Z",
            "updated_at": "2022-08-28T18:28:20.000000Z",
            "submitted": 0
        }
    ]
}

GET

/tasks/userTasks

User Tasks which assigned to him (Allowed to users)

Sample response
{
    "status": 1,
    "message": "All tasks",
    "data": [
        {
            "id": 2,
            "title": "title task",
            "description": "description task",
            "project_id": 2,
            "assigned_to": 1,
            "created_at": "2022-08-28T18:28:28.000000Z",
            "updated_at": "2022-08-28T18:28:28.000000Z",
            "submitted": 0
        }
    ]
}

POST

/tasks/update/{id}

Update existing task (Allowed for admins only)

Sample body request (required)
{
    "title": "editedTitleTask",
}
Sample response
{
    "status": 1,
    "message": "Task updated successfully",
    "data": null
}

POST

/tasks/delete/{id}

Delete existing task (Allowed for admins only).

Sample response
{
    "status": 1,
    "message": "Project deleted successfully",
    "data": null
}

POST

/tasks/submit/{id}

Submit task (Allowed for user).

Sample response
{
    "status": 1,
    "message": "Task submitted succesfully",
    "data": null
}

About

This is simple task tracker.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published