Virto Commerce Frontend is a single-page web application (SPA) with a fresh look on eCommerce solutions. This is where common B2B and B2C scenarios are combined with the most bleeding-edge technologies to deliver blazing-fast and fully functional solutions. It implements common business use cases needed for a vast majority of projects we build.
Virto Commerce Frontend is designed to be used as-is within the actual Virto Commerce Platform. You can modify it by implementing desired components, pages, and shared logic to correspond with your project goals.
- Vue3. Progressive frontend framework with its key features allows to build fast applications.
- Typescript. All components and composables have type definitions, so IDE can help you to build clean and working code.
- TailwindCSS. The most popular and growing CSS framework provides a wonderful flexible structure to speed up styling.
- Husky + ESLint + Prettier. Autoformat, check and fix your code and prevent ugly code style within the repository.
- Vite. It is faster than Webpack. Really FASTER. Use it to develop with HMR benefits and to build for production.
- GraphQL. Forget about REST, use flexible GraphQL queries and mutations to safely work with the backend.
- Development performance. Really fast development using the most effective solution. Enrol SPA in seconds and start to modify code with HMR features.
- Client performance. We are supposed to reach and hold green metrics provided by Google PageSpeed Insights.
- Atomic Design Pattern. The Frontend Application UI is based on Atoms, Molecules and Organisms, combined within Pages and shared Components. This provides a high level of code reusability.
- Fully responsive. We made our Frontend Application work on multiple devices from Desktops to Mobile phones, concentrating both on UI and UX.
- Simple styling and customization. We use TailwindCSS to provide the easiest and most convenient way of CSS usage. Write as less of code as possible, and reuse existing highly customizable framework features.
- Fully aligned with Virto Commerce Platform. The SPA is fully aligned with the Virto Commerce Platform to provide all common B2B and B2C scenarios.
βββ assets // Scripts, styles and other assets compiled and minified for production.
|
βββ client-app // The main folder for the application.
| βββ assets // Assets needed to be precompiled during building.
| | βββ...
| |
| βββ core // Common utilities and shared logic that can be used by any pages and libraries.
| | βββ api/graphql // GraphQL Models aligned with the Virto Backoffice.
| | | βββ...
| | βββ composables // Core composables (app-level shared logic).
| | | βββ...
| | βββ directives // Core Vue directives.
| | | βββ...
| | βββ plugins // Core Vue plugins.
| | | βββ...
| | βββ enums // Core enums.
| | | βββ...
| | βββ types // Core types.
| | | βββ...
| | βββ utilities // Some miscellaneous utils.
| | | βββ...
| | βββ constants.ts // Global-available constants (DO NOT USE, will be removed later).
| |
| βββ pages // Set of application pages used within Application router.
| | βββ...
| |
| βββ public // Statically served files
| | βββ static
| | βββ icons // Icons used for favicons, PWA, etc.
| | βββ images // Static images used inside the application.
| |
| βββ router // SPA routing configuration.
| | βββ...
| |
| βββ shared // A set of shared files grouped by their domain context.
| | βββ catalog // Grouping context (ex.: catalog browsing).
| | | βββ components // The collection of components specific for this domain context.
| | | | βββ...
| | | βββ composables // The collection of shared logic written using Composable API pattern.
| | | | βββ...
| | | βββ types // Types used in this context.
| | | | βββ...
| | | βββ utils // Utilities and helpers specific for this context.
| | | | βββ...
| | | βββ index.ts // Entry point for this context used as library.
| | |
| | βββ...
| |
| βββ ui-kit // Atoms, Molecules, Organisms and their types, used within the whole application.
| | βββ...
| |
| βββ App.vue // Main Application component. Use it as a wrapper for routable pages.
| βββ env.d.ts // Definition file to provide IDE IntelliSense support.
| βββ main.ts // Application entry point. Main initialization script.
| βββ shims-acceptjs.d.ts // Definition file to provide IDE IntelliSense support for Accept.js (Authorize.net).
| βββ shims-graphql.d.ts // Definition file to provide IDE IntelliSense support for importing *.graphql files.
| βββ shims-vue.d.ts // Definition file to provide IDE IntelliSense support for importing *.vue files.
| βββ vue.d.ts // Definition file to provide IDE IntelliSense support for additional global Vue properties.
| βββ vue-router.d.ts // Definition file to provide IDE IntelliSense support for additional global Vue Router properties.
|
βββ config
| βββ menu.json
| βββ settings_data.json
|
βββ locales // Locale files used to provide translated content.
| βββ...
|
βββ scripts // Auxiliary build files that run in the Node environment.
| βββ...
|
βββ .babelrc // Babel configuration for storybook
βββ .browserslistrc // Browserslist config file to support actual versions of browsers.
βββ .commitlintrc.json // Config for Conventional commit hook.
βββ .dependency-cruiser.cjs
βββ .dependency-graph.cjs
βββ .editorconfig // Common editor settings to sync codestyle.
βββ .env // Envfile to define different Environment Variables.
βββ .env.local // Local envfile to override Environment Variables.
βββ .eslintignore // Ignore some files from ESlint.
βββ .eslintrc.cjs // ESlint configuration file.
βββ .gitattributes // Set attributes to specified path in Git.
βββ .gitignore // Ignore some files from Git.
βββ .npmrc // Node.js package manager settings and Node.js restrictions
βββ .prettierignore // Ignore some files from Prettier.
βββ .prettierrc.json // Config for Prettier.
βββ .yarnrc.yml // Yarn package manager configuration
βββ graphql-codegen
| βββ schema.ts // Configuration file to generate GraphQL schema.
| βββ generator.ts // Generate types based on schema.json
| βββ config.cjs // Environment configuration
βββ index.html // Vite Development entry point.
βββ LICENSE.txt
βββ package.json // NPM Package description.
βββ postcss.config.cjs // PostCSS configuration for Tailwind.
βββ README.md // This file.
βββ sonar-project.properties
βββ tailwind.config.ts // TailwindCSS configuration file.
βββ tsconfig.app.json // Typescript configuration for application.
βββ tsconfig.json // Main TypeScript configuration file.
βββ tsconfig.node.json // Typescript configuration for Node.js.
βββ tsconfig.vitest.json
βββ vite.config.ts // Vite configuration file.
βββ vitest.config.ts
βββ yarn.lock // Yarn dependencies lock file.
- Install
vc-platform
3.x the latest version: - Install Experience API / X-Api modules:
- The following modules should be installed for development (but not in production; this will be changed in the future):
- Install Node.js v22 (22.10.0 or later)
- Enable corepack (run as administrator on Windows)
corepack enable
- If you have installed
yarn
globally, uninstall it:- via
npm
npm uninstall --global yarn
- or through your Operation System installation tools
Control Panel
,Chocolatey
orScoop
on WindowsLaunchpad
,Finder
,Homebrew
orMacPorts
on macOs- Native package manager such as
apt
on Linux
- via
git clone https://github.com/VirtoCommerce/vc-theme-b2b-vue.git "C:\vc-theme-b2b-vue\"
yarn -v
Yarn
should be of version 4.1.0 or greater, not 1.XX.
yarn install
- Add new .env.local file
- Copy APP_BACKEND_URL from .env file and change it's value to the correct endpoint to
Virto Commerce Platform
:
# .env.local file
APP_BACKEND_URL=https://localhost:5001
- Run command:
yarn dev
oryarn dev-expose
- Follow the link in the terminal
yarn build
yarn build:dev
yarn build:watch
Command:
yarn generate:graphql
makes two steps:
- Downloads
schema.json
from GraphQL server located at theAPP_BACKEND_URL
- Generates the
types.ts
file separately for general modules and independent modules.
If independent modules are not installed on The Platform
, types can still be safely generated.
To examine the sizes of various chunks such as vendor.js
or index.js
, execute the following command:
yarn generate:bundle-map
The results will be located in the artifacts
folder.
To create a visual representation of the dependency graph, use the following command:
yarn generate:dependency-graph
Note: This command requires parameters to run successfully. For example:
yarn generate:dependency-graph client-app/main.ts client-app/shared/account/components/checkout-default-success-modal.vue
The generated graph will also be saved in the artifacts
folder.
If you encounter an error such as dot command not found
on Windows, ensure that Graphviz is installed on your system.
Copyright (c) Virtosoftware Ltd. All rights reserved.
Licensed under the Virto Commerce Open Software License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://virtocommerce.com/opensourcelicense
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.