Skip to content

Installation

Lee Seunghwa edited this page Jun 26, 2020 · 23 revisions

Environment

Minimum requirements

  • Hardware

    • Android-based smartphone
    • Tizen-based smart watch
    • Beacon
  • Software

    • IDE
      • Android Studio >= 3.0
      • Tizen Studio
      • Visual code (Angular 8)
    • Back-end software
      • Apache 2.4
      • PHP 7.0
      • MariaDB 10

Testing devices (verified)

  • Android Smartphone: Galaxy S5 & Galaxy Note 9
  • Tizen smartwatch: Samsung Galaxy watch, Samsung Gear S3
  • iBeacon

IDE for development (verified)

  • Android Studio 4.0 (193.6911.18.40.6514233, built on May 21, 2020) (SDK 29)
  • Tizen Studio
  • Visual code (Angular 8)

Installation

API Server

Install packages

Install Apache 2.4, PHP 7.0, MariaDB 10.

Setup Database

Create a database to store user data using SQL File. Now we will start the API server to handle user requests.

Setup Config

You need to connect that Mysql to the API server.

Copy config_template.php file to config.php

cp "/Project/API Server/config_template.php" "/Project/API Server/config.php"

Update mysql information

    MysqlSetting::$serverDomain = "localhost";
    MysqlSetting::$username = "banksemi";
    MysqlSetting::$password = "mysqlpassword";
    MysqlSetting::$database = "gachon_project";

Setup Virtual hosts & (web)

First, we will separate the API server and the front-end server through Apache's virtual host.

Open /conf/httpd.conf

Uncomment to load the virtual host confing file.

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

We will add an API server and a front-end server.

Open conf/extra/httpd-vhosts.conf

If you don't own a domain, use a port-based virtual host.

<VirtualHost *:8081>
    DocumentRoot /var/API Server/api
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot /var/webserver
</VirtualHost>

Now, When user requests http://127.0.0.1:8081/#.php, Server will execute /Project/API Server/api/#.php This will serve to hide PHP files outside of /API Server/api from the user.

/var/Web Server is a path to a web page server to view the current health status on a PC or smartphone.

Front-end Server for PC and Mobile

Install node.js

To use npm, install node.js.

Download Link

Check npm.

npm -v

Install Angular CLI

npm install -g @angular/cli

Build This Project

Move to `/Project/Web Application/', and build this project

ng build

So, You can get the built web server project file. (in /dist)

Move 'dist folder' to '/var/webserver' (in vhost confing).

So Users can access to 'http://127.0.0.1/' to check their health information.

Data Analysis Server

This works by communicating with the API server. You can install the analytics server on a computer with good performance.

First, Install python packages.

pip install -r requirements.txt

And Run python server for analysis.

python Python_Server.py

The program will then automatically check the Data folder, build a data model and start the service. image

Finally, connect the Python server to the API server.

Open /Project/API Server/config.php and change PythonServerIP

Setting::$PythonServerIP = "127.0.0.1";