Giter VIP home page Giter VIP logo

platform-client's Introduction

Ushahidi Platform Prototype

Build Status Coverage Status Dependency Status Codacy Badge


Try it out on Heroku

Deploy

You need to deploy the Platform API first

Getting set up for development

Libraries/Packages/Dependencies

First you'll need nodejs/io.js installed, npm takes care of the rest of our dependencies.

  • nodejs v0.10 or v0.12
  • io.js v1.2

Install Build Requirements

npm install -g gulp

Install Packages

npm install

This will install both NPM and Bower dependencies! No separate bower install command is required.

Download and Activate Live Reload Plugin

http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions

Navigate to project root and run Gulp

gulp

  • watches for changes
  • compiles sass
  • compiles js
  • rebuilds/reloads any optional servers that are enabled
  • live reloads index.html

Native Server

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.

Optional parameters

  • --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 - use a mock backend server instead of a real instance of ushahidi-platform, delivering the JSON files in the mocked_backend/ when API calls are made. This server will be running at: http://localhost:8081. See details below.
  • --docker-server - build and run the client inside of a Docker container. See details below.

Set default options with .gulpconfig.json

Instead of having to type the flags every time, you can also use a .gulpconfig.json file to set the default options for running the client.

{
    "nodeServer": true,
    "dockerServer": false,
    "backendUrl": "http://ushahidi-backend",
    "uglifyJs": true
}
  • nodeServer - always run the node-server task
  • dockerServer - always run the docker-server task
  • backendUrl - set the URL to your instance the platform
  • uglifyJs - uglify js during builds. Enabled by default

Optional: Mock Backend

mock-backend task starts a internal web server 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 run the mock backend server, run gulp --mock-backend.

This can be combined with the --node-server flag for a completely self-hosted Ushahidi Platform demo.

Optional: Run Docker

Docker is a very simple way to run applications in completely separate server environments. Our Docker application runs a local nginx server that serves the client as simply as possible, using the official Docker nginx server.

To run the Docker container, run gulp --docker-server

Note: If you're on Linux and have dockerServer enabled, you will have to add the user under which you are running the client to the docker group. This will prevent you from running gulp with sudo.

To check if docker group exist, issue getent group | grep docker. If the output of the command is empty, issue sudo groupadd docker

Issue sudo gpasswd -a ${USER} docker to add the current logged in user to the docker group. Log out and then log back in to effect the changes.

Note: The first build of the Docker server can take several minutes. Wait till you see server is live @ http://<ip_address_or_localhost/ before attempting to view the site.

Running unit specs

  • for test driven development, there is the gulp task 'gulp tdd'
    • when you run it:
      • all unit specs under test/unit will be run once
      • the following files will be watched and tests will be rerun on file changes
        • all files under test/unit
        • most of the files under app will be watched
          • see the 'files' array in test/karma.conf.js for more details

I'm a developer, should I contribute to Ushahidi 3.x?

We would love your help, but the platform is in heavy development with a rapid rate of change. If you're keen to help build something awesome, and happy to get deep into the core workings... then yes! Read about getting involved page. Most of our active development happens on the Ushahidi Phabricator. If you haven't used Phabricator before, read Phab Help after you sign up.

If you just want to fix a few bugs, or build a prototype on Ushahidi, you're probably better helping out on Ushahidi 2.x right now.

platform-client's People

Contributors

amoniker avatar brandonrosage avatar brianherbert avatar eyedol avatar rjmackay avatar shadowhand avatar spaudanjo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.