# Setting up Frontend - community-app

## Let's get started!

1. Ensure you have
   * `npm` installed - goto <http://nodejs.org/download/> to download the installer for your OS.
   * `ruby` installed - goto <https://www.ruby-lang.org/en/documentation/installation/> to download the latest version of ruby.

Note: On Ubuntu Linux you can use `sudo apt-get install npm nodejs-legacy`, which avoids the `/usr/bin/env: node: No such file or directory` problem.

Note that on Linux distributions you'll need to install the Ruby Development package (e.g. `sudo dnf install ruby-devel` on Fedora), and not just `ruby`, otherwise `bundle install` below will fail when it gets to installing `ffi` which uses native extensions.

1. Clone this repository to your local filesystem (default branch is 'develop'):

   ```
    git clone https://github.com/openMF/community-app.git
   ```
2. To download the dependencies, and be able to build, first install bower & grunt:

   ```
    npm install -g bower
    npm install -g grunt-cli
   ```

If this fails with `npm WARN checkPermissions Missing write access to /usr/local/lib` and `npm ERR! code EACCES` because you are not running `npm` with `sudo` as `root` (which you rightfully really shouldn't!) then use `npm config set prefix ~` once before doing `npm install`. Note that in that case `bower` and `grunt` will be installed into `./bin/bower` instead of `/usr/local/bin`, and so you need to prefix it in the usages below.

1. Next pull the runtime and build time dependencies by running `bower`, `npm`, and `gem` commands on the project root folder:

   ```
    bower install
   ```

   ```
    npm install
   ```

   ```
    gem install bundler
   ```

   ```
    bundle install
   ```

   If you used `npm config set prefix ~`, then you have to use `./bin/bower install` instead of `bower install`.
2. To preview the app, run the following command on the project root folder:

   ```
    grunt serve
   ```

   If you used `npm config set prefix ~`, then you have to use `./bin/grunt serve` instead of `grunt serve`.

   or open the 'index.html' file in FIREFOX browser

   Note: If you see a warning similar to the one shown below on running `grunt serve` , try increasing the number of open files limit as per the suggestions at <http://stackoverflow.com/questions/34588/how-do-i-change-the-number-of-open-files-limit-in-linux/>

   ```
    Waiting...Warning: EMFILE, too many open files

   ```
3. You can use these credentials to log in:

   ```
    Username: mifos
    Password: password
   ```

You are done.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mifos.org/mifosx/developer-space/setting-up-dev-environment/setting-up-frontend-community-app.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
