{"id":23662793,"url":"https://github.com/cassiomolin/tasks-rest-api","last_synced_at":"2026-03-15T05:41:08.215Z","repository":{"id":269002515,"uuid":"93936502","full_name":"cassiomolin/tasks-rest-api","owner":"cassiomolin","description":"Sample REST API for managing tasks using Spring Boot, Jersey, Jackson, MapStruct, Hibernate Validator and REST Assured.","archived":false,"fork":false,"pushed_at":"2017-07-28T15:51:10.000Z","size":184,"stargazers_count":12,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T21:51:18.389Z","etag":null,"topics":["hibernate-validator","jackson","java","jersey","mapstruct","postman","rest","rest-api","rest-assured","spring","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cassiomolin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-10T12:03:24.000Z","updated_at":"2023-03-03T11:00:56.000Z","dependencies_parsed_at":"2024-12-20T08:49:16.726Z","dependency_job_id":"4b03d00e-68d8-4d36-b8a0-d084b73923c2","html_url":"https://github.com/cassiomolin/tasks-rest-api","commit_stats":null,"previous_names":["cassiomolin/tasks-rest-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cassiomolin/tasks-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassiomolin%2Ftasks-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassiomolin%2Ftasks-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassiomolin%2Ftasks-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassiomolin%2Ftasks-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cassiomolin","download_url":"https://codeload.github.com/cassiomolin/tasks-rest-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassiomolin%2Ftasks-rest-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273162221,"owners_count":25056428,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"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":["hibernate-validator","jackson","java","jersey","mapstruct","postman","rest","rest-api","rest-assured","spring","spring-boot"],"created_at":"2024-12-29T05:13:59.565Z","updated_at":"2026-03-15T05:41:08.172Z","avatar_url":"https://github.com/cassiomolin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample REST API for managing tasks using Spring Boot and Jersey\n\n[![Build Status](https://travis-ci.org/cassiomolin/tasks-rest-api.svg?branch=master)](https://travis-ci.org/cassiomolin/tasks-rest-api)\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/cassiomolin/tasks-rest-api/master/LICENSE.txt)\n\nExample of REST API using:\n\n- **Spring Boot:** Framework for creating standalone Java applications.\n- **Jersey:** JAX-RS reference implementation for creating RESTful web services in Java.\n- **Jackson:** JSON parser for Java.\n- **MapStruct:** Mapping framework for Java.\n- **Hibernate Validator:** Bean Validation implemetation to define and validate application constraints.\n- **REST Assured:** Testing framework for REST APIs.\n\nBesides the REST API, it features a client application built with **Angular** and **TypeScript**. See the [`tasks-client-angular`][client project] project for details.\n\n## Building and running this application\n\nTo build and run this application, follow these steps:\n\n1. Open a command line window or terminal.\n1. Navigate to the root directory of the project, where the `pom.xml` resides.\n1. Compile the project: `mvn clean compile`.\n1. Package the application: `mvn package`.\n1. Change into the `target` directory: `cd target`\n1. You should see a file with the following or a similar name: `tasks-1.0.jar`.\n1. Execute the JAR: `java -jar tasks-1.0.jar`.\n1. The REST API will be available at `http://localhost:8080/api`.\n1. A JavaScript client application will be available at `http://localhost:8080`.\n\nWhen the application starts up, the database will be populated with some rows. \n\n## Angular client application\n\nAn **Angular** and **TypeScript** client application is shipped with the main application and it's available at `http://localhost:8080`:\n\n\u003cimg src=\"src/main/doc/frontend.png\" width=\"600\"\u003e\n\nFor better maintainability, client and server applications source code are kept in different repositories. During the build, the [client application artifacts][client releases] are downloaded, packed and released as part of the main application. \n\nFor the client application source code, refer to the [`tasks-client-angular`][client project] project.\n\n## REST API overview\n\nThe application provides a REST API for managing tasks. See the [curl][] scripts below with the supported operations:\n\n### Create a task\n\n```bash\ncurl -X POST \\\n  'http://localhost:8080/api/tasks' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"description\": \"Pay internet bill\"\n}'\n```\n### Get multiple tasks\n\n```bash\ncurl -X GET \\\n  'http://localhost:8080/api/tasks' \\\n  -H 'Accept: application/json'\n```\n\nThis endpoint supports the following query parameters:\n\n- `description` (string): Filter tasks by description (case-insensitive).\n- `completed` (boolean): Filter tasks by completed status.\n\nFiltering tasks by description:\n\n```bash\ncurl -X GET -G \\\n  'http://localhost:8080/api/tasks' \\\n  -H 'Accept: application/json' \\\n  -d 'description=avocado'\n```\n\nFiltering tasks by completed status:\n\n```bash\ncurl -X GET -G \\\n  'http://localhost:8080/api/tasks' \\\n  -H 'Accept: application/json' \\\n  -d 'completed=true'\n```\n\nFiltering tasks by description and by completed status:\n\n```bash\ncurl -X GET -G \\\n  'http://localhost:8080/api/tasks' \\\n  -H 'Accept: application/json' \\\n  -d 'description=karate' \\\n  -d 'completed=true'\n```\n\n### Get a task by id\n\n```bash\ncurl -X GET \\\n  'http://localhost:8080/api/tasks/5' \\\n  -H 'Accept: application/json'\n```\n\n### Update a task\n\n```bash\ncurl -X PUT \\\n  'http://localhost:8080/api/tasks/5' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"description\": \"Pay electricity bill\",\n  \"completed\": false\n}'\n```\n\n### Update a task completed status\n\n```bash\ncurl -X PUT \\\n  'http://localhost:8080/api/tasks/5/completed' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"value\": true\n}'\n```\n\n### Delete a task by id\n\n```bash\ncurl -X DELETE \\\n  'http://localhost:8080/api/tasks/5'\n```\n\n### Delete multiple tasks\n\n```bash\ncurl -X DELETE \\\n  'http://localhost:8080/api/tasks'\n```\n\nThis endpoint supports the following query parameter:\n\n- `completed` (boolean): Delete tasks by completed status.\n\nAnd it can be used as following:\n\n```bash\ncurl -X DELETE -G \\\n  'http://localhost:8080/api/tasks' \\\n  -d 'completed=true'\n```\n\n## Targeting the REST API with Postman\n\nAlternatively to [curl][], you can use [Postman][] to target the REST API. The Postman collection files are available in the [`src/main/postman`](src/main/postman) directory.\n\n[Postman]: https://www.getpostman.com/\n[client project]: https://github.com/cassiomolin/tasks-client-angular\n[client releases]: https://github.com/cassiomolin/tasks-client-angular/releases\n[curl]: https://curl.haxx.se/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcassiomolin%2Ftasks-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcassiomolin%2Ftasks-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcassiomolin%2Ftasks-rest-api/lists"}