{"id":17370121,"url":"https://github.com/gianarb/shopmany","last_synced_at":"2025-04-15T04:11:42.893Z","repository":{"id":51938864,"uuid":"174156368","full_name":"gianarb/shopmany","owner":"gianarb","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-10T17:03:23.000Z","size":8601,"stargazers_count":5,"open_issues_count":3,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T04:11:41.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/gianarb.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}},"created_at":"2019-03-06T14:03:34.000Z","updated_at":"2021-05-04T22:45:34.000Z","dependencies_parsed_at":"2023-01-26T11:16:36.133Z","dependency_job_id":null,"html_url":"https://github.com/gianarb/shopmany","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianarb%2Fshopmany","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianarb%2Fshopmany/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianarb%2Fshopmany/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianarb%2Fshopmany/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gianarb","download_url":"https://codeload.github.com/gianarb/shopmany/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003954,"owners_count":21196793,"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-10-16T00:23:36.684Z","updated_at":"2025-04-15T04:11:42.877Z","avatar_url":"https://github.com/gianarb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"`shopmay` is a sort of ecommerce made of a bunch of services written using\ndifferent languages. I wrote it as codebase for an \"Observability workshop\". So\nthe idea is to learn about how to instrument applications because as every\ndeveloper know it is hard to understand what is going on in production.\n\n# Getting Started\n\n```\ndocker network create gaworkshop\ndocker-compose up frontend\n```\n\nStarted all the services involved, you can point your browser to\n`http://localhost:3000` to see a fancy UI. It is a single-page ecommerce. You\ncan see the list of items available, if there is a discount and you can populare\nand buy a carts.\n\n# Per Service zoom\n\nThe overall architecture looks like this one. The frontend serves an HTTP\napplication that uses Jquery as JS Framework. It also serves a set of JSON API.\nThose APIs are a proxy to the other services part of `shopmany`.\n\n* Item\n* Discount\n* Pay\n\n```\n+------------------+\n|                  |\n|   Frontend/UI    |\n|                  |\n+--------+---------+\n         |\n+--------v---------+         +-------------------+\n|                  |         |                   |\n|   Frontend/Proxy +---------\u003e   Item            |\n|                  |         |                   |\n+--------+---------+         +-------------------+\n         |\n         |\n         |                   +-------------------+\n         |                   |                   |\n         +-------------------\u003e   Discount        |\n         |                   |                   |\n         |                   +-------------------+\n         |\n         |\n         |                   +-------------------+\n         |                   |                   |\n         +-------------------\u003e   Pay             |\n                             |                   |\n                             +-------------------+\n```\n\nThis chapter is a per service zoom on the architecture\n\n## Items\nIt is a service contained in the subdirectory `./items`. It is written in PHP\nusing Expressive 3 as framework.\nIt contains and manage the items that you can buy from `shopmany`. MySQL is used\nas db.\n\nIn order to run it you can use `docker-compose`:\n\n```bash\ndocker-compose up item\n```\n\nJust curl the main entrypoint and you should see a list of items in JS : (it takes a couple of seconds to work because\nit loads data and it configures mySQL)\n\n```bash\n$ curl http://localhost:3001/item\n{\"items\":[{\"id\":0,\"name\":\"Octo Cup\",\"description\":\"The open cup movement is here. Join us.\",\"price\":12.99},{\"id\":1,\"name\":\"Kubernetes Spinner\",\"description\":\"Wait for a rolling update to go but with style.\",\"price\":6.5},{\"id\":2,\"name\":\"Prometheus Socks\",\"description\":\"A modern way to monitor \\u0027smells like feet\\u0027\",\"price\":4.1},{\"id\":3,\"name\":\"Google G - Short Sleeve\",\"description\":\"The best way to make your lovely baby the smarter search engine ever.\",\"price\":18.23}]}\n```\n\n## Discount\nDiscount uses mongodn as backend and it is an application in NodeJS capable of\ngiving back the discount % that should be applied to a specific item.\n\n```bash\ndocker-compose up discount\n```\n\nCheck it out\n\n```bash\n$ curl http://localhost:3003/discount?itemid=1\n{\"discount\":{\"_id\":\"5c94be9d9643d4cbd88a7cb4\",\"itemID\":1,\"dropOffPercent\":50}}\n```\n\n## pay\nPay is a java service that manages the purchase of a set of items from a\nspecific customer. It uses SpringBoot as framework and MySQL as backend\n(probably).\n\n```\ndocker-compose up pay\n```\n\nCheck it out\n```\n$ curl http://localhost:3002/pays\n[]\n```\n\n## Frontend\n\nFrontend is an HTMP/CSS/JS application serviced by a Go HTTP Server.\nThe Go HTTP Server is also used as API to serve proxied content from the other\nmicroservices like `pay`, `item`, and `discount`.\n\n```\ndocker-compose up frontend\n```\n\nCheck it out `http://localhost:3000` using your browser\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianarb%2Fshopmany","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgianarb%2Fshopmany","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianarb%2Fshopmany/lists"}