ODK Central Frontend uses Vue.js to provide the frontend for ODK Central. It is currently under development.
First, install Node.js 12+.
Next, install dependencies by running npm install
.
Install NGINX. Depending on your operating system and how you install NGINX, you may need to change the absolute paths in ODK Central Frontend's nginx.conf
.
You will also need to set up ODK Central Backend.
Follow these instructions to run ODK Central Frontend in development. For deploying to production, see the next section.
First, run ODK Central Backend.
Next, build ODK Central Frontend files for development by running npm run dev
. The files will be outputted to dist/
. As you update the source code, the files will be automatically rebuilt.
Finally, run NGINX by changing the working directory to the root directory of the repository, then typing the following:
nginx -c "$PWD/nginx.conf" -p "$PWD/dist/"
We specify -p "$PWD/dist/"
so that relative paths in nginx.conf
are relative to dist/
.
NGINX effectively places ODK Central Frontend and ODK Central Backend at the same origin, avoiding cross-origin requests.
ODK Central Frontend will be available on port 8989.
To build ODK Central Frontend files for production with minification, run npm run build
. The files will be outputted to dist/
. For more details on this command, see the documentation for Vue CLI.
For more information on deploying to production, see the ODK Central repository.
To run unit tests, type npm run test
.
For linting, run npm run lint
. We use rules based on the Airbnb JavaScript style guide.