jnm / enketo-dev

Non-Docker Enketo dev using minimal Dockerized KoboToolbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🦨

this is not an official kobotoolbox repository, okay?

enketo-dev

have your Enketo and develop it, too!

goal

As a developer, I would like to run things I don't change inside Docker (KoboToolbox and associated databases, and Redis). I would like full, manual control over running code that I do change (Enketo Express). I would like simplicity in configuration with sensible defaults and a minimum of mandatory customization. If this sounds like a topsy-turvy kobo-no-docker, that's because it is :)

getting started

  1. clone this repository
  2. execute first-run.sh, which will:
    • pull docker images
    • start databases
    • run kpi and kobocat database migrations
    • prompt you to create a superuser
    • remind you that you shouldn't test things as a superuser :)
  3. docker-compose up, which should yield:
    • kpi running on 10.6.7.1:8006
    • kobocat running on 10.6.7.1:8007
    • postgres, on 10.6.7.1:60666
    • redis, on 10.6.7.1:60667
    • mongo, on 10.6.7.1:60668
  4. set up an Enketo (javascript) development environment!
    1. clone https://github.com/enketo/enketo-express
    2. 🎯 copy the file enketo-config.json to config/config.json inside your enketo-express clone
    3. cd into your enketo-express source directory
    4. nvm use 16, or whatever you cool kids like
    5. important: npm install -g npm@6 (why?)
    6. npm install
      • don't be surprised if "extract:rxjs" appears to be stuck for seven or more minutes
    7. npx grunt develop
    8. now Enketo should be running on port 8005 (at 10.6.7.1 as well as all your other IPs!)
  5. test it out
    1. log into kpi at http://10.6.7.1:8006/
    2. create and deploy a new form
    3. verify that it opens in Enketo
    4. make some change to Enketo: for example, modify console.log('autosave successful') in public/js/src/module/controller-webform.js
    5. watch for Enketo to automatically reload with your changes

hints

  • django is set to use the console email backend, so you can do things like create user accounts and read the activation email details right from the logs of the kpi container, i.e. docker-compose logs -f kpi

nasties

  • some things just don't work without nginx (like serving attachments? need to confirm)

About

Non-Docker Enketo dev using minimal Dockerized KoboToolbox

License:GNU Affero General Public License v3.0


Languages

Language:Shell 77.3%Language:JavaScript 22.7%