<commit_before># Overview

BlueTag is a mobile application that aims to connect people based on skills and geolocation. The app can be used at conferences, work places, and meetups to help a user locate people based on common skills and geo-location.  

As a sample, Bluetag showcases how you can build a set of backend micro-services coupled with an HTML5 mobile enabled front-end application. The backend is comprised of a set of micro-services that run on node.js and Liberty Java runtimes that interact with the front-end application and a Cloudant datbase via REST and Web Socket APIs. The frontend is based on HTML5 Web Components and will run in any modern browser, in a laptop, or on a mobile device. It can also be deployed as a native Android or iOS app using Apache Cordova.

What makes this application a good sample? This sample demonstrates how Bluemix allows you to easily bring together and deploy many modern technologies like Cordova and Polymer for mobile development, Java and Node.js runtimes in the cloud, Web sockets, REST services, micro services, NoSQL databases, location services and many more technologies.  The current sample is the alpha version of our vision for the Bluetag application.

We would love for you to join the project and contribute!

## How it works - live demo service

* Go to the [live Bluetag demo](http://bluetag.mybluemix.net/) and enter any name to get started. 

* The map should display with a marker on your current location.  As you move around, the marker and map dynamically adjust to your location.

* You can use the navigation links on the left to do the following:

**Near me:**  Lists users who are within 10 meters of you.  Press TAG and the user will be added to your contacts.

**Contacts:**  These are people that you have either tagged when they were near you, or that you added via Search.  You can click the button to show them on your map.

**Places:**  When you press "Mark it" on the map, the location is added on your places.   You can click the link to show this place on your map.

**Search:**  Start typing and Bluetag dynamically searches for user names that start with what you type.   You can select users to add to your contacts.

**Settings:**  You can prevent location updates from sending updates to the location service and you can toggle logging in the debug console.


### Architecture Diagram

<img src="./bluetag-services.png" width="650px"><br>This an architectural overview of the components that make this app run.<br>

## Download the BlueTag code

All the code for Bluetag is housed in git repositories.  Let's clone these repositories to your local environment first.  Since Bluetag follows a micro-service architecture, all the services have their own github repositories.  All the services are defined as submodules of bluetag.  The --recursive attribute in the git clone command will pull down the code from all the submodules automatically.  From your terminal run the following commands:

  ```
  mkdir myBluetag
  cd myBluetag
  git clone --recursive <EMAIL>:Bluetag/bluetag.git
  ```

This will pull in the master bluetag repository and a bunch of submodules that contain the code for the frontend, backend microservices, and shared code.

## Running the app on Bluemix

* Create a Bluemix Account

    [Sign up](http://www.bluemix.com) for Bluemix, or use an existing account.

* Download and install the [Cloud-foundry CLI](https://github.com/cloudfoundry/cli) tool

* Connect to Bluemix in the command line tool and follow the prompts to log in.

  ```
  $ cf api https://api.ng.bluemix.net
  $ cf login
  ```
  
* Create a Cloudant NoSQL DB service in Bluemix.

  ```
  $ cf create-service cloudantNoSQLDB Standard bluetag-cloudant
  ```

* Go into the bluetag-frontend/www directory and edit the `manifest.yml` file and change the `name` and `host` attributes to something unique.

  ```
  applications:
  - name: <prefix>-bluetag
    framework: node
    runtime: node12
    memory: 128M
    instances: 1
    host: <prefix>-bluetag
  ```
  The host you use will determinate your application url initially, e.g. `<host>.mybluemix.net`.
  
* Push the node application to Bluemix.  

   ```
   $ cf push
   ```

* Push the Java applications to Bluemix.  Replace the prefix to give your application a globally uniqiue name and host.

   ```
   $ cd ../bluetag-register
   $ cf push <prefix>-bluetag-register -p defaultServer/

   $ cd ../bluetag-location
   $ cf push <prefix>-bluetag-location -p defaultServer/

   $ cd ../bluetag-engine
   $ cf push <prefix>-bluetag-engine -p defaultServer/

   $ cd ../bluetag-tag
   $ cf push <prefix>-bluetag-tag -p defaultServer/
   
   $ cd ../bluetag-search
   $ cf push <prefix>-bluetag-search -p defaultServer/
   ```
   
* Bind the Java applications with the Cloudant service.

  ```
  $ cf bind-service <prefix>-bluetag-register bluetag-cloudant
  $ cf bind-service <prefix>-bluetag-location bluetag-cloudant
  $ cf bind-service <prefix>-bluetag-engine bluetag-cloudant
  $ cf bind-service <prefix>-bluetag-tag bluetag-cloudant
  $ cf bind-service <prefix>-bluetag-search bluetag-cloudant  
  ```<commit_msg>update README and frontend manifest.yml, set name to bluetag-frontend<commit_after># Overview

BlueTag is a mobile application that aims to connect people based on skills and geolocation. The app can be used at conferences, work places, and meetups to help a user locate people based on common skills and geo-location.  

As a sample, Bluetag showcases how you can build a set of backend micro-services coupled with an HTML5 mobile enabled front-end application. The backend is comprised of a set of micro-services that run on node.js and Liberty Java runtimes that interact with the front-end application and a Cloudant datbase via REST and Web Socket APIs. The frontend is based on HTML5 Web Components and will run in any modern browser, in a laptop, or on a mobile device. It can also be deployed as a native Android or iOS app using Apache Cordova.

What makes this application a good sample? This sample demonstrates how Bluemix allows you to easily bring together and deploy many modern technologies like Cordova and Polymer for mobile development, Java and Node.js runtimes in the cloud, Web sockets, REST services, micro services, NoSQL databases, location services and many more technologies.  The current sample is the alpha version of our vision for the Bluetag application.

We would love for you to join the project and contribute!

## How it works - live demo service

* Go to the [live Bluetag demo](http://bluetag.mybluemix.net/) and enter any name to get started. 

* The map should display with a marker on your current location.  As you move around, the marker and map dynamically adjust to your location.

* You can use the navigation links on the left to do the following:

**Near me:**  Lists users who are within 10 meters of you.  Press TAG and the user will be added to your contacts.

**Contacts:**  These are people that you have either tagged when they were near you, or that you added via Search.  You can click the button to show them on your map.

**Places:**  When you press "Mark it" on the map, the location is added on your places.   You can click the link to show this place on your map.

**Search:**  Start typing and Bluetag dynamically searches for user names that start with what you type.   You can select users to add to your contacts.

**Settings:**  You can prevent location updates from sending updates to the location service and you can toggle logging in the debug console.


### Architecture Diagram

<img src="./bluetag-services.png" width="650px"><br>This an architectural overview of the components that make this app run.<br>

## Download the BlueTag code

All the code for Bluetag is housed in git repositories.  Let's clone these repositories to your local environment first.  Since Bluetag follows a micro-service architecture, all the services have their own github repositories.  All the services are defined as submodules of bluetag.  The --recursive attribute in the git clone command will pull down the code from all the submodules automatically.  From your terminal run the following commands:

  ```
  mkdir myBluetag
  cd myBluetag
  git clone --recursive <EMAIL>:Bluetag/bluetag.git
  ```

This will pull in the master bluetag repository and a bunch of submodules that contain the code for the frontend, backend microservices, and shared code.

## Running the app on Bluemix

* Create a Bluemix Account

    [Sign up](http://www.bluemix.com) for Bluemix, or use an existing account.

* Download and install the [Cloud-foundry CLI](https://github.com/cloudfoundry/cli) tool

* Connect to Bluemix in the command line tool and follow the prompts to log in.

  ```
  $ cf api https://api.ng.bluemix.net
  $ cf login
  ```
  
* Create a Cloudant NoSQL DB service in Bluemix.

  ```
  $ cf create-service cloudantNoSQLDB Shared bluetag-cloudant
  ```

  The Bluetag frontend is hosted on a node.js service.  Next we will deploy the bluetag-frontend node service. 

* Go into the bluetag-frontend/www directory and edit the `manifest.yml` file and change the `host` attributes to something unique.

  ```
  applications:
  - name: bluetag-frontend
    framework: node
    runtime: node12
    memory: 128M
    instances: 1
    host: <prefix>-bluetag
  ```
  The host will determine your application url initially, e.g. `<host>.mybluemix.net`.
  
* Push the node application to Bluemix.  

   ```
   $ cf push
   ```

* Push the Java based services to Bluemix.  Replace the prefix to give your application a globally uniqiue name and host.

   ```
   $ cd ../bluetag-register
   $ cf push <prefix>-bluetag-register -p defaultServer/

   $ cd ../bluetag-location
   $ cf push <prefix>-bluetag-location -p defaultServer/

   $ cd ../bluetag-engine
   $ cf push <prefix>-bluetag-engine -p defaultServer/

   $ cd ../bluetag-tag
   $ cf push <prefix>-bluetag-tag -p defaultServer/
   
   $ cd ../bluetag-search
   $ cf push <prefix>-bluetag-search -p defaultServer/
   ```
   
* Bind the Java applications with the Cloudant service.

  ```
  $ cf bind-service <prefix>-bluetag-register bluetag-cloudant
  $ cf bind-service <prefix>-bluetag-location bluetag-cloudant
  $ cf bind-service <prefix>-bluetag-engine bluetag-cloudant
  $ cf bind-service <prefix>-bluetag-tag bluetag-cloudant
  $ cf bind-service <prefix>-bluetag-search bluetag-cloudant  
  ```
{'fraction_non_alphanumeric': 0.06815140508506978, 'fraction_numerical': 0.0024851844771554194, 'mean_word_length': 3.7045863309352516, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 36, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '158639', 'n_tokens_mistral': 3079, 'n_tokens_neox': 2826, 'n_words': 1434}