Skip to content

Gapminder/dollar-street-framework

Repository files navigation

Dollar Street Framework

Test coverage

Build Status codecov.io Dependency Status devDependency Status

Throughput Graph

Prerequisites

  • Ubuntu/Debian Linux OS v18+ lts, Mac OSX v10+
  • node v10+ & npm v6+
  • git tool
  • nohup tool
  • ufraw-batch tool
  • docker v18+ & docker-compose v1.23+
  • imagemagick & graphicsmagick
  • mongodb-org-tools v4+
apt-get install -y mongodb-org-tools

How to launch

git clone git@github.com:Gapminder/dollar-street-framework.git

cd dollar-street-framework

# update credentials and bucket name of AWS S3 
nano credentials/local.ds.json 

npm i
npm i webpack@3.12.0 -g
npm start

# upload "empty" database to DB
mongorestore --db dollarstreet --drop --gzip --archive=dump/archive.gz

# open in browser
open http://localhost:8080 #cms
open http://localhost:3000 #street

Key folders

  • server - deploy to GCP as a separate cluster/instance/container
    • src/models - all DB models (shared with cms server)
    • src/repositories - layer for connection to DB (in future it would be great to share it with cms server)
    • src/interfaces - interfaces for DB entities (in future it would be great to share it with cms server)
    • src/config - configuration files for express server only (refactoring is needed)
    • cron.task.ts - cron job for updating currencies in the DB, but it didn't work due to the expired credentials
    • ds.consumer.app.ts - dollar street application
  • client - deploy to GCP as a part of cms/server
  • cms/server - deploy to GCP as a separate instance/container
    • src - cms server source files (refactoring is needed, controllers with business logic and layer for connection to DB)
    • src/initApplication.ts - something like tuning cms app
    • src/* - huge controllers
    • src/.controllers - small controllers
    • config - configuration files for express server only (refactoring is needed)
    • migrations - old version of migrations for cms server (saved in case of resolving conflicts)
    • ds.cms.api.ts - dollar street CMS (Content Management System) application
  • cms/client - deploy to GCP as a part of cms/server
    • assets - media files for app (CSS, fonts, images)
    • libs - third-party libraries (were downloaded and saved inside repository, it would be nice to refactor it)
  • deployment
    • dockerfiles - all docker files for building docker images
    • files-for-travis - steps for travis CI (for release and development branches)
    • gcp/db - PoC for migration incomes from db source to db target
    • gcp/puppeteer - PoC for puppeteer instance with usage environment variables
    • gcp/puppeteer-v2 - PoC for puppeteer instance with usage our common credential service
  • credentials - all secrets should be stored here, avoid to commit changes in this folder
  • migrations - all migrations that were applied to DB, e.g. adding new translation keys
  • common
    • credential.service.ts
    • credentials-ui-prebuild.service.ts
    • db.config.ts
    • index-customizer.ts - update GoogleAnalitics data for certain
    • log.ts
  • uploads - temporary storage for uploaded files

Contributors

Before release

After release

You are welcome to join!