Read-only mirror of https://github.com/FSO-PRICES/LIK-Preiserfassung — Swiss Federal Statistical Office - Prices. Issues & pull requests at the source.
  • TypeScript 77.4%
  • HTML 14.7%
  • SCSS 6.5%
  • JavaScript 1.2%
  • PowerShell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-08-07 11:05:33 +02:00
.vscode new version 2.4.1 2024-08-07 09:32:41 +02:00
apps Added license preamble text 2024-08-07 11:05:33 +02:00
build-apk-in-container new version 2.4.1 2024-08-07 09:32:41 +02:00
data-preparation new version 2.4.1 2024-08-07 09:32:41 +02:00
libs Added license preamble text 2024-08-07 11:05:33 +02:00
local-couchdb-setup new version 2.4.1 2024-08-07 09:32:41 +02:00
package-declarations new version 2.4.1 2024-08-07 09:32:41 +02:00
tools new version 2.4.1 2024-08-07 09:32:41 +02:00
.editorconfig new version 2.4.1 2024-08-07 09:32:41 +02:00
.envrc new version 2.4.1 2024-08-07 09:32:41 +02:00
.eslintignore new version 2.4.1 2024-08-07 09:32:41 +02:00
.eslintrc.json new version 2.4.1 2024-08-07 09:32:41 +02:00
.gitignore new version 2.4.1 2024-08-07 09:32:41 +02:00
.npmrc new version 2.4.1 2024-08-07 09:32:41 +02:00
.nvmrc new version 2.4.1 2024-08-07 09:32:41 +02:00
.prettierignore new version 2.4.1 2024-08-07 09:32:41 +02:00
.prettierrc new version 2.4.1 2024-08-07 09:32:41 +02:00
couchdb_permissions.ps1 Updated couchdb permissions scripts 2019-08-07 09:07:40 +02:00
couchdb_permissions.sh Updated couchdb permissions scripts 2019-08-07 09:07:40 +02:00
jest.config.ts new version 2.4.1 2024-08-07 09:32:41 +02:00
jest.preset.js new version 2.4.1 2024-08-07 09:32:41 +02:00
LICENSE.txt Updated README.md and renamed LICENSE 2018-08-15 10:17:41 +02:00
migrations.json new version 2.4.1 2024-08-07 09:32:41 +02:00
nx.json new version 2.4.1 2024-08-07 09:32:41 +02:00
package-lock.json new version 2.4.1 2024-08-07 09:32:41 +02:00
package.json new version 2.4.1 2024-08-07 09:32:41 +02:00
preamble-gpl-license-text.ts Added license preamble text 2024-08-07 11:05:33 +02:00
prepend-preample.md Improved license preamble doc 2018-08-14 14:18:34 +02:00
README.md update readme 2024-08-07 09:35:09 +02:00
tsconfig.base.json new version 2.4.1 2024-08-07 09:32:41 +02:00

BFS/Lik - Studio

Node Version: 20.5.0

App Setup

  1. Clone Git Repo
  2. git fetch
  3. npm ci
  4. npm install --global nx@latest
  5. Check if the apps are running nx serve backoffice nx serve preiserfasser

Capacitor Setup

  1. cd apps/preiserfasser npm ci (didn't work for me, had to use npm i)
  2. Add Android platform to the project nx run preiserfasser:add:android Yes when asked if @capacitor/cli@5.0.3 should be installed
  3. Is there an Android folder in apps/preiserfasser? Yes? Good.
  4. nx run preiserfasser:generate-capacitor-assets
  5. nx build preiserfasser
  6. nx run preiserfasser:sync:android --preserveProjectNodeModules

Java Installation

  1. go to https://www.oracle.com/java/technologies/downloads/#jdk17-windows and install the msi-installer for windows
  2. Run java -version to make shure Java JDK is installed

Android Command Line Tools

  1. Install the android command line tools and platform-tools next steps are from here: https://proandroiddev.com/how-to-setup-android-sdk-without-android-studio-6d60d0f2812a
  2. download the Command line tools only from https://developer.android.com/studio
  3. create a folder structure in your programm-root like this: android/cmdline-tools/tools and unzip all into this folder. f.e. c:\programms\android... or somewhere else
  4. add an env-variable to windows ANDROID_HOME=the path to the android folder you just created (not cmdline-tools)
  5. add this to the path variable: %ANDROID_HOME%\cmdline-tools\tools\bin and %ANDROID_HOME%\plattform-tools (maybe not necessary)
  6. open a new terminal and type sdkmanager, if you see something its good
  7. then: sdkmanager --install "platform-tools" sdkmanager --install "build-tools;28.0.3"

Debug APK

  1. cd into the lik studio project, then nx run preiserfasser:sync:android --preserveProjectNodeModules
  2. nx run preiserfasser:capacitor-debug-apk
  3. it downloads missing android-sdk stuff and when it works you have an unsigned apk in apps/preiserfasser/android/app/build/output/apk/debug

SIGNED APK

  1. copy the keystore file into the root of the project
  2. copy the .env file with the KEYSTORE_PW into apps/preiserfasser
  3. add %ANDROID_HOME%\build-tools\28.0.3 to the path env-variable
  4. run nx run preiserfasser:capacitor-sign-apk and cross your fingers...

IMPORTANT WHEN EVERYTHING IS RUNNING

If using Directory.Documents or Directory.ExternalStorage, in Android 10 and older, this API requires the following permissions be added to your AndroidManifest.xml:

Yes, we are using this in the app, so we need to add this to the AndroidManifest.xml in the apps/preiserfasser/android/app/src/main folder

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />