{"id":15104910,"url":"https://github.com/carlocorradini/graphmarket","last_synced_at":"2025-09-27T02:32:38.603Z","repository":{"id":54535469,"uuid":"301173660","full_name":"carlocorradini/graphmarket","owner":"carlocorradini","description":"Online e-commerce API in GraphQL","archived":true,"fork":false,"pushed_at":"2021-02-12T09:28:43.000Z","size":18242,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-10T19:34:03.664Z","etag":null,"topics":["api","graphql","jest","nodejs","postgresql","redis","template","type-graphql","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/carlocorradini.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}},"created_at":"2020-10-04T16:25:44.000Z","updated_at":"2023-01-28T10:36:29.000Z","dependencies_parsed_at":"2022-08-13T19:00:52.552Z","dependency_job_id":null,"html_url":"https://github.com/carlocorradini/graphmarket","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/carlocorradini%2Fgraphmarket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlocorradini%2Fgraphmarket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlocorradini%2Fgraphmarket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlocorradini%2Fgraphmarket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlocorradini","download_url":"https://codeload.github.com/carlocorradini/graphmarket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234376917,"owners_count":18822416,"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","graphql","jest","nodejs","postgresql","redis","template","type-graphql","typescript"],"created_at":"2024-09-25T20:03:54.716Z","updated_at":"2025-09-27T02:32:37.683Z","avatar_url":"https://github.com/carlocorradini.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph Market\n\n[![Build](https://github.com/carlocorradini/graphmarket/workflows/build/badge.svg)](https://github.com/carlocorradini/graphmarket/actions)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/eab19cd392424e41afec10b001aaeadd)](https://www.codacy.com/gh/carlocorradini/graphmarket/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=carlocorradini/graphmarket\u0026utm_campaign=Badge_Grade)\n[![codecov](https://codecov.io/gh/carlocorradini/graphmarket/branch/main/graph/badge.svg?token=VKZLWJYNY2)](https://codecov.io/gh/carlocorradini/graphmarket)\n[![Known Vulnerabilities](https://snyk.io/test/github/carlocorradini/graphmarket/badge.svg)](https://snyk.io/test/github/carlocorradini/graphmarket)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcarlocorradini%2Fgraphmarket.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcarlocorradini%2Fgraphmarket?ref=badge_shield)\n\nGraph Market is an online E-commerce platform.\n\nSellers can publish their products, providing images and descriptions; users can browse such products and, upon registration, buy and review them.\n\nWhen a user registers themselves, Graph Market sends both an email and SMS key which are required to complete the registration process.\n\n[Read the report for more information](Graph_Market.pdf)\n\n**Members**:\n\n|  Name  |  Surname  |     Username     |    MAT     |\n| :----: | :-------: | :--------------: | :--------: |\n| Carlo  | Corradini | `carlocorradini` | **223811** |\n| Andrea |  Stedile  | `andreastedile`  | **220930** |\n\n## Architecture\n\nGraph Market has a Service-Oriented Architecture implemented by six microservices (Please also see section Distributed Scenario):\n\n- _Authentications_: Provides authentication and authorization facilities.\n  - Uses the Twilio API to deliver an SMS message containing a key involved in the registration process.\n  - Uses the SendGrid API to deliver an email containing a key involved in the registration process.\n- _Users_\n- _Products_: Uses Cloudinary to store product images uploaded by sellers.\n- _Inventories_\n- _Purchases_\n- _Reviews_\n\nA gateway acts as an entry point for GraphQL client requests, which are orchestrated and fulfilled by GraphQL Federation.\n\n[![Architecture](./images/architecture.png)](./images/architecture.png)\n\nNote that the image above is a bit deceptive: in principle, all services might have their own Cache Layer (i.e., their own Redis instance).\n\nFull quality PDF: [images/architecture.pdf](./images/architecture.pdf)\n\n## Source code organization\n\nGraph Market's uses [Lerna](https://lerna.js.org/) for managing its various packages. A package either implements an individual microservice or other common functionalities.\n\n## Build and run (single host)\n\nIn the following, we explain how to build and run Graph Market's services on a single host. We assume a database and a Redis instance are already running on the machine.\n\nClone the repo:\n\n```bash\ngit clone https://github.com/carlocorradini/graphmarket\ncd graphmarket\n```\n\nInstall the dependencies and build the packages:\n\n```bash\nnpm ci\nnpm run bootstrap\n```\n\nTo properly configure a service, you must define its environment. Rename each package's _.env.example_ to _.env_ and edit it, according to your needs. You can, for example:\n\n- Adjust the database URL,\n- Change the port on which a service is started,\n- Specify keys for the service adapters (e.g., Twilio).\n\nStart the services:\n\n- In development mode:\n  ```bash\n  npm run start:dev:services\n  ```\n- Or in production mode:\n  ```bash\n  npm run start:services\n  ```\n\nStart the gateway:\n\n- In development mode:\n\n  ```bash\n  npm run start:dev:services\n  ```\n\n- Or in production mode:\n\n  ```bash\n  npm run start:services\n  ```\n\nThe services should start and complete the startup phase before the gateway. When the gateway starts, it runs a health check procedure that checks for each service's availability. After 3 failed attempts, the procedure raises an error, thus preventing the gateway to start.\n\nIn development mode, you might want to load the database with some data. To do so:\n\n```bash\ncd scripts\n./delete.sh\n./load.sh\n```\n\n## Build and run (distributed scenario)\n\nIn principle, simulating and testing a distributed set of services could be done using Docker and Docker Compose (with a limitation: all services would belong to the same subnet). Docker would also be beneficial as it would remove the barrier \"it works on my computer\", thus providing repeatability guarantees.\n\nHowever, Docker support was not provided step-by-step from the beginning, thus making a bug-free provision impossible. Docker support could be added in the future.\n\nDocker-related files are kept in a dedicated branch called `docker`.\n\n## Build and run the website\n\nThe website's code is hosted under the _website_ directory. Build and launch it:\n\n```bash\ncd website\nnpm ci\nng serve --open\n```\n\nTo configure the website, edit its environment, inside the _src/environmets_ directory.\n\n## Tests\n\nFrom the project's root directory:\n\n```bash\nnpm test\n```\n\nAnd:\n\n```bash\nnpm run coverage\n```\n\n## License\n\nMIT\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcarlocorradini%2Fgraphmarket.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcarlocorradini%2Fgraphmarket?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlocorradini%2Fgraphmarket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlocorradini%2Fgraphmarket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlocorradini%2Fgraphmarket/lists"}