{"id":23653058,"url":"https://github.com/quochuydev/go-pos-bot","last_synced_at":"2025-11-18T08:30:13.070Z","repository":{"id":255329235,"uuid":"849229976","full_name":"quochuydev/go-pos-bot","owner":"quochuydev","description":"Learning...","archived":false,"fork":false,"pushed_at":"2024-09-03T03:37:11.000Z","size":28129,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T17:41:41.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://t.me/Goposv1Bot","language":"Go","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/quochuydev.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-29T08:07:04.000Z","updated_at":"2024-09-03T03:37:14.000Z","dependencies_parsed_at":"2024-08-29T10:30:45.101Z","dependency_job_id":"7889d9da-6694-4923-8306-bb0806e8b7b2","html_url":"https://github.com/quochuydev/go-pos-bot","commit_stats":null,"previous_names":["quochuydev/go-react-native-pos"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quochuydev%2Fgo-pos-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quochuydev%2Fgo-pos-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quochuydev%2Fgo-pos-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quochuydev%2Fgo-pos-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quochuydev","download_url":"https://codeload.github.com/quochuydev/go-pos-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239614975,"owners_count":19668824,"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-12-28T17:40:33.470Z","updated_at":"2025-11-18T08:30:12.990Z","avatar_url":"https://github.com/quochuydev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## DIY\n\n### Manual create Telegram bot\n\n#### Test BOT\n\n\u003cimg src=\"docs/bot.jpg\" alt=\"t.me/Goposv1Bot\" width=\"200\"/\u003e\n\n### Setup free MongoDB Atlas\n\n#### - Register a free mongo cluster\n\nhttps://cloud.mongodb.com\n\n#### - Create a new cluster\n\n![MongoDB Atlas](docs/mongodb-atlas.png)\n\n#### - Create a new cluster\n\n![MongoDB Atlas Network Access](docs/mongodb-network-access.png)\n\n### Deploy Golang in AWS EC2\n\nOS: AWS Linux\n\n```\nuname -s\n\nuname -m\n```\n\nIf the outputs match Linux and x86_64, then the corresponding values in Go would be:\n\n```\nGOOS=linux GOARCH=amd64 go build -o myapp\n```\n\n#### Setup nginx\n\n```sh\nsudo yum update\nsudo yum install nginx\n```\n\n```sh\nsudo systemctl enable nginx\nsudo systemctl start nginx\nsudo systemctl status nginx\n```\n\n```sh\nsudo mkdir -p /etc/nginx/conf.d\nsudo nano /etc/nginx/conf.d/default.conf\n```\n\n```nginx\nserver {\n    listen 80;\n\n    location / {\n        proxy_pass http://localhost:12345;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n}\n\nserver {\n    listen 443 ssl;\n    server_name gopos.quochuy.dev;\n\n    ssl_certificate /etc/letsencrypt/live/gopos.quochuy.dev/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/gopos.quochuy.dev/privkey.pem;\n    include /etc/letsencrypt/options-ssl-nginx.conf;\n    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;\n\n    location / {\n        proxy_pass http://localhost:12345;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n}\n```\n\n```sh\nsudo yum install certbot python3-certbot-nginx -y\n\nsudo certbot --nginx -d gopos.quochuy.dev\n```\n\nTest nginx\n\n```sh\nsudo nginx -t\n```\n\nexpect: `nginx: configuration file /etc/nginx/nginx.conf test is successful`\n\n```sh\nsudo systemctl reload nginx\n```\n\n### Integrate to POS application\n\n#### Setup shopify webhook\n\n```curl\nNGROK_URL=https://gopos.quochuy.dev\nSHOPIFY_TOKEN=\n\ncurl -X POST \"https://quickstart-fa54a928.myshopify.com/admin/api/2023-07/webhooks.json\" \\\n-H \"X-Shopify-Access-Token: $SHOPIFY_TOKEN\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"webhook\": {\n    \"topic\": \"orders/create\",\n    \"address\": \"'$NGROK_URL'/api/shopify/webhook\",\n    \"format\": \"json\"\n  }\n}'\n```\n\n==\u003e webhook_id:1660397355317\n\n#### Setup shopify discount verify with there APIs\n\n```curl\nSHOPIFY_STORE_URL=https://quickstart-fa54a928.myshopify.com\nSHOPIFY_TOKEN=\n\ncurl -X GET \"$SHOPIFY_STORE_URL/admin/api/2023-07/price_rules.json\" \\\n-H \"X-Shopify-Access-Token: $SHOPIFY_TOKEN\"\n\ncurl -X GET \"$SHOPIFY_STORE_URL/admin/api/2023-07/price_rules/1716197753141/discount_codes.json\" \\\n-H \"X-Shopify-Access-Token: $SHOPIFY_TOKEN\"\n\ncurl -X GET \"$SHOPIFY_STORE_URL/admin/api/2023-07/webhooks.json\" \\\n-H \"X-Shopify-Access-Token: $SHOPIFY_TOKEN\"\n\ncurl -X DELETE \"$SHOPIFY_STORE_URL/admin/api/2023-07/webhooks/1660398174517.json\" \\\n-H \"X-Shopify-Access-Token: $SHOPIFY_TOKEN\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquochuydev%2Fgo-pos-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquochuydev%2Fgo-pos-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquochuydev%2Fgo-pos-bot/lists"}