Project Structure

A well-organized project structure makes shop integrations easier to build and maintain. This page describes the recommended layout based on the VARIO App Demoarrow-up-right, extended for shop and marketplace use cases.

Starting Point

Clone the demo app as your starting point:

git clone https://github.com/vario-software/vario-app-demo.git my-shop-app
cd my-shop-app
npm install
my-shop-app/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ index.js                          # App entry point
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ maintenance.js                # Install/uninstall endpoints
β”‚   β”‚   β”œβ”€β”€ webhooks.js                   # Webhook receivers
β”‚   β”‚   β”œβ”€β”€ orders.js                     # Order-related endpoints
β”‚   β”‚   β”œβ”€β”€ products.js                   # Product-related endpoints
β”‚   β”‚   └── mappings.js                   # Mapping configuration endpoints
β”‚   └── services/
β”‚       β”œβ”€β”€ inbound/                      # Platform β†’ ERP
β”‚       β”‚   β”œβ”€β”€ orders/
β”‚       β”‚   β”‚   β”œβ”€β”€ fetch.js              # Fetch orders from platform
β”‚       β”‚   β”‚   └── transform.js          # Transform to ERP format
β”‚       β”‚   β”œβ”€β”€ products/
β”‚       β”‚   β”‚   β”œβ”€β”€ fetch.js
β”‚       β”‚   β”‚   └── transform.js
β”‚       β”‚   └── customers/
β”‚       β”‚       β”œβ”€β”€ fetch.js
β”‚       β”‚       └── transform.js
β”‚       β”œβ”€β”€ outbound/                     # ERP β†’ Platform
β”‚       β”‚   β”œβ”€β”€ articles/
β”‚       β”‚   β”‚   β”œβ”€β”€ fetch.js              # Fetch from ERP via VQL
β”‚       β”‚   β”‚   β”œβ”€β”€ transform.js          # Transform to platform format
β”‚       β”‚   β”‚   └── sync.js               # Push to platform API
β”‚       β”‚   β”œβ”€β”€ stock/
β”‚       β”‚   β”‚   β”œβ”€β”€ fetch.js
β”‚       β”‚   β”‚   └── sync.js
β”‚       β”‚   β”œβ”€β”€ prices/
β”‚       β”‚   β”‚   β”œβ”€β”€ fetch.js
β”‚       β”‚   β”‚   └── sync.js
β”‚       β”‚   └── order-status/
β”‚       β”‚       β”œβ”€β”€ fetch.js
β”‚       β”‚       └── sync.js
β”‚       └── maintenance/
β”‚           β”œβ”€β”€ install.js                # Installation orchestrator
β”‚           β”œβ”€β”€ uninstall.js              # Cleanup logic
β”‚           └── migrations/
β”‚               └── 1/
β”‚                   └── index.js          # Initial migration
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html                        # Main UI page
β”‚   β”œβ”€β”€ install.html                      # Installation UI
β”‚   β”œβ”€β”€ script/
β”‚   β”‚   └── main.js                       # Frontend logic
β”‚   └── package.json                      # Frontend dependencies
β”œβ”€β”€ app-manifest.json                     # App metadata and permissions
β”œβ”€β”€ app-client.json                       # OAuth credentials (git-ignored)
β”œβ”€β”€ package.json
└── .gitignore

Key Directories

backend/routes/

Each route file handles a specific concern:

  • maintenance.js β€” Install, uninstall, and manifest endpoints. These are called by VARIO Cloud during the app lifecycle.

  • webhooks.js β€” Receives webhook notifications from the ERP (article updates, stock changes, etc.). Should respond immediately and process asynchronously.

  • orders.js β€” Endpoints for order import triggers and order-related operations.

  • products.js β€” Endpoints for product listing management.

  • mappings.js β€” CRUD endpoints for managing entity mappings (payment methods, shipping, categories, etc.).

backend/services/inbound/

Contains services that handle data flowing from the external platform into VARIO ERP. Each entity type (orders, products, customers) gets its own directory with:

  • fetch.js β€” Retrieves data from the platform API

  • transform.js β€” Maps platform data structures to the VARIO ERP format

backend/services/outbound/

Contains services that handle data flowing from VARIO ERP to the external platform. Each entity type gets:

  • fetch.js β€” Queries VARIO ERP data using VQL or the REST API

  • transform.js β€” Maps ERP data to the platform's expected format

  • sync.js β€” Pushes transformed data to the platform API

backend/services/maintenance/

Handles the app lifecycle:

  • install.js β€” Orchestrates the installation process (offline token storage, migrations)

  • uninstall.js β€” Cleans up app resources when the app is removed

  • migrations/ β€” Numbered migration directories that run sequentially during installation

frontend/

Static frontend assets served by the framework. No build step required β€” uses native ES modules and the framework's CSS.

Configuration Files

app-manifest.json

Defines your app's metadata, permissions, and UI integration points. For shop apps, you will need permissions for sales channels, articles, stock, prices, documents, EAV, and data imports. See the App Manifest for Shop Appsarrow-up-right reference.

app-client.json

Stores your OAuth credentials. This file must be git-ignored:

triangle-exclamation

package.json

Your root package.json should include the framework backend dependency:

The frontend package.json (in frontend/) includes the frontend framework:

Last updated

Was this helpful?