Skip to content

Latest commit

 

History

History
145 lines (99 loc) · 6.45 KB

README.md

File metadata and controls

145 lines (99 loc) · 6.45 KB

Capture Lite

Get it on Google Play Get it on Google Play

branch build coverage quality
master build Codacy Badge Codacy Badge
develop build Codacy Badge Codacy Badge

Getting Started

Node 16.2.0+ and NPM 7.13.0+ is required.

Install the dependencies.

npm i

Set the system environment variables NUMBERS_STORAGE_BASE_URL, NUMBERS_STORAGE_TRUSTED_CLIENT_KEY, NUMBERS_BUBBLE_DB_URL, BUBBLE_API_URL and APPS_FLYER_DEV_KEY before building the app by appending the following string in ~/.profile:

export NUMBERS_STORAGE_BASE_URL="THE PRIVATE BASE URL"
export NUMBERS_STORAGE_TRUSTED_CLIENT_KEY="THE TRUSTED CLIENT KEY"
export NUMBERS_BUBBLE_DB_URL="THE BUBBLE DB URL"
export BUBBLE_API_URL="BUBBLE API URL"
export APPS_FLYER_DEV_KEY="APPS FLYER DEV KEY

Preview the app in web browser.

npm run serve

Development

Start a local dev server for app dev/testing.

npm run serve

Run tests.

npm run test

Run tests in headless mode.

npm run test.ci

Lint the projects.

npm run lint

Update cordova-res (splash screens and launcher icons).

cordova-res android --skip-config --copy

Contribution

  • Run npm run lint before each commit.
  • The committed codes should pass all GitHub checks.
  • Use Visual Studio Code with workspace settings for consistent coding style.
  • Use Prettier extension to auto format on save.
  • Prefer Promise than Observable when only emitting one value. See issue #233.
  • Avoid using toPromise() to convert Observable to Promise as it is an anti-pattern.

Platform

Android

If your operating system is Linux, set the environment variable CAPACITOR_ANDROID_STUDIO_PATH for your Android Studio. The default value is /usr/local/android-studio/bin/studio.sh.

export CAPACITOR_ANDROID_STUDIO_PATH="/home/username/android-studio/bin/studio.sh"

Before running the app with Android Studio, build and sync the dependencies and web assets.

npm run build
npx cap sync android

Open the project in Android Studio.

npx cap open android

The script does the same thing for you.

npm run build.android

Caveat

  • This app is still in the experimental stage.
  • This app uses raw file system to save proofs, and thus the performance is not optimized.

Release

See the Capture App release flow (Miro).

Some nodes below:

Bump version in package.json.

{
  "version": "a.b.c"
}

Bump version in android/app/build.gradle.

android {
    defaultConfig {
        versionCode <versionCode++>
        versionName "a.b.c"
    }
}

Run npm i to update package-lock.json.

Write the changelog in CHANGELOG.md.

When push to the master branch with new version tag, GitHub Action would automatically do the following jobs:

  1. Create release GitHub page with debug APK.
  2. Publish the app to Play Console on alpha track and Apple Store.
  3. Send notification to the private reminder-releases slack channel.