Home

Awesome

renovate-app badge

Overview

Mobile Wiki is an application built on top of Ember and Ember FastBoot. This combination allows us serve server side rendered application to end client (The same code is executed on frontend and backend).

Access Mobile Wiki

Devbox environment

Open http://muppet.yourname.wikia-dev.pl/wiki/Kermit from mobile device or while emulating it in desktop browser. Or use curl -H "Host:muppet.yourname.wikia-dev.pl" "http://dev-yourname:7001/wiki/Kermit"

Scripts

Settings

Mobile Wiki application currently supports three types of configuration.

Some tips if you develop outside of devbox:

Development

FastBoot and Server side funtionality

Linting

Shoebox

To improve frontend performance we avoid making the same requests on backend and frontend. Shoebox helps us passing data from server to browser. Shoebox serilize data to JSON and puts it as script tag in HTML. In the browser shoebox reads data from HTML and uses it in Ember application.

const shoebox = this.get('fastboot.shoebox');

let data;

if (this.get('fastboot.isFastBoot')) {
  data = this.get('model').fetchData();

  shoebox.put('unique-key', data);
} else {
  data = shoebox.retrieve('unique-key');
}

// use your data

Sandboxes

Mobile-wiki is deployed to sandboxes using the mobile-wiki-deploy-sandbox jenkins job.

If you're in the #iris-tech channel, you can also make use of sandbot which is a chat bot with the following commands:

Devboxes

Mobile-wiki can be run inside Docker using docker-compose. This is as easy as running:

docker-compose up

NOTE: Make sure MediaWiki docker container is running.

Initial setup

Create .env file with the name of the devbox with local user id (to match the user id inside the container with the one on your dev-box for proper file permissions):

```bash
echo LOCAL_USER_ID=$(id -u $USER) > .env
```

You will need a Github token which will be used to fetch packages from private repos. To get a token go to your Github settings and generate a new token or use one you have generated earlier. I recommend storing it somewhere safe and just save it per your ssh session:

export GITHUB_TOKEN=<YOUR_TOKEN_HERE>

NOTE: Make sure the token allows access to private repositories - the repo (Full control of private repositories) and admin:org should be selected.

Now you need to fetch all dependencies (this can take quite some time for the first time):

docker run --rm -v `pwd`:/app -e GITHUB_TOKEN="$GITHUB_TOKEN" -e LOCAL_USER_ID=`id -u $USER` artifactory.wikia-inc.com/mobile-wiki/mobile-wiki-devbox:latest npm run setup

NOTES:

(Re)building the docker image

Whenever you add a new global dependency you should rebuild your mobile-wiki container. To do that you need to run:

docker build -f Dockerfile.devbox -t artifactory.wikia-inc.com/mobile-wiki/mobile-wiki-devbox:latest .

See also

CHANGELOG

Tasks

Mercury space - Confluence - Legacy documentation created before Mercury and Mobile Wiki split

How to update translations

Troubleshooting