First draft of installation and running instructions to readme

pull/9/head
Chris Veilleux 2019-08-17 17:50:25 -05:00
parent 09a9ad0257
commit e2a5ffa341
1 changed files with 49 additions and 12 deletions

View File

@ -1,4 +1,7 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE.md) [![CLA](https://img.shields.io/badge/CLA%3F-Required-blue.svg)](https://mycroft.ai/cla) [![Team](https://img.shields.io/badge/Team-Mycroft_Backend-violetblue.svg)](https://github.com/MycroftAI/contributors/blob/master/team/Mycroft%20Backend.md) ![Status](https://img.shields.io/badge/-Production_ready-green.svg)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE.md)
[![CLA](https://img.shields.io/badge/CLA%3F-Required-blue.svg)](https://mycroft.ai/cla)
[![Team](https://img.shields.io/badge/Team-Mycroft_Backend-violetblue.svg)](https://github.com/MycroftAI/contributors/blob/master/team/Mycroft%20Backend.md)
![Status](https://img.shields.io/badge/-Production_ready-green.svg)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
[![Join chat](https://img.shields.io/badge/Mattermost-join_chat-brightgreen.svg)](https://chat.mycroft.ai)
@ -7,21 +10,55 @@
Selene -- Mycroft's Web Backend
===============================
Selene provides the services and applications used by
[Mycroft Core](https://github.com/mycroftai/mycroft-core), representing the
data access layer, APIs and scripts for the Mycroft web.
Selene provides the services used by [Mycroft Core](https://github.com/mycroftai/mycroft-core) to manage devices, skills
and settings. It consists of two repositories. This one contains GUI web applications built using the Angular framework.
data access layer, APIs and scripts. The second repository, [Selene Backend](https://github.com/mycroftai/selene-backend),
contains Python and SQL representing the database definition,data access layer, APIs and scripts that
support the web applications defined in this repository.
# Getting Started
There are three web applications defined in this repository, account management single sign on, and skill marketplace.
Each application is designed to run independently of the others. This repository also includes two libraries containing code
common to each of the applications.
First, get the code on your system! The simplest method is via git ([git installation instructions](https://gist.github.com/derhuerst/1b15ff4652a867391f03)):
- `cd ~/`
- `git clone https://github.com/MycroftAI/selene-ui.git`
- `cd selene-ui`
- TODO: more setup steps
# Installation
These instructions assume that the APIs and databases in the Selene Backend repository have been installed. The README file
in that repository contains the necessary instructions. As with the Selene Backend repository, these instructions will also assume
that each application (API & GUI) will run on an independent server or virtual machine. Running Selene on a single server is possible.
Many of the instructions below are also applicable to running on a single server. The biggest difference being that all the
compiled code will live on the same server.
# Running the Backend
To eliminate redundantly downloading and building the code on each server, it is recommended to do so on a build host. Once the
build is complete, copy the compiled code to the servers that will run the applications. This repository includes a Jenkinsfile
that builds the code and deploys it via ssh. It can be altered to work with any Jenkins instance.
TODO
* Install Angular 7 and node.js on your build host.
* Download this repository to your build host. The simplest method is via git
([git installation instructions](https://gist.github.com/derhuerst/1b15ff4652a867391f03))
```
cd <directory of your choice>
git clone https://github.com/MycroftAI/selene-ui.git
cd selene-ui
```
* Install the required node.js packages
```
npm install
```
* Compile the Angular Typescript code. By default the code is compiled into the `selene-ui/dist` directory
```
ng build --project shared
ng build --project globalnav
ng build --project account --prod
ng build --project market --prod
ng build --project sso --prod
```
* Copy the compiled code to the `/var/www` directory on the servers. The `shared` and `globalnav` modules are libraries that need to be
copied to all servers. The `account`, `market` and `sso` modules need only be copied to their respective servers.
# Running the Web Applications
* Install a web server on each of the application servers. Configure the web server to serve the `index.html` file of the web application.
Instructions on how to do this will vary depending on web server used. See the software provider's documentation for detailed instructions.
* Add the web applications to the reverse proxy that is already being used for the APIs in the Selene Backend repository.
# Getting Involved