# Loehn Application Desktop
## Technologies:
- Electron v40.0.0
- Angular v18.2.14
- TypeScript v5.4.5
- NodeJS v18.x - v20.x

## Angular source repository
After 'init_angular' you have an angular source repository in the 'angular_src' folder.
You need to manual pull changes from the repository or init angular again to get the newest sources

**Attention:**
At this moment the script **init_angular** does not work on windows. Please copy the 'git clone' command in your node command prompt.

**Windows**
For development on windows please install the window-build-tools first https://github.com/nodejs/node-gyp#option-1
`npm install --global --production --vs2015 windows-build-tools`

## First start after pull
```
npm run init
```
```
npm run init_angular //or clone https://github.com/Bitsea/LoehnAngular.git into folder ./angular_src/ manually
```
## If you change something in package.json run
```
npm run build_angular_development
```

## Local Angular Development
```
npm run start_angular //this should be useless since we dont have any data on angular-only versions
```

## Run on local Electron instance:
```
npm run start
```

## Create mac app and upload to hockey app
Please follow this steps to create the app and upload it to hockeyapp
Prerequisites: git and curl must be installed additional to nodejs
1. Clone this git repository  **master branch** (git clone --branch master https://github.com/Bitsea/loehnapp.git)
2. Navigate into the new directory and loehn-application-desktop and initialize the project 'npm run init'
3. Initialize the angular repository 'npm run init_angular'
4. Create the app, zip it and upload it to hockeyapp 'npm run create_and_upload_staging_mac'

## Create mac app staging
```
npm run release_staging_mac
```
This command creates the staging app in a dmg install container


## Create mac app production
1. see 1Password "Löhn Mac - Notarize" -> edit notarize.js and enter appleId and appleIdPassword
2. Run:
```
npm run create_and_upload_prod_mac // <==== Notarization will take a while!!!
```
3. Create at zip from "./build_mac/LoehnApp-darwin-x64/" content



## Create win app and upload to hockey app
Please follow this steps to create the app and upload it to hockeyapp
Prerequisites: git and curl must be installed additional to nodejs
1. Clone this git repository  **master branch** (git clone --branch master https://github.com/Bitsea/loehnapp.git)
2. Navigate into the new directory and loehn-application-desktop and initialize the project 'npm run init'
3. Run the command to clone the angular repository manually. (git clone --branch master https://github.com/Bitsea/LoehnAngular.git angular_src)
4. Create the app, zip it and upload it to hockeyapp 'npm run create_and_upload_staging_win'

## Create win app staging
```
npm run release_staging_win
```
This command creates the staging app in a windows installer
## Create win app production
```
npm run release_production_win
```
This command creates the production app in a windows installer
