{"id":13578328,"url":"https://github.com/vuestorefront/vue-storefront-api","last_synced_at":"2025-04-05T16:32:20.163Z","repository":{"id":38974962,"uuid":"100790738","full_name":"vuestorefront/vue-storefront-api","owner":"vuestorefront","description":"Vue.js storefront for Magento2 (and not only) - data backend","archived":true,"fork":false,"pushed_at":"2023-03-30T18:40:21.000Z","size":10757,"stargazers_count":345,"open_issues_count":109,"forks_count":335,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-04-05T16:16:21.792Z","etag":null,"topics":["backend","elasticsearch","magento","product-catalog","redis","vue-storefront","vuejs2"],"latest_commit_sha":null,"homepage":"https://www.vuestorefront.io","language":"JavaScript","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/vuestorefront.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2017-08-19T11:43:49.000Z","updated_at":"2025-01-04T22:06:16.000Z","dependencies_parsed_at":"2024-04-08T16:12:14.512Z","dependency_job_id":null,"html_url":"https://github.com/vuestorefront/vue-storefront-api","commit_stats":null,"previous_names":["divanteltd/vue-storefront-api"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuestorefront%2Fvue-storefront-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuestorefront%2Fvue-storefront-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuestorefront%2Fvue-storefront-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuestorefront%2Fvue-storefront-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vuestorefront","download_url":"https://codeload.github.com/vuestorefront/vue-storefront-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247366616,"owners_count":20927547,"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":["backend","elasticsearch","magento","product-catalog","redis","vue-storefront","vuejs2"],"created_at":"2024-08-01T15:01:29.497Z","updated_at":"2025-04-05T16:32:15.152Z","avatar_url":"https://github.com/vuestorefront.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"REST API backend for vue-storefront\n===================================\n\n### Stay connected\n\n[![GitHub Repo stars](https://img.shields.io/github/stars/vuestorefront/vue-storefront?style=social)](https://github.com/vuestorefront/vue-storefront)\n[![Twitter Follow](https://img.shields.io/twitter/follow/vuestorefront?style=social)](https://twitter.com/vuestorefront)\n[![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCkm1F3Cglty3CE1QwKQUhhg?style=social)](https://www.youtube.com/c/VueStorefront)\n[![Discord](https://img.shields.io/discord/770285988244750366?label=join%20discord\u0026logo=Discord\u0026logoColor=white)](https://discord.vuestorefront.io)\n\nThis is a backend service for [vue-storefront](https://github.com/DivanteLtd/vue-storefront). Provides data access to product catalog (via ElasticSearch) and allows users to place orders into order queue (by default it's Redis queue supported via kqueue library).\n\n## Vue Storefront\n\nVue Storefront is a standalone [PWA](https://developers.google.com/web/progressive-web-apps/) (Progressive Web Application ) storefront for your eCommerce, possible to connect with any eCommerce backend (eg. Magento, Prestashop or Shopware) through the API.\n\nVue Storefront is and always will be in the open source. Anyone can use and support the project, we want it to be a tool for the improvement of the shopping experience. The project is still in the prove of concept phase. We are looking for Contributors and Designer willing to help us the the solution development.\n\nVue Storefront was build as a all-in-one front-end for eCommerce. For providing the best performance we decided to use Vue.js as a front-end library, Node.js + Express (and maybe GraphQL support) as a server-API, Elastic Search as a database of products and full PWA/off-line support.\nHere you can read more about the proof of concept for [Vue Storefront connected with Magento2](https://www.linkedin.com/pulse/magento2-nosql-database-pwa-support-piotr-karwatka).\n\nBesides a big improvement for the shopping experience, we also want to create a great code base for every developer who needs to work on a front-end application for the eCommerce.\n\n## Requirements\n\n- Docker and Docker Compose\n\nAlready included in `vue-storefront-api` Docker image (required locally, if you do not use containerization):\n- Node.js 10.x or higher\n- Yarn\n\n## Installation\n\n**Start a containerized environment**\n\nThe **legacy** (A) mode - starting just the Elastic and Redis containers:\n`docker-compose up -d`\n\nThe **standard** (B) mode - starting Elastic, Redis + Vue Storefront API containers:\n`docker-compose -f docker-compose.yml -f docker-compose.nodejs.yml up -d`\n\nAs a result, all necessary services will be launched:\n- Vue Storefront API runtime environment (Node.js with dependencies from `package.json`)\n- [ElasticSearch](https://www.elastic.co/products/elasticsearch)\n- [Redis](https://redis.io/)\n- Kibana (optional)\n\n**Import product catalog**\n\nProduct catalog is imported using [elasticdump](https://www.npmjs.com/package/elasticdump), which is installed automatically via project dependency. The default ElasticSearch index name is: `vue_storefront_catalog`\n\n- (A) `yarn restore`\n- (B) `docker exec -it vuestorefrontapi_app_1 yarn restore`\n\nThen, to update the structures in the database to the latest version (data migrations), do the following:\n\n- (A) `yarn migrate`\n- (B) `docker exec -it vuestorefrontapi_app_1 yarn migrate`\n\nBy default, the application server is started in development mode. It means that code auto reload is enabled along with ESLint, babel support.\n\nIt restores JSON documents stored in `./var/catalog.json`. The opposite command - used to generate `catalog.json` file from running ElasticSearch cluster:\n\n- (A) `yarn dump`\n- (B) `docker exec -it vuestorefrontapi_app_1 yarn dump`\n\n**Access ElasticSearch data with Kibana**\n\nA [Kibana](https://www.elastic.co/products/kibana) service is available to explore, search and visualize indexed data at the following url:\n\n`http://localhost:5601/`\n\nAt first access it will ask to specify an index pattern, insert `vue_storefront*`\n\n**Note:** Kibana is not provided with the Elastic 7 docker file. Please install it on your own when needed or check the [`es-head`](https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm) Chrome plugin.\n\n## Elastic 7 support\n\nBy default, Vue Storefront API docker files and config are based on Elastic 5.6. We plan to change the default Elastic version to 7 with the 1.11 stable release. As for now, the [Elastic 7 support](https://github.com/DivanteLtd/vue-storefront-api/pull/342) is marked as **experimental**. \n\n**How to use it?**\n\nIn order to use the new Elastic 7 please make sure your `vue-storefront-api` has been checked out from the [PR#342](https://github.com/DivanteLtd/vue-storefront-api/pull/342) branch.\nTo start the Elastic 7 docker service please use the `docker-compose.elastic7.yml` file provided:\n\n```bash\ndocker-compose -f docker-compose.elastic7.yml up\n```\n\nThen, please do change the `config/local.json` to start using the new Elastic API. Key properties in the `elasticsearch` section are: `indexTypes` and `apiVersion` (to be set to 7.1). If you're using the multistore configuration please make sure you adjusted the `storeViews.*.elasticsearch` section as well - per each separate store.\n\n```json\n  \"elasticsearch\": {\n    \"host\": \"localhost\",\n    \"index\": \"vue_storefront_catalog\",\n    \"port\": 9200,\n    \"protocol\": \"http\",\n    \"min_score\": 0.01,\n    \"indices\": [\n      \"vue_storefront_catalog\",\n      \"vue_storefront_catalog_de\",\n      \"vue_storefront_catalog_it\"\n    ],\n    \"indexTypes\": [\n      \"product\",\n      \"category\",\n      \"cms_block\",\n      \"cms_page\",\n      \"attribute\",\n      \"taxrule\",\n      \"review\"\n    ],\n    \"apiVersion\": \"7.1\"\n  }\n```\n\nStarting from [Elasitc 6 and 7](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html) we can have **just single** document type per single index. Vue Storefront used to have `product`, `category` ... types defined in the `vue_storefront_catalog`.\n\nFrom now on, we're using the separate indexes per each entity type. The convention is: `${indexName}_${entityType}`. If your' **logical index name** is `vue_storefront_catalog` then it will be mapped to the **physical indexes** of: `vue_storefront_catalog_product`, `vue_storefront_catalog_category` ...\n\n[Tools](https://docs.vuestorefront.io/guide/data/database-tool.html) are adjusted to ES7. You can use `yarn db new`, `yarn restore`, `yarn mage2vs import`. Just make sure that you have set up `config.elasticsearch.apiVersion` to `7.1`.\n\n## API access\nCatalog API calls are compliant with ElasticSearch (it works like a filtering proxy to ES). More on ES queries: [ElasticSearch queries tutorial](http://okfnlabs.org/blog/2013/07/01/elasticsearch-query-tutorial.html)\n\nElastic search endpoint: `http://localhost:8080/api/catalog/search/\u003cINDEX_NAME\u003e/`. You can run the following command to check if everything is up and runing (it assumes `vue_storefront_catalog` as default index name):\n\n`curl -i http://elastic:changeme@localhost:8080/api/catalog/vue_storefront_catalog/_search`\n\n## Data formats\nThis backend is using ElasticSearch data formats popularized by [ElasticSuite for Magento2 by Smile.fr](https://github.com/Smile-SA/elasticsuite).\n\n* [Product model](./src/models/catalog-product.md)\n* [Category model](./src/models/catalog-category.md)\n\n## Data migrations\nPlease use data migration mechanism provided to manipulate Redis, ElasticSearch or kue. Details: https://github.com/DivanteLtd/vue-storefront-api/tree/master/doc \n\n## Adding custom modules with own dependencies (Yarn only)\nWhen adding custom [Extensions to the API](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Extending%20vue-storefront-api.md) you might want to define some dependencies inside them. Thanks to [Yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) dependencies defined inside your custom module will be installed when you execute `yarn` at project root level, so it's way easier and faster than installing all modules dependencies separately.\n\nTo do this, define the `package.json` with your dependencies in your custom module:\n- `src/api/extensions/{your-custom-extension}/package.json` \n- `src/platforms/{your-custom-platform}/package.json`\n\nExecuting `docker exec -it vue-storefrontapiapp_1 yarn install` will also download your custom modules dependencies.\n\nNOTE: `npm` users will still have to install the dependencies individually in their modules.\n\n## Reviews\nTo use review feature you need to install custom module for Magento 2: [Divante ReviewApi](https://github.com/DivanteLtd/magento2-review-api)\nBy default new reviews will be added with status \"Pending\". \n```json\n  \"review\": {\n    \"defaultReviewStatus\": 2 \n  },\n```\n\n## Output Cache\nVue Storefront API supports output cache for catalog operations. Cache is tagged and can by dynamically invalidated. Please find the details how to configure it [in our docs](https://docs.vuestorefront.io/guide/basics/ssr-cache.html).\n\nYou can manually clear the Redis cache for specific tags by running the following command:\n\n```bash\nnpm run cache clear\nnpm run cache clear -- --tag=product,category\nnpm run cache clear -- --tag=P198\nnpm run cache clear -- --tag=*\n```\n\n## Running initial Magento2 import\n\nMagento2 data import is now integrated into `vue-storefront-api` for simplicity. It's still managed by the [mage2vuestorefront](https://github.com/DivanteLtd/mage2vuestorefront) - added as a dependency to `vue-storefront-api`.\n\nAfter setting the `config.magento2.api` section using Yours Magento2 oauth credentials:\n\n```json\n  \"magento2\": {\n    \"imgUrl\": \"http://localhost:8080/media/catalog/product\",\n    \"assetPath\": \"/../var/magento2-sample-data/pub/media\",\n    \"api\": {\n      \"url\": \"http://demo-magento2.vuestorefront.io/rest\",\n      \"consumerKey\": \"byv3730rhoulpopcq64don8ukb8lf2gq\",\n      \"consumerSecret\": \"u9q4fcobv7vfx9td80oupa6uhexc27rb\",\n      \"accessToken\": \"040xx3qy7s0j28o3q0exrfop579cy20m\",\n      \"accessTokenSecret\": \"7qunl3p505rubmr7u1ijt7odyialnih9\"\n    }\n  },\n```\n\nYou can run the following command to execute the full import:\n\n```bash\n yarn mage2vs import\n ```\n\n ... or in multistore setup You can run the same command with specified `store-code` parameter\n\n```bash\n yarn mage2vs import --store-code=de\n ```\n\n Import of CMS blocks and pages is also performed by the full import. If the CMS API extension ((SnowdogApps/magento2-cms-api)[https://github.com/SnowdogApps/magento2-cms-api]) was not installed in magento 2, it's recommended to skip the CMS import commands.\n\n```bash\n yarn mage2vs import --skip-blocks --skip-pages\n ```\n \n## Executing delta indexer\n\nYou can use the following command to run a delta indexer for a specific storeview:\n\n```\nyarn mage2vs productsdelta --store-code=de\n```\n\n## Self signed certificates\n\nOften in non production environment other services are using self signed certificates for secure connection.\nYou can easily setup the application to trust them by putting them in config/certs directory.  \n\nLicense\n-------\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvuestorefront%2Fvue-storefront-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvuestorefront%2Fvue-storefront-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvuestorefront%2Fvue-storefront-api/lists"}