deweylab / MetaSRA-website-frontend

MetaSRA: normalized metadata for the Sequence Read Archive
http://metasra.biostat.wisc.edu
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

MetaSRA website front-end

This website is written in Angular 2. If you're not familiar, you should definitely read through the Angular tutorial and everything here will make a lot more sense. https://angular.io/tutorial

Setup

  1. Install node.js <= 6.9 and npm <= 3.0.
  2. Clone this repository and CD to the root directory.
  3. To install Javascript dependencies, run npm install.
  4. Patch ngbootstrap - run npm run prepare. See /patches/README for more info.

Compile Typescript

Most of the app is written in Typescript, which is a superset of Javascript with some handy extra syntax. To run it in a browser, you need to compile it to Javascript.

From a terminal in the project directory, run npm run build to compile.

Many IDE's have a plugin to compile typescript whenever you save a file. In the MetaSRA back-end script, there are a couple lines of code you can un-comment that will automatically compile typescript when the back-end server is running.

There are some compile-time optimizations to speed up loading of Angular apps that I didn't have time to implement, but would help the application load faster in the browser.

Update front-end on the web server

It's a good idea to make sure npm run build completes on your development machine before trying it on the web server.

SSH into the web server, and then:

cd /var/www/metasra-frontend
git pull
npm run build

Overview of files and structure

Familiarize yourself with Angular 2 for this to make sense. https://angular.io/tutorial

Component tree

Services

Other