Skip to content

Instantly share code, notes, and snippets.

@mlandauer
Last active March 31, 2021 10:43
Show Gist options
  • Save mlandauer/a4384b4b502fcb092decbb7c9d873e57 to your computer and use it in GitHub Desktop.
Save mlandauer/a4384b4b502fcb092decbb7c9d873e57 to your computer and use it in GitHub Desktop.

Overall install instructions for installing everything for DTA marketplace

Prerequisites

You'll need a dump of the staging database. Save this to staging.full.dump.sql.

Download repositories

$ mkdir dto
$ cd dto
$ git clone https://github.com/AusDTO/dto-digitalmarketplace-frontend.git
$ git clone https://github.com/AusDTO/dto-digitalmarketplace-buyer-frontend.git
$ git clone https://github.com/AusDTO/dto-digitalmarketplace-api.git
$ git clone https://github.com/AusDTO/dto-digitalmarketplace-supplier-frontend.git
$ git clone https://github.com/AusDTO/dto-digitalmarketplace-admin-frontend.git

Move the database dump to dto-digitalmarketplace-api/staging.full.dump.sql.

API

Install virtualenv if you don't already have it

$ cd dto-digitalmarketplace-api
$ nvm use stable
$ virtualenv venv
$ make requirements_for_test

Now install Postgres if you don't already have it

$ createdb digitalmarketplace
$ psql digitalmarketplace < staging.full.dump.sql

Frontend

$ cd dto-digitalmarketplace-frontend
$ nvm use stable
$ virtualenv venv

Install yarn & nvm if you don't already have it installed

$ nvm use stable
$ yarn install

Buyer frontend

$ cd dto-digitalmarketplace-buyer-frontend
$ nvm use stable
$ virtualenv venv

You should already be using Homebrew. If not install it.

$ brew install cairo
$ brew install pango
$ brew install lighttpd
$ pip install -r requirements.txt

Supplier frontend

$ cd dto-digitalmarketplace-supplier-frontend
$ nvm use stable
$ virtualenv venv
$ pip install -r requirements.txt
$ npm install
$ bower install
$ npm run frontend-build:development

Admin frontend

$ cd dto-digitalmarketplace-admin-frontend
$ nvm use stable
$ virtualenv venv
$ npm install
$ make requirements frontend_build

Putting it all together and running everything

Icky: Update the sudo password in setup.scpt.

Run setup.sh and point your browser at http://localhost:8000

tell application "Terminal"
activate
do script "nvm use stable; cd ~/git/dto/dto-digitalmarketplace-buyer-frontend; source ./venv/bin/activate; DM_DATA_API_URL=http://localhost:5000/api/ DM_DATA_API_AUTH_TOKEN=myToken REACT_BUNDLE_URL=http://localhost:60000/bundle/ REACT_RENDER_URL=http://localhost:60000/render python application.py runserver;" in tab 1 of front window
my makeTab()
do script "nvm use stable; cd ~/git/dto/dto-digitalmarketplace-api;source ./venv/bin/activate; make app_run; " in tab 2 of front window
my makeTab()
do script "nvm use stable; cd ~/git/dto/dto-digitalmarketplace-frontend;npm run build:development;" in tab 3 of front window
my makeTab()
do script "nvm use stable; cd ~/git/dto/dto-digitalmarketplace-frontend;npm run server:development;" in tab 4 of front window
my makeTab()
do script "nvm use stable; cd ~/git/dto/dto-digitalmarketplace-supplier-frontend; source ./venv/bin/activate; DM_DATA_API_URL=http://localhost:5000/api/ DM_DATA_API_AUTH_TOKEN=myToken REACT_BUNDLE_URL=http://localhost:60000/bundle/ REACT_RENDER_URL=http://localhost:60000/render make run_app;" in tab 5 of front window
my makeTab()
do script "nvm use stable; cd ~/git/dto/dto-digitalmarketplace-buyer-frontend;echo password | sudo -S pkill lighttpd; ./scripts/reverse_proxy.sh;" in tab 6 of front window
my makeTab()
do script "nvm use stable; cd ~/git/dto/dto-digitalmarketplace-admin-frontend; source ./venv/bin/activate; DM_DATA_API_URL=http://localhost:5000/api/ DM_DATA_API_AUTH_TOKEN=myToken REACT_BUNDLE_URL=http://localhost:60000/bundle/ REACT_RENDER_URL=http://localhost:60000/render make run_app;" in tab 7 of front window
end tell
on makeTab()
tell application "System Events" to keystroke "t" using {command down}
delay 0.2
end makeTab
#!/bin/bash
osascript setup.scpt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment