Code Monkey home page Code Monkey logo

todoapp's Introduction

TODO APP

Start the application

The project use docker compose, so you only need to run:

docker-compose up --build

Note Make sure to have open the necessary ports available, or edit the docker-compose file enabling others. The default ports binding is:

service port
api 8001
frontend 8000

The backend

To the backend development I choose to use the symfony framework on php 8.

All the resources are under the prefix api, it means that the base URL would be http://localhost:8001/api:

The resources

Tasks

The tasks are under the resource todo, with the following endpoints:

List tasks
GET /todo

availables query params

name | values | description

  • | - | - completed | 1 o 0 | Filter the task by completed or not completed (1 is complete 0 is uncompleted)

Example response

[
    {
        "id": 1,
        "title": "hacer las compras",
        "completed": true,
        "createdAt": "2021-10-17T16:05:40+00:00",
        "updatedAt": null
    },
    {
        "id": 2,
        "title": "hacer las compras",
        "completed": true,
        "createdAt": "2021-10-17T16:05:41+00:00",
        "updatedAt": null
    },
    {
        "id": 3,
        "title": "hacer las compras 3",
        "completed": true,
        "createdAt": "2021-10-17T16:05:47+00:00",
        "updatedAt": "2021-10-17T16:05:50+00:00"
    }
]

Show tasks

GET /todo/{id}

Example response

{
    "id": 1,
    "title": "hacer las compras",
    "completed": true,
    "createdAt": "2021-10-17T16:05:40+00:00",
    "updatedAt": null
}

Create task

POST /todo

Request body

{
    "title": "hacer las compras",
    "completed": true // optional, default false
}

Example response

{
    "id": 3,
    "title": "hacer las compras",
    "completed": true,
    "createdAt": "2021-10-17T16:05:47+00:00",
    "updatedAt": null
}

Update task

PUT /todo

Request body

{
   "title": "hacer las compras 3",
   "completed": true // optional, default override to false
}

Example response

{
    "id": 3,
    "title": "hacer las compras 3",
    "completed": true,
    "createdAt": "2021-10-17T16:05:47+00:00",
    "updatedAt": "2021-10-17T16:05:50+00:00"
}

Delete task

DELETE /todo/{id}

Example response

{
    "deleted": true
}

Report

The changelog reportsare under the resource report

General report

GET /report

availables query params

name | values | description

  • | - | - action | "create", "update" o "delete" | Filter the record by the given action (without this filter only the recors related to the existent tasks are shown) sortByTask | 1 o -1 | Sort by task id, 1 is for ascendant order and -1 for descendant

Example response

[
    {
        "id": 2,
        "taskId": 4,
        "action": "create",
        "description": "Created the task \"hacer las compras\" at 23:08",
        "performedAt": "2021-10-15T23:08:56+00:00"
    },
    {
        "id": 3,
        "taskId": 5,
        "action": "create",
        "description": "Created the task \"hacer las compras\" at 23:09",
        "performedAt": "2021-10-15T23:09:20+00:00"
    },
    {
        "id": 4,
        "taskId": 6,
        "action": "create",
        "description": "Created the task \"hacer las compras\" at 23:09",
        "performedAt": "2021-10-15T23:09:49+00:00"
    },
    {
        "id": 5,
        "taskId": 7,
        "action": "create",
        "description": "Created the task \"hacer las compras\" at 23:10",
        "performedAt": "2021-10-15T23:10:18+00:00"
    },
    {
        "id": 15,
        "taskId": 8,
        "action": "create",
        "description": "Created the task \"hacer las compras\" at 23:47",
        "performedAt": "2021-10-15T23:47:33+00:00"
    }
]

Task report

GET /report/{id}

Example response

[
    {
        "id": 3,
        "taskId": 3,
        "action": "create",
        "description": "Created the task \"hacer las compras\" at 16:05",
        "performedAt": "2021-10-17T16:05:47+00:00"
    },
    {
        "id": 4,
        "taskId": 3,
        "action": "update",
        "description": "Updated the task \"hacer las compras 3\" at 16:05",
        "performedAt": "2021-10-17T16:05:50+00:00"
    },
    {
        "id": 5,
        "taskId": 3,
        "action": "delete",
        "description": "Deleted the task \"hacer las compras 3\" at 17:37",
        "performedAt": "2021-10-17T17:37:16+00:00"
    }
]

The frontend

For the frontend I didn't use a framework only the libs jQuery and Sweet Alert 2.

The page is accessible in the port 8000

Tests

The backend has test written with phpUnit, for run them you can use the script runtests.sh (The project must be running).

Author

Any doubt you can contact me! Name: Pablo Cha LinkedIn: pablocha Mail: [email protected]

todoapp's People

Contributors

pcha avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.