Skip to content

Latest commit

 

History

History

client

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Parsec client

This directory contains source code for Parsec client.

For general setup, take a look at development quickstart guide.

Install

Dependencies

npm install

Among other things, it installs Ionic / Vue / Capacitor CLI locally, you can use them with npx like this: npx ionic --help

This command will also automatically execute npm install in the electron directory, this is normally done by npx cap add @capacitor-community/electron, nevertheless since we have custom configuration in this folder, we can't override it.

Libparsec bindings

Follow this guide.

Tests

Unit tests

npm run test:unit

End-to-End tests

To run these tests, you first need to start the testbed server locally.

export TESTBED_SERVER="parsec3://localhost:6777?no_ssl=true"

Playwright

Install Playwright dependencies:

npx playwright install --with-deps

Then, run the tests with:

npm run test:e2e:headless

Web dev

Libparsec is not yet available on web platform :(

npm run web:open

Electron dev

# Update electron directory after main project changes
npm run electron:copy

# Update electron directory after main project changes and launch the desktop app
npm run electron:open

# Generate electron dist for release
npm run electron:dist
npm run electron:dist -- -- --dir  # To debug the generated payload
npm run electron:dist -- -- --linux snap  # To generate a subset (see `npx electron-builder build --help`)

The libparsec.node will be automatically copied by electron on build (see libparsec script defined in client/electron/package.json)

Android dev

# Update android directory after main project changes
npm run android:copy

# Update android directory after main project changes and launch an Android Studio project
npm run android:open

Libparsec is automatically (re)built as needed.

BONUS - How to start a blank Ionic project with Electron

# Pre-requirements
npm install -g @ionic/cli native-run cordova-res
# Location must be where you want the project folder
ionic start blank-project blank --type=vue --capacitor
pushd blank-project
npm install @capacitor-community/electron
# Ionic project must be build at least one time before adding capacitor plugins
ionic build
# Then we add the capacitor platforms
npx cap add @capacitor-community/electron
ionic cap add android
ionic cap add ios

Variables

Name Type Description Remark
PARSEC_APP_DEV_BMS_CREDENTIALS <email>:<password> Used as default login credentials for the BMS Only for development purposes! Avoid using : in your password as it will mess up the parsing.
PARSEC_APP_BMS_USE_MOCK boolean Used to mock calls to the BMS Only for development purposes!
PARSEC_APP_BMS_MOCKED_FUNCTIONS function1;function2;... Comma-separated list of functions from the BMS API to mock Only for development purposes!
PARSEC_APP_BMS_FAIL_FUNCTIONS function1;function2;... Comma-separated list of functions from the BMS API that should fail if mocked Only for development purposes!
PARSEC_APP_DISABLE_STRIPE boolean Disable Stripe and hide the customer area