# Web Configurator 2.X

A generic configurator.  

This is first used for discussing and defining the content of a new configurator. We expect then to export the data to the old system while improving this frontend to completely replace the old frontend.

### Deployment
 - Increase the package number.
 - Select the production variables in these files:
   - /data/paths.js
 - Merge your changes to master.
```
npm run build

```
 - *NEVER DELETE THE author_data ON THE FTP SERVER!* This folder contains all the data of the projects. It is likely not backed up anywhere else and only a paid backup from Hostpoint can restore it.
 - Upload the contents of the build folder to hostpoint
 - Also copy the contents of the build/add_on_build to the same folder
 - Test these links
   - https://konfigurator.tend.ch/edit/gen (Should show a configurator in edit mode)

---

### Branches
 - develop - stable development branch
 - master - deployment branch
 - einsie-pixelstreaming - development branch for pixelstreaming test case einsiedlerhof

---

# Documentation

### Naming Conventions
By exploring the html of the deployed website, you can easily find the relevant script.

 - *RG*ComponentsFileName - Prefix RG: The component is part of the Design System.
 - UpperCamelCaseComponent - Upper Camel Case: This is a component with its own script.
 - lowerCamelCaseComponent - Lower Camel Case: This is a component without its own script. Go up the hierarchy to find the next UpperCamelCaseComponent. The component should be in that script.

### Additional File Structure
 - public/add_on_build - Files that are not part of the build process but need to be uploaded to the server.
 - public/author_data - Content of projects. *NEVER REPLACE THESE FILES ON THE SERVER!*. You will likely want to copy projects from the server to your local author_data folder.
 - public/php - Any functionality for the configuratorAPI and other services to easier work with the data on the FTP server.
 - mails - Template for testing mailing. The configuratorAPI has a branch that successfully sent mails.

### Action keys
Action key can be used in variant to trigger defined action when the variant is selected.
Actions:
 - *open-cart-page* - opening cart page.

### Email message replacements
Use defined key {in mustache} in configurator to replace with:
 - {configuration-link} - replace with url address of the configuration with code included.


### More
 - You can find more information in the [internal Knowledge Base](https://knowledge.raumgleiter.com/docs/knowledge-base/configurator/) and the [external Knowledge Base](https://tendapp.notion.site/Alles-zum-Konfigurator-9c169482e6c64a2983bc06f3202bb047?pvs=4).