{"id":21959134,"url":"https://github.com/ldmtam/ecommerce-demo","last_synced_at":"2026-05-13T07:04:44.763Z","repository":{"id":185495174,"uuid":"568332818","full_name":"ldmtam/ecommerce-demo","owner":"ldmtam","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-20T08:52:35.000Z","size":161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T23:45:00.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/ldmtam.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}},"created_at":"2022-11-20T07:25:20.000Z","updated_at":"2022-11-20T07:26:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d3bd578-5949-4df2-bd54-4e6deadd99c2","html_url":"https://github.com/ldmtam/ecommerce-demo","commit_stats":null,"previous_names":["ldmtam/ecommerce-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldmtam%2Fecommerce-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldmtam%2Fecommerce-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldmtam%2Fecommerce-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldmtam%2Fecommerce-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ldmtam","download_url":"https://codeload.github.com/ldmtam/ecommerce-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245013996,"owners_count":20547178,"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","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":[],"created_at":"2024-11-29T09:20:33.563Z","updated_at":"2026-05-13T07:04:44.734Z","avatar_url":"https://github.com/ldmtam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Sequence diagram\n### Create new product\n![Create new product](./diagram/create_product.png?raw=true)\n\n### Get product\n![Get product](./diagram/get_product.png?raw=true)\n\n### Search product\n![Search product](./diagram/search_product.png?raw=true)\n\n### Get user activities\n![Get user activities](./diagram/get_activities2.png?raw=true)\n\n\n\n## How to run\nFirstly, run the following command to run necessary components\n```bash\nmake start-docker\n``` \nPlease make sure those ports are available\n```\nMySQL: 3306\nAdminer: 8080\nZookeeper: 2181\nKafka: 9092\nApplication: 3000\n```\nSecondly, start the application\n```\nmake run-local\n```\nWhen finished, execute the following command to cleanup containers\n```\nmake stop-docker\n```\n\n## cURL\n### Create new product\n```bash\ncurl --location --request POST 'localhost:3000/api/v1/products' \\\n    --header 'Content-Type: application/json' \\\n    --data-raw '{\n        \"name\": \"Ultraboost 22 shoes\",\n        \"price\": 250\n    }'\n```\n\n```bash\ncurl --location --request POST 'localhost:3000/api/v1/products' \\\n    --header 'Content-Type: application/json' \\\n    --data-raw '{\n        \"name\": \"Ultraboost 4DFWD shoes\",\n        \"price\": 300\n    }'\n```\n\n```bash\ncurl --location --request POST 'localhost:3000/api/v1/products' \\\n    --header 'Content-Type: application/json' \\\n    --data-raw '{\n        \"name\": \"Stan Smith shoes\",\n        \"price\": 200\n    }'\n```\n\n### Get product by id\n```bash\ncurl --location --request GET 'localhost:3000/api/v1/products/1' \\\n    --header 'Content-Type: application/json' \\\n    --header 'Cookie: user_id=123' \\\n    --data-raw ''\n```\n\n```bash\ncurl --location --request GET 'localhost:3000/api/v1/products/2' \\\n    --header 'Content-Type: application/json' \\\n    --header 'Cookie: user_id=456' \\\n    --data-raw ''\n```\n\n### Seach product by names\n```bash\ncurl --location --request GET 'localhost:3000/api/v1/products/seachByName/boost' \\\n    --header 'Cookie: user_id=123' \\\n    --data-raw ''\n```\n\n```bash\ncurl --location --request GET 'localhost:3000/api/v1/products/seachByName/shoe' \\\n    --header 'Cookie: user_id=123' \\\n    --data-raw ''\n```\n\n### Get customer activities\n```bash\ncurl --location --request GET 'localhost:3000/api/v1/customer_activities/123' \\\n    --data-raw ''\n```\n\n```bash\ncurl --location --request GET 'localhost:3000/api/v1/customer_activities/456' \\\n    --data-raw ''\n```\n\n```bash\ncurl --location --request GET 'localhost:3000/api/v1/customer_activities/123/actions/VIEW_PRODUCT' \\\n    --data-raw ''\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldmtam%2Fecommerce-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fldmtam%2Fecommerce-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldmtam%2Fecommerce-demo/lists"}