Metadata-Version: 2.1
Name: kitica
Version: 1.1b2
Summary: Kitica Devicepool.
Home-page: https://github.com/MainSystemDev/kitica
Author: Joshua Kim Rivera
Author-email: joshua.rivera@mnltechnology.com
License: Type license() to see the full license text
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Testing
Description-Content-Type: text/markdown
Requires-Dist: aniso8601 (==8.0.0)
Requires-Dist: astroid (==2.3.3)
Requires-Dist: Click (==7.0)
Requires-Dist: Flask (==1.1.1)
Requires-Dist: Flask-API (==2.0)
Requires-Dist: Flask-Cors (==3.0.8)
Requires-Dist: flask-marshmallow (==0.10.1)
Requires-Dist: Flask-RESTful (==0.3.7)
Requires-Dist: gunicorn (==20.0.4)
Requires-Dist: isort (==4.3.21)
Requires-Dist: itsdangerous (==1.1.0)
Requires-Dist: Jinja2 (==2.10.3)
Requires-Dist: lazy-object-proxy (==1.4.3)
Requires-Dist: MarkupSafe (==1.1.1)
Requires-Dist: marshmallow (==3.2.2)
Requires-Dist: marshmallow-sqlalchemy (==0.20.0)
Requires-Dist: mccabe (==0.6.1)
Requires-Dist: pylint (==2.4.4)
Requires-Dist: python-box (==4.0.4)
Requires-Dist: pytz (==2019.3)
Requires-Dist: PyYAML (==5.3)
Requires-Dist: ruamel.yaml (==0.16.7)
Requires-Dist: ruamel.yaml.clib (==0.2.0)
Requires-Dist: six (==1.13.0)
Requires-Dist: SQLAlchemy (==1.3.11)
Requires-Dist: toml (==0.10.0)
Requires-Dist: typed-ast (==1.4.0)
Requires-Dist: webargs (==5.5.2)
Requires-Dist: Werkzeug (==0.16.0)
Requires-Dist: wrapt (==1.11.2)

Kitica API
================

## Introduction
Kitica's REST API was built to support parallel device automation testing,
It serves device's information through HTTP protocol.

## Setup
Kitica's API service was designed to be hosted behind **nginx** web server, but could also
be run locally for development.

### Development Server Setup
**Step 1**  
Before anything else, it is recommended that you run the service in a virtual environment.  
So, first, install python'3 virtualenv.
```bash
pip install virtualenv
```
After installing, create a virtualenv inside the api folder(``repository_root/api``). Run:
```bash
virtualenv venv
```
> Where venv is the name of the virtualenv instance.  

Output
```bash
Using base prefix '/usr'
New python executable in /home/yourusername/sample/venv/bin/python3
Also creating executable in /home/yourusername/sample/venv/bin/python
Installing setuptools, pip, wheel...
done.
```

Next, activate the virtualenv:
```bash
source venv/bin/activate
```
Now that virtualenv is active, install the dependencies for the api service.
```bash
pip install -r requirements.txt
```
After that, all dependencies should be installed.

**Step 2**
To start the API service, run:
```bash
python kiticaApi.py
```
> Output
```bash
 * Serving Flask app "kiticaAPI" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: xxx-xxx-xxx
```
Service should be running now.  
To Verify, Create a get request in postman.  
> **url**: http://localhost:5000/devices  
> **method**: GET  
Response should be something like this:
```json
[
    {
        "deviceId": 3,
        "deviceName": "Pixel 2",
        "platformName": "Android",
        "server": "xxx.xxx.xxx.xxx",
        "port": "4723/wd/hub",
        "udid": "emulator-5554",
        "platformVersion": "9",
        "status": "FREE",
        "teamName": "TEAM",
        "version": 1,
        "borrowerIp": null,
        "borrowerHostname": null,
        "lastBorrowed": "2020-02-12 15:29:29",
        "deviceType": "Emulator"
    }
]
```
That's it, local development server is now running.


