FAIMS3 is an open-source tool for offline field data-collection brought to you by the FAIMS Project. The FAIMS Project was funded by the ARDC ([https://dx.doi.org/10.47486/PL110]), Macquarie University, and CSIRO along with our other partners. This code is appropriate for building and deploying the Webapp, Android and iOS versions. The conductor, needed for user authentication, is located at [https://github.com/FAIMS/FAIMS3-conductor]. Contact [email protected] to enrol to try out the software.
Before you do anything (apart from cloning this repository), you should run
npm installto get all the dependencies for the scripts installed (If you have been doing some development, either stashing or committing your changes before running
npm install` would be wise).
Once the dependencies are installed, you should check any changes that have been made, and commit them if needed.
There are a number of helper scripts (which can be seen in the package.json
),
but the ones that should always exist
are:
npm run build
: builds the webapp (not the Android/iOS apps)npm run test
: runs the main test suitenpm run serve
: runs the webapp in a browser (currently via capacitor's system, to ensure that the webapp and the phone apps are as similar as possible).npm run start
: runs the webapp in a browser (unoptimized dev build).
You should also be aware of the cli interface to capacitor, as that does the building/management of the Android/iOS apps.
Further build/install instructions can be found at https://github.com/FAIMS/FAIMS3/wiki/building-the-webapp.
- Install Docker desktop.
- Create a new
Dev Environment
. - When prompted for
Existing Git repo
add the FAIMS3 git repo web address. - Click on
Open in VSCode
which will open your new container. - Then follow
Setup and development (quick-start)
steps inside of the VSCode which was opened.
- Install docker with brew using
brew install docker
. - Clone repository to your local machine.
- Spin up a new Ubuntu container with your local machine location of the repository and give it a CONTAINERNAME of your choice
docker run -dt -v /LOCAL_REPO_LOCATION:/opt/projects -p 3000-4000:3000-4000 --name CONTAINERNAME ubuntu /bin/bash
- Check the container was created successfully with
docker container list -a
. - If successfully enter the container environment using
docker exec -it CONTAINERNAME bash
- Update linux package sources list to the latest and upgrade the current packages installed to latest versions with
apt update && apt upgrade
, typey
and press enter for any prompts to allow installs to use disk space. - Install curl and fetch node with
apt install curl
thencurl -fsSL https://deb.nodesource.com/setup_16.x | bash -
to fetch node and make it visible to bash. - Install required tools for the project to run with
apt install gcc g++ make nodejs
which installs GNU Compiler Collection, GNU c++ compiler, Make unix utility and Nodejs. - Enter project folder
cd /opt/projects
. - Now follow
Setup and development (quick-start)
.
- To exit container use
exit
command. - To stop container use
docker stop CONTAINERNAME
- To remove container use
docker rm CONTAINERNAME
The server_configs
directory contains scripts for some of the
development servers, but primarily exporting:
export REACT_APP_DIRECTORY_HOST=<couchdb_host_name>
export REACT_APP_DIRECTORY_PORT=<couchdb_port>
will allow you to choose which couchdb instance to use. Remember to add the
host-port pair of the system the FAIMS app is running on (in most cases
localhost:3000
) to the CORS allow list via the Fauxton running on the couchdb
server (located at https://<couchdb_host_name>:<couchdb_port>/_utils/
).
- Build the source code
npm run webapp-build
- Synchronise Gradle files
npm run webapp-sync
ORcap sync
- [Optional] Allow to copy to /Library/Ruby/Gems/2.3.0:
export GEM_HOME="$HOME/.gem"
- [Optional] Resolve
xcode-select
errorsudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- Build the apk from the build/build bundle/build apk section