node version: 10.x

##17 June 2022
Devs use node version 12.13.0 to install dependencies and then node version 10.16.0 to run the gulp process

clone foundation-sites(6.5.3) into `/packages` directory

``$ npm install``

``$ npm start``

####Email Templates:
You can grab email templates from an existing email in your email client by
downloading the .eml file and using https://github.com/amitevski/eml_to_html.git
to extract the html. Just interpolate your variables.


Deploy New Build:

`$ meteor build ..\build\ --server-only ; scp ..\build\filmspace-meteor_react.tar.gz codeswop@filmspace.codeswop.com:~ ; ssh codeswop@filmspace.codeswop.com "tar -zxf filmspace-meteor_react.tar.gz -C filmspace/app/ && pm2 restart 0"`

Update pm2.json and restart app

`$ scp pm2.json codeswop@filmspace.codeswop.com:~/filmspace/app ; ssh codeswop@filmspace.codeswop.com "pm2 restart filmspace/app/pm2.json"`

Deploy New Build (filmspace.co.za):

`$ scp pm2.json codeswop@filmspace.co.za:~/app ; ssh codeswop@filmspace.co.za "pm2 restart app/pm2.json"`

`$ meteor build ..\build\ --server-only ; scp ..\build\filmspace-meteor_react.tar.gz codeswop@filmspace.co.za:~ ; ssh codeswop@filmspace.co.za "tar -zxf filmspace-meteor_react.tar.gz -C app/ && pm2 restart 0"`

### Upgrades Jan 2021

- Week 1 - (10 Feb - 15Feb) - US-5 - Filepull Overhaul / Download image.
- Week 2 - (16Feb - 22Feb) - US-2 Spaces Tags.
- Week 3 - (23 Feb - 03 Mar) - US-3 Search Page Mapping - CPT, JHB, DRB & GR.
- Week 4 - (04 Mar - 08 Mar) - US-4 Back-end user content override.
- Week 5 - (09 March - 11 March) - US-11 Host & Filmmaker Message Notifications & US-8 Zero Service Fees.
- Week 6 (12 March - 15 March) - US-7 Keep all comms on Filmspace block / US-6 Minimum Hours Tooltip / US-10 Listing process remove items / US-9 User Feedback Modal - Push to Log in / US-12 Intercom Chatbot.

Mysterious failure of build pipeline occurred. Could have been a deps conflict, but even after removing the only
package that was installed it still failed with errors that I couldn't relate to the package itself. Eventually fixed
by checking out last working commit and applying the same changes in app source and pushing to CI

### Docker Commands

Build
```shell
docker build -t everyspace:latest .
```
Run
```shell
docker run --rm -p 3000:3000 --name everyspace -d `
--env ROOT_URL=http://localhost:3000 `
--env MONGO_URL=mongodb+srv://codeswop:cmxa7N2GVDmSg%23L@filmspacecluster-2bflv.mongodb.net/filmspace_dev `
--env ACTIVE_CAMPAIGN_URL=https://filmspace.api-us1.com `
--env ACTIVE_CAMPAIGN_KEY=4d1db771fd55525fecf21f80e985998a070d9f8b6f65e28d3ec5ce5ff3ad9e25a62d7351 `
--env ACTIVE_CAMPAIGN_TRACK_KEY=55a0fb0386f7ab1d200fc2a6ba9a337535fcd728 `
--env ACTIVE_CAMPAIGN_TRACK_ACCOUNT_ID=649888565 `
--env DO_ACCESS_KEY=AKIAZXCQO5FZZY2X54VU `
--env DO_SECRET=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 `
--env MAIL_URL=smtps://hello@filmspace.co.za:fILMSPACEgENERAL19@smtp.gmail.com:465 `
everyspace
```
The newer meteor multistage build requires a different approach to build gitlab artifacts.

Too build the tar:

```shell
...
docker build -t everyspace:latest .
docker container create --name everyspace-app everyspace:latest
docker container cp everyspace-app:/app.tar.gz .
docker container rm everyspace-app
```

### DB
Restore Live to Local

```mongorestore -h 127.0.0.1 --port 3001 --db meteor ..\dump\filmspace```

Transform pricing schema

```mongo mongodb://127.0.0.1:3001/meteor .\db\scripts\pricing-migrate.js```

Transform pricing schema 2

```mongo mongodb://127.0.0.1:3001/meteor .\db\scripts\pricing-minMax.js```

Assign Random activities to listings to test search

```mongo mongodb://127.0.0.1:3001/meteor .\db\scripts\random-activities-for-testing.js```