{"id":27356524,"url":"https://github.com/viniciusmeneses/cart-api","last_synced_at":"2026-04-02T03:04:44.429Z","repository":{"id":115126953,"uuid":"492111018","full_name":"viniciusmeneses/cart-api","owner":"viniciusmeneses","description":"🛒 Shopping cart API developed with Node.js","archived":false,"fork":false,"pushed_at":"2022-06-11T12:59:45.000Z","size":765,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-10T17:02:22.264Z","etag":null,"topics":["clean-architecture","expressjs","jest","nodejs","postgresql","solid","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"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/viniciusmeneses.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,"zenodo":null}},"created_at":"2022-05-14T04:24:55.000Z","updated_at":"2022-06-29T17:14:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"349b3cb3-f346-461f-a3fa-1fc76f628716","html_url":"https://github.com/viniciusmeneses/cart-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/viniciusmeneses/cart-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusmeneses%2Fcart-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusmeneses%2Fcart-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusmeneses%2Fcart-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusmeneses%2Fcart-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viniciusmeneses","download_url":"https://codeload.github.com/viniciusmeneses/cart-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusmeneses%2Fcart-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"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":["clean-architecture","expressjs","jest","nodejs","postgresql","solid","typescript"],"created_at":"2025-04-12T23:24:50.878Z","updated_at":"2026-04-02T03:04:44.390Z","avatar_url":"https://github.com/viniciusmeneses.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Cart API\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n  Shopping cart API developed with Node.js\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"GitHub repo size\" src=\"https://img.shields.io/github/repo-size/viniciusmeneses/cart-api\"\u003e\n  \n  \u003cimg alt=\"GitHub last commit\" src=\"https://img.shields.io/github/last-commit/viniciusmeneses/cart-api\"\u003e\n    \n  \u003cimg alt=\"GitHub Repo stars\" src=\"https://img.shields.io/github/stars/viniciusmeneses/cart-api\"\u003e\n\n  \u003cimg alt=\"Coverage\" src=\"./badges/badge-lines.svg\"\u003e\n\u003c/p\u003e\n\n## 🛒 Project\n\nREST API that implements the shopping cart behaviors. This project was developed using the stack Typescript + Node.js + PostgreSQL stack and applying the Clean Architecture concepts and SOLID principles.\n\n## 💡 Requirements\n\n- [x] Save cart data\n- [x] Get cart data\n- [x] Add an item to cart\n- [x] Remove an item from cart\n- [x] Update the quantity of a cart item\n- [x] Clear cart items\n- [x] Apply a discount coupon to cart \n\n## 🎲 Running\n\nIn order to run the API in development environment, you must have at least the following tools installed: [Git](https://git-scm.com), [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/).\n\n```bash\n# Clone repository\n$ git clone git@github.com:viniciusmeneses/cart-api.git\n\n# Go to project directory\n$ cd cart-api\n\n# Make a copy of envs configuration file\n$ cp .env.sample .env\n\n# Create database and start the server\n$ docker-compose up -d\n\n# Run database migrations\n$ docker exec -t cart-api yarn migration:run\n```\n\nThe API will be served on port 3000 by default and it can be accessed by URL http://localhost:3000.\n\n## 📄 Docs\n\nEvery endpoint and your returns were documented using Swagger and can be accessed by the path `/docs`.\n\n#### Test data\n\nThe following data will be inserted into the database when you run the migrations. It can be used when doing requests to endpoints that need an existing product or coupon.\n\n```js\n// Products\n{ id: \"779d7f21-05b7-4a74-82e5-68b43c7d42d4\", name: \"T-shirt\", price: 45.0, stock: 10 }\n{ id: \"a5d66c1a-b540-45ec-aab7-1e7dc932c38f\", name: \"Pants\", price: 90.0, stock: 10 }\n{ id: \"c2f6dd0e-763e-4600-ad6f-0699be6ba5ae\", name: \"Sneakers\", price: 199.99, stock: 3 }\n{ id: \"c98b3118-677d-4aec-9b06-d20f0015a5ac\", name: \"Sweatshirt\", price: 149.99, stock: 5 }\n{ id: \"9450ea85-ab39-4d06-ae9f-8cd7f20ed4e6\", name: \"Cap\", price: 20.0, stock: 4 }\n\n// Discount coupons\n{ id: \"f99458a3-918e-4275-83bc-f62d5a891480\", code: \"GHW2O\", percentage: 10.0 }\n{ id: \"695ba12a-7b9d-4c5d-8d70-649583590a34\", code: \"VEFJY\", percentage: 5.0 }\n{ id: \"c4a9f80d-8ecc-4870-82f1-c436ac18581f\", code: \"D0JNN\", percentage: 2.5 }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciusmeneses%2Fcart-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviniciusmeneses%2Fcart-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciusmeneses%2Fcart-api/lists"}