erodneyCorus / opendp-ux

user experience for OpenDP MVP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The OpenDP Web Application

Building with Docker Compose

  1. Clone the repo and cd into the directory.

    git clone https://github.com/opendifferentialprivacy/opendp-ux.git && cd opendp-ux

  2. Tell Docker to turn on the webserver and database:

    docker-compose up

    If major configuration changes have been made (new dependencies, etc.) then the containers will need to be rebuilt:

    docker-compose up --rebuild

  3. All subsequent commands should be run from the server directory

    cd server

  4. The first time you run (or anytime schema changes have been made) you need to run migrate manually:

    docker-compose run server ./migrate.sh

    (In general, any command can be run by adding "docker-compose run server" to the beginning, such as:

    docker-compose run server python manage.py shell

which will drop you into the Django shell on the Docker container.)

Running without Containers (not recommended)

  1. Clone the repo and cd into the directory. git clone https://github.com/opendifferentialprivacy/opendp-ux.git && cd opendp-ux
  2. Create virtual environment: python3 -m venv venv
  3. Activate virtual environment: . venv/bin/activate
  4. Install requirements: pip install -r requirements.txt
  5. Ensure latest version of npm: npm install -g npm@latest
  6. Install Vue.js project dependencies: cd opendp-ux/client && npm install
  7. Run the Vue.js dev server: cd opendp-ux/client && npm run serve
    • build for production: npm run build
  8. cd server/
  9. First time, run migrations: python manage.py migrate
  10. Run Django dev server: python manage.py runserver
  11. Open http://127.0.0.1:8000/ in your browser.

Accessing the API

  1. Follow steps 1-5 under Running, above
  2. Open http://127.0.0.1:8000/api/ in your browser.

Accessing the API via command-line

  1. Access your command-line terminal
  2. Issue a HTTP command for the API area of interest. This example uses curl to issue the HTTP command. Note that the port you specify should match the port in the output of step 5 under Running, above
curl http://127.0.0.1:8000/api/
curl http://127.0.0.1:8000/api/users/

(This is based on an existing project by EugeneDae. See his project for original documentation.)

Generating code diagrams

  1. Create a Python virtualenv to set up your environment python3 -m venv venv
  2. Install PyDotPlus pip install pydotplus
  3. Install Django Extensions pip install django-extensions
  4. Configure your Django project to use Django Extensions in settings.py under server/opendp-projects/
INSTALLED_APPS = (
	...
	'django_extensions',
	...
)
  1. Invoke Django manager with graph models option, from the server/ subdirectory python manage.py graph_models -a -o opendpapp_models.png
  2. Use a browser or viewer to view the created png file, found in the server/ subdirectory

(This is based on an existing project by EugeneDae. See his project for original documentation.)

About

user experience for OpenDP MVP


Languages

Language:Python 87.6%Language:Vue 4.9%Language:JavaScript 3.3%Language:HTML 2.7%Language:Dockerfile 1.1%Language:Shell 0.5%