You need to deploy the Platform API first
First you'll need nodejs or io.js installed, npm takes care of the rest of our dependencies.
Clone the repo
git clone https://github.com/ushahidi/platform-client.git
Navigate to project root
Install Build Requirements
npm install -g gulp
This will install both NPM and Bower dependencies! No separate
bower install command is required.
Set up build options. Create a
.env file, you'll need to point
BACKEND_URL at an instance of the platform api
You should now have a local development server running on http://localhost:8080
Our gulp build
--node-server- start a self-hosted server, instead of using a native web server like Apache or nginx. This simple server will be running at: http://localhost:8080.
--mock-backend- build the app with an mock backend service, delivering the JSON files in the
mocked_backend/when API calls are made. See details below.
Instead of having to type the flags every time, you can also use a
.env file to set the default options for running the client.
NODE_SERVER=true BACKEND_URL=http://ushahidi-backend UGLIFY_JS=true MOCK_BACKEND=false KARMA_CHROME=false PORT=8080 APP_LANGUAGES=en,ar OAUTH_CLIENT_ID=ushahidiui OAUTH_CLIENT_SECRET=35e7f0bca957836d05ca0492211b0ac707671261
NODE_SERVER- always run the
BACKEND_URL- set the URL to your instance of the Platform API
UGLIFY_JS- uglify js during builds. Enabled by default
MOCK_BACKEND- build the app with an mock backend.
KARMA_CHROME- Use chrome to run karma tests
PORT- set the port to run
APP_LANGUAGES- sets the available languages. Defaults to showing all languages
OAUTH_CLIENT_ID- sets the client id required by the API
OAUTH_CLIENT_SECRET- sets the client secret required by the API
You can run
gulp build with a
--mock-backend option. This builds the app with an http mock service that provides a mock API that can be used for testing and client side development. When running the mock backend nothing can be persisted or deleted, but otherwise the client should be fully functional.
To build with the mock backend service, run
gulp build --mock-backend.
This can be combined with the
--node-server flag for a completely self-hosted Ushahidi Platform demo.
To run unit tests once, run:
For test driven development we have a gulp task
gulp tdd. This watches for JS changes and re-runs the unit tests.
If you are running the client with a native web server like Apache or nginx, you will need to use URL rewriting to point all non-existant files to
index.html. There is a sample
.htaccess file, which can be used with Apache:
% cp server/rewrite.htaccess server/www/.htaccess
Nginx users will have to manually configure rewriting in the site configuration file.
Yes! Development moves pretty quickly but the tech stack is getting more and more stable. If you're keen to help build something awesome, jump on board..