{"id":20752430,"url":"https://github.com/andhikayuana/belanja-api","last_synced_at":"2025-04-28T14:08:04.178Z","repository":{"id":88789094,"uuid":"134155976","full_name":"andhikayuana/belanja-api","owner":"andhikayuana","description":"Simple API demo for product listing","archived":false,"fork":false,"pushed_at":"2024-01-21T15:19:13.000Z","size":21,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-28T14:07:56.806Z","etag":null,"topics":["api","belanja","crud","crud-api","php","php7","psr4"],"latest_commit_sha":null,"homepage":"https://belanja-api.herokuapp.com","language":"PHP","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/andhikayuana.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}},"created_at":"2018-05-20T14:08:29.000Z","updated_at":"2024-01-21T15:06:56.000Z","dependencies_parsed_at":"2023-06-12T15:00:16.152Z","dependency_job_id":null,"html_url":"https://github.com/andhikayuana/belanja-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andhikayuana%2Fbelanja-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andhikayuana%2Fbelanja-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andhikayuana%2Fbelanja-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andhikayuana%2Fbelanja-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andhikayuana","download_url":"https://codeload.github.com/andhikayuana/belanja-api/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326840,"owners_count":21571636,"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":["api","belanja","crud","crud-api","php","php7","psr4"],"created_at":"2024-11-17T08:41:20.227Z","updated_at":"2025-04-28T14:08:04.137Z","avatar_url":"https://github.com/andhikayuana.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Simple Product API for Belanja\n\n### Requirements\n\n* Git\n* Composer\n* PHP 7 or latest with SQLite PDO\n* Docker (Optional for Build Image)\n\n### Installation\n\n* Clone this repository using `git`\n\n```bash\ngit clone git@github.com:andhikayuana/belanja-api.git\n```\n\n* Install dependencies using `composer`\n\n```bash\ncd belanja-api\ncomposer install\n```\n\n### Running\n\nTo run this API using this command\n\n```bash\ncd belanja-api\nphp -S localhost:3000 -t public\n```\n\n### Build Image\n\nYou can build the docker image by using below command \n\n```\ncd belanja-api\ndocker build -t api.belanja .\n```\n\nor you can just pull docker image in from docker hub\n\n```\ndocker pull andhikayuana/api-belanja\n```\n\nNow, you can access using Postman `http://localhost:3000` and see \n\n```json\n{\n    \"code\": 200,\n    \"msg\": \"Success\",\n    \"data\": {\n        \"name\": \"Belanja API Demo\",\n        \"version\": \"1.0.0\"\n    }\n}\n```\n\n### How to use\n\n* `BASE_URL=http://localhost:3000`\n* `GET` `/products` _get all products_\n\nresponse example\n\n```json\n{\n    \"code\": 200,\n    \"msg\": \"Success\",\n    \"data\": [\n        {\n            \"id\": 1,\n            \"name\": \"Sandal Mahal\",\n            \"price\": 5000000,\n            \"image\": \"https://anu.com/images/sandal-mahal.jpg\"\n        },\n        {\n            \"id\": 2,\n            \"name\": \"Baju Mahal\",\n            \"price\": 8000000,\n            \"image\": \"https://anu.com/images/baju-mahal.jpg\"\n        }\n    ]\n}\n``` \n\n* `GET` `/products/{id}` _get product by id_\n\nresponse example\n\n```json\n{\n    \"code\": 200,\n    \"msg\": \"Success\",\n    \"data\": {\n        \"id\": 1,\n        \"name\": \"Sandal Mahal\",\n        \"price\": 5000000,\n        \"image\": \"https://anu.com/sandal-mahal.jpg\"\n    }\n}\n```\n\n* `POST` `/products` _insert product data_\n\nrequest example\n\n```json\n{\n\t\"name\": \"Sepatu Mahal Banget\",\n\t\"price\": 6000000,\n\t\"image\": \"http://anu.com/images/weird-shoes-3-1.jpg\"\n}\n```\n\nresponse example\n\n```json\n{\n    \"code\": 200,\n    \"msg\": \"Success\",\n    \"data\": {\n        \"name\": \"Sepatu Mahal Banget\",\n        \"price\": 6000000,\n        \"image\": \"http://anu.com/images/weird-shoes-3-1.jpg\",\n        \"id\": 4\n    }\n}\n```\n\n* `PUT` `/products/{id}` _update product data_\n\nrequest example\n\n```json\n{\n\t\"name\": \"Sepatu Mahal wkwk\",\n\t\"price\": 2500000,\n\t\"image\": \"https://anu.com/weird-and-funny-shoes02.jpg\"\n}\n```\n\nresponse example\n\n```json\n{\n    \"code\": 200,\n    \"msg\": \"Success\",\n    \"data\": {\n        \"id\": 4,\n        \"name\": \"Sepatu Mahal wkwk\",\n        \"price\": 2500000,\n        \"image\": \"https://anu.com/weird-and-funny-shoes02.jpg\"\n    }\n}\n```\n\n* `DELETE` `/products/{id}` _delete product data_\n\nresponse example\n\n```json\n{\n    \"code\": 200,\n    \"msg\": \"Success\",\n    \"data\": []\n}\n```\n\n### Show QR Code for scanning the product\n\n* `GET` `/products/qr-code` _show qr code to get product data_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandhikayuana%2Fbelanja-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandhikayuana%2Fbelanja-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandhikayuana%2Fbelanja-api/lists"}