# CAME-ACCESS

UI application used in entry/exit and pay terminals PK-ACS system

## Overview

![virtual printer](/docs/virtualPrinter.png)
![config page](/docs/config.png)
![settings page](/docs/settings.png)
![custom translations](/docs/customTranslations.png)
![tarifs](/docs/tarifs.png)
![appBehaviour](/docs/appBehaviour.png)
![pay in lane](/docs/payInLane.jpg)
![pay in lane emv](/docs/payInLaneScanTicket.jpg)

## Workerwindow network

In order to improve the performance of the UI window (mainWindow) we have a hidden window that is not connected to webPack.
For this we need to copy all the files to /release/app/.. and then add the into main package.json 'ExtraResources'.
We also need to add them in the same package.json under '[build] [file]'.

Then in the main.ts file we need to setup a particular way of loading the window file:

```typescript
const prodPath = path.join(__dirname, '../../../release/app/workers');
const prodWorkerHtml = path.join(prodPath, 'workerNetwork.html');
const workerHtml = app.isPackaged
  ? prodWorkerHtml // We are in production with a packaged app
  : path.join(webpackPaths.appPath, 'workers/workerNetwork.html'); // We are in dev

workerWindowNetwork.loadFile(workerHtml);
```

## Build native deps on raspberry

When having issues with serialport native deps on raspberry;

Install node gyp packages globally;
sudo npm install -g node-gyp node-pre-gyp

Enter the serial port bindings cpp dir.
cd node_modules/@serialport/bindings-cpp

run the command to compile module
sudo node-gyp configure build

install deps in root folder using: npm install --build-from-source --force

## Boilerplate readme: Install

Clone the repo and install dependencies:

```bash
git clone --depth 1 --branch main https://github.com/electron-react-boilerplate/electron-react-boilerplate.git your-project-name
cd your-project-name
npm install
```

**Having issues installing? See our [debugging guide](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/400)**

## Starting Development

Start the app in the `dev` environment:

```bash
npm start
```

## Packaging for Production

To package apps for the local platform:

```bash
npm run package
```

## Docs

See our [docs and guides here](https://electron-react-boilerplate.js.org/docs/installation)
