{"id":19710070,"url":"https://github.com/brunomedeiros14/shoppingcartapi","last_synced_at":"2026-05-02T08:33:59.492Z","repository":{"id":184997073,"uuid":"667527278","full_name":"brunomedeiros14/ShoppingCartApi","owner":"brunomedeiros14","description":"Project to simulate ecommerce shopping cart persistence in API, with Spring boot and Kotlin, unit tests and docker to reproduce the project and its database.","archived":false,"fork":false,"pushed_at":"2023-12-31T16:09:53.000Z","size":627,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T18:39:49.829Z","etag":null,"topics":["docker","flyway","jpa","kotlin","spring-boot","sql"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/brunomedeiros14.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-07-17T17:55:31.000Z","updated_at":"2023-12-31T14:54:01.000Z","dependencies_parsed_at":"2023-12-31T17:20:48.697Z","dependency_job_id":null,"html_url":"https://github.com/brunomedeiros14/ShoppingCartApi","commit_stats":null,"previous_names":["brunomedeiros14/tqi_kotlin_backend_developer_2023","brunomedeiros14/shoppingcartapi"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/brunomedeiros14/ShoppingCartApi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunomedeiros14%2FShoppingCartApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunomedeiros14%2FShoppingCartApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunomedeiros14%2FShoppingCartApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunomedeiros14%2FShoppingCartApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunomedeiros14","download_url":"https://codeload.github.com/brunomedeiros14/ShoppingCartApi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunomedeiros14%2FShoppingCartApi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32528223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"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":["docker","flyway","jpa","kotlin","spring-boot","sql"],"created_at":"2024-11-11T22:06:13.235Z","updated_at":"2026-05-02T08:33:59.475Z","avatar_url":"https://github.com/brunomedeiros14.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Juju market\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/v1.8.22-orange?logo=kotlin\u0026logoColor=white\u0026label=Kotlin\" alt=\"Kotlin\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/v3.1.2-green?logo=spring\u0026logoColor=white\u0026label=Spring-boot\" alt=\"Spring Boot\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/v8.1.2-blue?logo=gradle\u0026logoColor=white\u0026label=Gradle\" alt=\"Gradle\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/v20.10.24-blue?logo=docker\u0026logoColor=white\u0026label=Docker\" alt=\"Docker\" /\u003e\n  \u003cimg src=\"https://img.shields.io/static/v1?label=Juju%20Market\u0026message=v1.0.0\u0026color=8257E5\" alt=\"Juju Market\" /\u003e\n\u003c/p\u003e\n\nProject carried out to complete the TQI challenge after completing the bootcamp provided on the [DIO](https://www.dio.me/ 'DIO website') platform.\n\n[click here](./README.pt-br.md) to see the documentation in Portuguese :brazil:\n\n## Technologies\n\n- [Spring Boot](https://spring.io/projects/spring-boot)\n- [Spring MVC](https://docs.spring.io/spring-framework/reference/web/webmvc.html)\n- [Gradle](https://gradle.org)\n- [Spring Data JPA](https://docs.spring.io/spring-boot/docs/3.1.2/reference/htmlsinge/index.html#data.sql.jpa-and-spring-data)\n- [Validation](https://docs.spring.io/spring-boot/docs/3.1.2/reference/htmlsinge/index.html#io.validation)\n- [Spring Web](https://docs.spring.io/spring-boot/docs/3.1.2/reference/htmlsinge/index.html#web)\n- [Flyway Migration](https://docs.spring.io/spring-boot/docs/3.1.2/reference/htmlsinge/index.html#howto.data-initialization.migration-tool.flyway)\n\n- [Docker Compose](https://docs.docker.com/compose/)\n\n## Application Proposal\n\nAs can be seen in the [proposal image](./assets/challenge.png).\n\nThe challenge is based on a self-service commerce application, where it is possible to:\n\n1. Register a product category;\n2. Register products;\n3. Add products to a cart;\n4. Make payment for the cart, returning the total value of the cart.\n\nTo meet the challenge, a project containing the technologies mentioned above was developed, and a class diagram was created to facilitate development, as shown in the following image:\n\n![./assets/JuMarket_diagram.png](./assets/JuMarket_diagram.png 'Class Diagram')\n\nWith this relationship, several endpoints were developed for each entity, as follows:\n\n- Category:\n  - **GET** `/api/v1/category` -\u003e Returns all registered categories, returning an error if none exist.\n  - **DELETE** `/api/v1/category/{1}` -\u003e Returns an empty body with status 200.\n  - **POST** `/api/v1/category` -\u003e Returns the saved category in case of success, returning an error if a similar category already exists.\n- Product:\n  - **GET** `/api/v1/product` -\u003e Returns all registered products, returning an error if none exist.\n  - **GET** `/api/v1/product/{id}` -\u003e Returns the product registered by the id, returning an error if not found.\n  - **POST** `/api/v1/product` -\u003e Returns all the product saved in the database.\n  - **PUT** `/api/v1/product` -\u003e Returns all the product changed in the database.\n  - **DELETE** `/api/v1/product` -\u003e Returns an empty body with status 200.\n- Cart:\n  - **POST** `/api/v1/cart` -\u003e Returns a created cart.\n  - **POST** `/api/v1/cart/pay?id={cartID}\u0026paymentMethod={paymentMethod}` -\u003e Completes the payment of a cart, changing its enum to paid and returning the total value of the purchase, and blocking the cart for changes as the purchase is completed.\n  - **GET** `/api/v1/cart` -\u003e Returns all saved carts, returning an error if none are registered.\n  - **GET** `/api/v1/cart/{id}` -\u003e Returns the cart by the specified id, returning an error if not found.\n  - **DELETE** `/api/v1/cart` -\u003e Returns an empty body with status 200.\n- Product Cart\n  - **POST** `/api/v1/product-cart` -\u003e Adds products to the cart according to the quantity and product provided.\n  - **DELETE** `/api/v1/product-cart` -\u003e Removes products from the cart according to the quantity and product provided, returning an error if the product is not in the cart.\n\nTo facilitate testing of the application, [click here](./assets/TQI_challenge.postman_collection.json 'Postman test collection') to download the test collection listed in Postman.\n\nThere is also the JSON to generate Swagger Open API documentation for this project [here](./assets/openapi.json 'Open API collection').\n\nHaving an expected flow to include a category -\u003e include a product -\u003e create a cart -\u003e add a product to the cart -\u003e make a payment in the cart by informing its id and payment method.\n\n## How to Run\n\n- Clone git repository:\n\n```bash\ngit clone https://github.com/BrunoMedeiros14/tqi_Kotlin_backend_developer_2023.git\n```\n\n- With Java 17 installed on the machine and Java Home configured, run Gradle with the command `gradlew.bat bootRun` on Windows or the command `./gradlew bootRun` on **Linux**.\n\n- With Docker installed, run the database with the command:\n\n```bash\ndocker run -d --rm  --name postgres  -e POSTGRES_DB=juju_market  -e POSTGRES_USER=root  -e POSTGRES_PASSWORD=juju  -p 5432:5432  postgres:latest\n```\n\n- It is also possible to run the docker-compose, which both runs the database and compiles the JAR to execute it, with the command:\n\n```bash\ndocker-compose up\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunomedeiros14%2Fshoppingcartapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunomedeiros14%2Fshoppingcartapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunomedeiros14%2Fshoppingcartapi/lists"}