The following is intended to be a one stop shop for spinning up a Mondrian Cube with COMTRADE data. Below are the steps
- Install rvm + jruby
sudo apt install gnupg2
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby
sudo apt install jruby
Test the installation with this command:
jruby -v
WARNING!!! NEED TO LOG OUT AND LOG BACK IN FOR RVM TO WORK!
- Clone this repo! And check the config file to fill in your specific configuration
git clone https://github.com/observatory-economic-complexity/oec-cube
cd oec-cube
cat config.ru
- Install dependencies
sudo apt install make
gem install gem-wrappers
gem install bundler
bundle install # needs to be run from project directory!
- Generate wrapper script
rvm wrapper jruby oec-cube bundle
- Run it on localhost and test that it works
JRUBY_OPTS=-G rackup
Test it in a new window:
curl localhost:9292/cubes
- Install nginx and node
git clone https://github.com/Datawheel/mondrian-rest-ui.git
cd mondrian-rest-ui
npm i
-
Change settings.js
-
Build and run site
npm run build
npm start
- Data processing for mondrian cube
- Download from COMTRADE
- Process data using R (using c++ magic)
- without pci, eci, rca etc
- output single CSV / year
- Ingest to PostgreSQL DB
- Setup Dimension tables
- Import Fact tables (raw data) from step 2 CSV
- Create schema
- Hook up modrian-rest-ui
- PROFIT! 🎉