Skip to content

Developer Guide

Jonathan Sandoe edited this page Jan 3, 2017 · 22 revisions

Developing with the CODAP Open Source Repository

These are instructions for setting up a full CODAP developer environment. This is useful for running CODAP locally with the purpose of modifying CODAP software. It is not necessary if all you want to do is create a plugin (Data Interactive) that will run in CODAP. If that is your goal, please see https://github.com/concord-consortium/codap/wiki/CODAP-Data-Interactive-API.

Setting Up the Development Environment

Development Pre-requisites

CODAP utilizes the SproutCore framework which requires Ruby 1.9.2+ for its build tools.

####Instructions for Macs:####

  1. Install SproutCore 1.11 Follow the instructions for installing SproutCore from SproutCore website. CODAP uses SproutCore version 1.11 which needs to be specified during installation.

    $ gem install sproutcore -v 1.11

  2. Get the CODAP Source

    To clone the CODAP repository itself:

    $ https://github.com/concord-consortium/codap.git
    $ cd codap
    $ git submodule update --init --recursive
    

To work with the CODAP repository it is often useful to fork it on Github and then clone the fork.

####Instructions for Windows 8.1:####

  1. Install Ruby 1.9.3 with DevKit
	c:\Ruby193\DevKit>ruby dk.rb init
	c:\Ruby193\DevKit>ruby dk.rb review
    c:\Ruby193\DevKit>ruby dk.rb install
  1. Install SproutCore

    c:\Ruby193\DevKit>gem install sproutcore
    
  2. Get the CODAP Source

    To download the CODAP repository to your local directory:

To work with the CODAP repository it is often useful to fork it on Github and then clone the fork.

Install NPM Packages

Assuming you have the NodeJS and the Node Package Manager (npm) installed on your system, change to your CODAP directory in a terminal window and run the following commands:

+ npm install
+ npm run build:bundle-dev

Run the CODAP Application Locally

On the command line, change your working directory to the project directory.

    $ sc-server

This runs the SproutCore server, which serves the application code locally. To run the application, enter the following URL into your web browser of choice: http://localhost:4020/dg.

This should run the CODAP application and bring up the login dialog.

Introducing Data into CODAP

Data can be introduced into CODAP in a variety of ways. For example, in modular browsers a CSV or tab-delimited .txt(simple text) can be dragged and dropped into the CODAP workspace. Third party data sets/activities can also be dropped into the workspace. These are called data interactives. There are examples of data games on the project page.

Modifying the CODAP Source

Most changes to the CODAP application source are automatically reflected by simply reloading the browser page at http://localhost:4020/dg. More extensive changes (e.g. adding/removing source files) may require stopping and restarting sc-server and/or removing the generated tmp folder.