<commit_before>#Privy
##The Anonymous Location Based Chat Network

[![Circle CI](https://circleci.com/gh/team-oath/uncovery.svg?style=badge)](https://circleci.com/gh/team-oath/uncovery)

Privy is a mobile application for iOS devices which connects users to an anonymous
location based chat network. The key tenets of Privy are
**anonymity**, **simplicity**, and **low barrier to entry**.
Privy was designed with safety in mind and we strive to create a community
where individuals can feel free to express themselves in an environment where their privacy
is protected.

##User Story

1. Users can leave messages at geographic locations which may consist of either text or an image
2. Other users in proximity of a message can view, vote, and comment on it
3. Messages are automatically destroyed after a set amount of time
4. The more votes a message accumulates the longer it persist

##Technical Walkthrough

###Mobile to Server Communication
When the mobile application is initially ran, a `userToken` is generated using an
ID which is unique to the user's device.
The Express web framework acts as an API
endpoint for the mobile application and serves no static assets.
Static assets such as Privy's landing page and user submitted images are
primarily served by [AWS S3](http://aws.amazon.com/).
The Express server identifies users by the
unique `userToken` that is generated by each device. On each request to the
server, the `userToken` along with the user's `x`, `y`, and `z` coordinates are
transmitted to the Node server.

###Validations and Security
User data is validated on the level of the Express routes and MySQL model
adapters.
The router ensures that the correct parameters have been passed
in by validating coordinate ranges.
The models then sanitize user submitted parameters to protect against script
injection. Lastly, the MySQL schema has constraints in place to handle any
unexpected edge cases.

###Database Interactions
`modelAdapter.js` acts as a low level adapter which abstracts core
MySQL queries into easy to use JavaScript functions.
The model adapter is the interface for higher level components which need to
interact with MySQL. Abstracting common
queries into a single module enables seperation of concerns which results in
highly modular code.
`models.js` is the mediator between the Express routes and the models adapter.

##Technology Stack

###BackEnd
- *Server Environment* **NodeJS**
- *Web Framework* **ExpressJS**
- *Database* **MySQL**
- *Task Runner* **Grunt**

###FrontEnd<commit_msg>doc/ added React Native Mobile Client section<commit_after>#Privy
##The Anonymous Location Based Chat Network

[![Circle CI](https://circleci.com/gh/team-oath/uncovery.svg?style=badge)](https://circleci.com/gh/team-oath/uncovery)

Privy is a mobile application for iOS devices which connects users to an anonymous
location based chat network. The key tenets of Privy are
**anonymity**, **simplicity**, and **low barrier to entry**.
Privy was designed with safety in mind and we strive to create a community
where individuals can feel free to express themselves in an environment where their privacy
is protected.

##User Story

1. Users can leave messages as either text or an image at geographic locations
2. Other users in proximity of a message can view, vote, and comment on it
3. Other users can also chat with other users by clicking on a post in a comment thread
4. Messages are automatically destroyed after a set amount of time
5. The more votes a message accumulates the longer it persist

##Technical Walkthrough

###Mobile to Server Communication
When the mobile application is initially ran, a `userToken` is generated using an
ID which is unique to the user's device.
The Express web framework acts as an API
endpoint for the mobile application and serves no static assets.
Static assets such as Privy's landing page and user submitted images are
primarily served by [AWS S3](http://aws.amazon.com/).
The Express server identifies users by the
unique `userToken` that is generated by each device. On each request to the
server, the `userToken` along with the user's `x`, `y`, and `z` coordinates are
transmitted to the Node server.

###Validations and Security
User data is validated on the level of the Express routes and MySQL model
adapters.
The router ensures that the correct parameters have been passed
in by validating coordinate ranges.
The models then sanitize user submitted parameters to protect against script
injection. Lastly, the MySQL schema has constraints in place to handle any
unexpected edge cases.

###Database Interactions
`modelAdapter.js` acts as a low level adapter which abstracts core
MySQL queries into easy to use JavaScript functions.
The model adapter is the interface for higher level components which need to
interact with MySQL. Abstracting common
queries into a single module enables seperation of concerns which results in
highly modular code.
`models.js` is the mediator between the Express routes and the models adapter.

###React Native Mobile Client
The root file in the front-end component heirarchy is `client/index.ios.js`. All other components are children of this file. The main view that the user is routed to is `Messages/index.js`. This is where the message stream lives. As new data is received, the stream is updated.

##Technology Stack

###BackEnd
- *Server Environment* **NodeJS**
- *Web Framework* **ExpressJS**
- *Database* **MySQL**
- *Task Runner* **Grunt**

###FrontEnd
{'fraction_non_alphanumeric': 0.06047871368536452, 'fraction_numerical': 0.0020098666179426275, 'mean_word_length': 4.8545454545454545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2383078', 'n_tokens_mistral': 1377, 'n_tokens_neox': 1325, 'n_words': 799}