
### Setup
 - Make sure you have the [heroku installer](https://devcenter.heroku.com/articles/heroku-cli#install-the-heroku-cli) installed.
 - Add heroku as a remote:
   `heroku git:remote -a rgconfiguratorapi`

### Deployment
 - Increase the package number.
 - Select the production variables in these files:
   - /config/database.js
   - /src/external/rgprojectapi.js
 - Merge your changes to master.
```
cmd
"C:\Program Files\heroku\bin\heroku" login
git push heroku master
```
 - Test these links
   - https://rgconfiguratorapi.herokuapp.com/admin (Should bring you to the login)
 - If something doesn't work try ```npm login``` 

### Change Password
 - Make sure you are on the database server you think you are.
 - npm run strapi admin:reset-user-password

---

### Branches
 - develop - stable development branch
 - master - deployment branch
 - einsie-pixelstreaming - development branch for pixelstreaming test case einsiedlerhof
 - mail - development branch for mailing using the hostpoint SMTP server

 - Design System: configurator - development and deployment branch (fixes to old configurator versions would probably need reverse engineering or an upgrade to the latest design system version)

---

# Documentation

### File Structure
 - src/external - Logic to deal with external APIs such as getting the lists of files on the FTP server.
 - src/tools - More complex and reusable logic such as the logic that cleans up variants, etc. Code that will likely grow over time or requires especially modular encapsulation is in typescript.

### Logic
Please check the configurator-2 repository for documentation on the configurators logic.

### 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.