Skip to content
Digital Situation Reports
Branch: dev
Clone or download
teodorescuserban Merge pull request #205 from UN-OCHA/dsr/166-2
pushing all env var defaults to Dockerfile
Latest commit f791e1b Apr 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_migrations DSR-164: omit/disable the old flashUpdate field on SitReps Apr 2, 2019
_tests
_ui DSR-192: document some CTF settings in our UIExt srcdoc Apr 9, 2019
assets DSR-187: FTS pie chart Mar 27, 2019
components DSR-208: lint the codebase Apr 24, 2019
layouts DSR-173: remove non-functioning asyncData query from Error layout Apr 16, 2019
locales DSR-167: test - Homepage Apr 5, 2019
middleware DSR-173: remove old middleware that we're not using anyway Apr 11, 2019
pages DSR-208: remove orphaned code Apr 24, 2019
plugins DSR-171: add Arabic translations Mar 12, 2019
static DSR-104: hardcode the technology column on 'about' URL Apr 1, 2019
store
.editorconfig initial commit Sep 4, 2018
.eslintrc.js initial commit Sep 4, 2018
.gitignore DSR-167: test - SnapPage Apr 10, 2019
.nvmrc DSR-18: specify correct version of node to match docker Sep 25, 2018
Dockerfile pushing all env var defaults to Dockerfile Apr 24, 2019
LICENSE initial commit Sep 4, 2018
README.md Docs and comments Feb 27, 2019
app.html DSR-185: remove fontfaceobserver Mar 22, 2019
docker-compose.yml
nuxt.config.js
package-lock.json DSR-167: install jest-puppeteer Apr 5, 2019
package.json DSR-167: install jest-puppeteer Apr 5, 2019
run_node DSR-166: forget about .contentful.json.tmpl Apr 24, 2019
yarn.lock

README.md

reports.unocha.org

Digital Situation Reports for UN OCHA. Vue+Nuxt produces a SSR+Hydration architecture, ensuring that we serve full HTML responses while taking advantage of modern JS tools for client-side interactivity. We use Contentful as our CMS, offloading all data entry responsibilities to a paid service.

Nuxt setup/development

# install node dependencies
$ npm install

# local development with hot reload at localhost:3000
$ npm run dev

For detailed explanation on how things work, checkout the Nuxt.js docs.

Be aware: While the Nuxt development mode is quite useful, ultimately this app has to run inside Docker for your feature to deploy smoothly. Before submitting a PR be sure to rebuild within Docker and run the server using the commands in the Docker section below.

Contentful setup

All content is stored on Contentful. To access the service you need a Space ID and a Content Delivery API key.

Place them in a file at the repo root called .env:

CTF_SPACE_ID=0123456789ab
CTF_ENVIRONMENT=master
CTF_CDA_ACCESS_TOKEN=0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqr

They will be copied to .contentful.json during the docker build step (see below).

Contentful Preview environments

When the CTF_HOST AND CTF_CDA_PREVIEW_TOKEN environment variables are present, the app will configure itself to display all edits and new entries immediately, regardless of whether they have been published.

Docker setup/development

# first-time setup
$ docker-compose build

# run server and view logs
$ docker-compose up

# run server detached so that logs are not shown on screen
$ docker-compose up -d
You can’t perform that action at this time.