{"id":19135934,"url":"https://github.com/sonalys/clean-architecture","last_synced_at":"2025-11-13T03:05:19.183Z","repository":{"id":88402313,"uuid":"320678565","full_name":"sonalys/clean-architecture","owner":"sonalys","description":"A simple cart rest API using clean architecture","archived":false,"fork":false,"pushed_at":"2020-12-11T20:37:48.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T13:35:59.736Z","etag":null,"topics":["learning-by-doing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sonalys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-12-11T20:36:09.000Z","updated_at":"2022-10-17T08:43:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"35c3c0dc-6f52-4955-a925-df63aa12951b","html_url":"https://github.com/sonalys/clean-architecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sonalys/clean-architecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonalys%2Fclean-architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonalys%2Fclean-architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonalys%2Fclean-architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonalys%2Fclean-architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonalys","download_url":"https://codeload.github.com/sonalys/clean-architecture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonalys%2Fclean-architecture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284145006,"owners_count":26954846,"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-11-13T02:00:06.582Z","response_time":61,"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":["learning-by-doing"],"created_at":"2024-11-09T06:32:41.884Z","updated_at":"2025-11-13T03:05:19.165Z","avatar_url":"https://github.com/sonalys.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nCart API\n========\n\n## Documentation\n[Here](./documentation/readme.md) \n\n### Domain Types\n\nThe Cart API consists of two simple types: `Cart` and `CartItem`. The `Cart`\nholds zero or more `CartItem` objects.\n\n\n### Create Cart\n\nA new cart should be created and an ID generated. The new empty cart should be returned.\n\n```sh\n$ curl -X POST http://localhost:3000/carts -d '{}'\n```\n\n```json\n{\n\t\"id\": 1,\n\t\"items\": []\n}\n```\n\n### Add to cart\n\nA new item should added to an existing cart. Should fail if the cart does not\nexist, if the product name is blank, or if the quantity is non-positive. The\nnew item should be returned.\n\n```sh\n$ curl -X POST -H 'content-type: application/json' http://localhost:3000/carts/1/items -d '{\n\t\"product\": \"Shoes\",\n\t\"quantity\": 10\n}'\n```\n\n```json\n{\n\t\"id\": 1,\n\t\"cart_id\": 1,\n\t\"product\": \"Shoes\",\n\t\"quantity\": 10\n}\n```\n\n### Remove from cart\n\nAn existing item should be removed from a cart. Should fail if the cart does not\nexist or if the item does not exist.\n\n```sh\n$ curl -X DELETE http://localhost:3000/carts/1/items/1\n```\n\n```json\n{}\n```\n\n\n### View cart\n\nAn existing cart should be able to be viewed with its items. Should fail if the\ncart does not exist.\n\n```sh\n$ curl http://localhost:3000/carts/1\n```\n\n```json\n{\n\t\"id\": 1,\n\t\"items\": [\n\t\t{\n\t\t\t\"id\": 1,\n\t\t\t\"cart_id\": 1,\n\t\t\t\"product\": \"Shoes\",\n\t\t\t\"quantity\": 10\n\t\t},\n\t\t{\n\t\t\t\"id\": 2,\n\t\t\t\"cart_id\": 1,\n\t\t\t\"product\": \"Socks\",\n\t\t\t\"quantity\": 5\n\t\t}\n\t]\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonalys%2Fclean-architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonalys%2Fclean-architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonalys%2Fclean-architecture/lists"}