Skip to content
Rebecca Brown edited this page Dec 11, 2024 · 22 revisions

Welcome to the oneclick-ionic-ui wiki!

Initial setup

This will help ensure a developer has all the npm packages necessary to create a new project or start a new project.

Optional: Install NVM

STRONGLY RECOMMENDED!!

Ionic will not build with the newer versions of Node so using a version manager might be necessary so that you can have an older Node version available. Use nvm to switch to correct version before running any build or install commands. See below for Node versions required.

If you have multiple projects running varying versions of Node already, then installing a Node Version Manager maybe useful. See below for links:

Install NodeJs

Test if you already have NodeJs by running

node -v

At the time of writing you should have at least v16.20.1(current working version Node@22.11.0 as of 2024/11/22). If that doesn't return a result install NodeJS.

If you NodeJs is out of date then check the Install NVM Section for details on installing a version manager for Node.

Note that as of NodeJs version 0.6.2, npm comes bundled with NodeJs, so if you don't have npm installed, you are probably on a "too old" version of Node.

Install Ionic CLI

Test if you already have Ionic by running

ionic -v

At the time of writing you should have at least 7.1.1. If Ionic is out of date or not installed run: npm install -g @ionic/cli or sudo npm install -g @ionic/cli

Install Other Dependencies

Run npm install

Make sure you are currently using the correct version of Node in your command window.

This should auto-generate or auto-update the package-lock.json so if it doesn't do that, then check the log of your terminal.

Running the application

There are deploy scripts set up to make running or deploying the application easy. These scripts are individualized for each client that uses this UI. Here I will use the ExampleClient client as the example client. The main deploy folder has subfolders (one for each client).

For local development on your personal laptop, run the script from a command window after navigating to the desired client's configuration folder (for example deploy/example-client):

./example-client-local.sh

This "local" script will configure the application for a local environment (possibly a locally hosted backend API) and will automatically launch the command ionic serve to launch the application on a local web server.

The full deploy scripts with all values are now located in https://github.com/camsys/oneclick-ui-devops private repo. In this repo, a sanitized example is included.

Adding new localization keys

This application uses i18n localization. Sometimes, a new key must be added to support a new feature or to change an existing piece of functionality. When a new key is required, a "json migration" file must be created in the deploy\i18n-migrations folder. This file should contain json with the new key-value pairs. To immediately see the results on your local deployment, those new pairs can be added to the en.json file for each client but the formal dev, qa, prod deployment steps here will describe the process for including them for those environments.

Git Process

Every feature will use its own feature branch. When a feature branch is merged into develop, the version number should be increased. The merge should squash the commits from the feature branch and include a 'release notes worthy' commit message. When a small feature or bug is fixed in a single commit, it can be committed directly to the develop branch but should also increase the version number. The major number should be increase when a major overhaul or breaking change is introduced. The minor number should be updated with each new feature or large bug fix. The patch number should be increased for small items or bug fixes. Every commit to the develop branch or release branch should include a version increase of some kind! Any commits to the release branch should use a 'release candidate' number (rc-X) so it won't interfere with versioning on develop. Any parallel work not happening as part of the release should be held in a feature branch until the release branch is merged back into develop.