# Frontend
1) Either copy an existing site in `app-sites/`, rename folder and components, and delete unused components/modules or create a new site-folder and copy required modules and components (`mod.app`, `comp.app`).

2) Add `main.*site-name*.scss` file in `assets/styles/` and copy an `includes` folder in `assets/styles/includes` to include in the new main file. *This is also where colors and typography are changed*.

3) Add a new site folder in `assets/fonts` and add `font.css` file along with new font files.

4) Add new logo to header component and a new favicon in `assets/images/favicons`.

5) Update `app-settings/app-settings.ts` with the `name`, `website-id` and `urls` for the new site. (current website id's can be found [here](https://docs.google.com/spreadsheets/u/1/d/10SIPpjL4HnbY5WZbIslDgCrBT52l5bC6VK6ksEs80fI])


<br/>


# Server
1) Add DNS for the new website. **this should be done as soon as possible and with a low TTL as it is needed in a later step**.

2) **[terminal]** Create a new site folder in `var/www/*server-name*/public_html/` or simply copy an existing site and delete `node_modules` and everything in `/dist`. If the new site only exists on a seperate branch make sure to checkout to the new branch in all stores (`online`, `gardinbus`, and `butik`).

3) **[terminal]** Copy recipies from a site in `/var/www/settings/` and change values for each store to match your new site.

4) **[terminal]** List apache config files `ls -la /etc/apache2/sites-enabled/`. This will give you a list of all the used ports eg. `302x-jysk.conf` means that port 3020, 3021, and 3022 are used for `online`, `gardinbus`, and `butik` repectively.

5) **[terminal]** Create ecosystem files for the new site by going to `/ecosystems` and copying an existing site: `cp jysk *site-name* -ar`. Then change the name, path, and port for each store ecosystem file. Pick a port number higher than the current highest used port from the previous step. If `315x` is the highest, then use `316x`.

6) **[terminal/FTP]** Open the `.htacces` file located in `/var/www/*server-name*/public_html` either via the terminal or via FTP client, copy a rewrite-block and change the names to match your site:

````
###### JYSK REWRITES

###########################################
## Force root of jysk page to go to /jysk/online
## without adding anything else to the URL

RewriteCond %{HTTP_HOST} staging\.jysk\.klean\.dk [NC]
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d

## Admin Interfaces
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{REQUEST_URI} !^/wp
RewriteCond %{REQUEST_URI} !^/blocks

## PHP Services
RewriteCond %{REQUEST_URI} !^/checkout

## API and Backend
RewriteCond %{REQUEST_URI} !^/decoconfigurator
RewriteCond %{REQUEST_URI} !^/rogue
RewriteCond %{REQUEST_URI} !^/feed
RewriteCond %{REQUEST_URI} !^/translate
RewriteCond %{REQUEST_URI} !^/mage
RewriteCond %{REQUEST_URI} !^/rest
RewriteCond %{REQUEST_URI} !^/pub
RewriteCond %{REQUEST_URI} !^/setcart
RewriteCond %{REQUEST_URI} !^/datarate
RewriteCond %{REQUEST_URI} !^/payment
RewriteCond %{REQUEST_URI} !^/success/
RewriteCond %{REQUEST_URI} !^/lib
RewriteCond %{REQUEST_URI} !^/login
RewriteCond %{REQUEST_URI} !^/decosettings
RewriteCond %{REQUEST_URI} !^/receiptpayment
RewriteCond %{REQUEST_URI} !^/externalupdate

## Stores
RewriteCond %{REQUEST_URI} !^/butik
RewriteCond %{REQUEST_URI} !^/gardinbus

RewriteRule !^/jysk/online /jysk/online%{REQUEST_URI} [L,NC]



############################################
## Force page to redirect jysk traffic that isn't root
## to /jysk, where a second .htacess file distributes

RewriteCond %{HTTP_HOST} staging\.jysk\.klean\.dk [NC]
RewriteCond %{REQUEST_FILENAME} !-f

## Admin Interfaces
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{REQUEST_URI} !^/wp
RewriteCond %{REQUEST_URI} !^/blocks

## PHP Services
RewriteCond %{REQUEST_URI} !^/checkout

## API and Backend
RewriteCond %{REQUEST_URI} !^/decoconfigurator
RewriteCond %{REQUEST_URI} !^/rogue
RewriteCond %{REQUEST_URI} !^/feed
RewriteCond %{REQUEST_URI} !^/translate
RewriteCond %{REQUEST_URI} !^/mage
RewriteCond %{REQUEST_URI} !^/rest
RewriteCond %{REQUEST_URI} !^/pub
RewriteCond %{REQUEST_URI} !^/setcart
RewriteCond %{REQUEST_URI} !^/datarate
RewriteCond %{REQUEST_URI} !^/payment
RewriteCond %{REQUEST_URI} !^/success/
RewriteCond %{REQUEST_URI} !^/lib
RewriteCond %{REQUEST_URI} !^/login
RewriteCond %{REQUEST_URI} !^/decosettings
RewriteCond %{REQUEST_URI} !^/receiptpayment
RewriteCond %{REQUEST_URI} !^/externalupdate

RewriteRule !^/jysk /jysk%{REQUEST_URI} [L,NC]
````
7) **[terminal]** Run `buildConfig` in terminal and fill out the prompts. You will need the `url` and `port` for the new site. 
*if the DNS is not active yet, this step will fail as a SSL certificate can not be issued*