Skip to content

Latest commit

 

History

History
119 lines (86 loc) · 5.24 KB

Developer.md

File metadata and controls

119 lines (86 loc) · 5.24 KB

Developer Guide

Communication

  • General questions and discussion: [email protected]

  • Slack channel, email [email protected] for invitation

  • Office Hours for anyone interested, developers, participants, etc.:

    • Times: Tuesday 2pm CST and Thursday 10am CST

    To attend:

    1. Send email stating your desired topic to discuss to [email protected]
    2. You will receive a Google Hangout link (or let us know if you prefer another method of communication)

Where to start

Understanding the project

Understanding the code

  • Read the README files in each top level directory
  • Integrate a new service provider or data model via the Integration Guide

Running the project

  • See the instructions below to run locally

Start coding

First Run/Setup

From the top level data-transfer-project directory:

  • Install Git: sudo apt-get install git-all
  • Install Gradle: sudo apt-get install gradle
  • Install NVM: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
  • Install Node: mac installer or nvm install v10.16.3
  • Install Angular: npm install -g @angular/cli
  • Install Docker
  • Install the Angular CLI ./gradlew client-rest:installLocalAngularCli
  • In the client-rest/ directory, run npm install

IntelliJ setup

The following instructions work for IntelliJ IDEA version 2017.2.6.

Import the project

  • Open IntelliJ -> Import Project
  • Navigate to the 'data-transfer-project' directory where you have git cloned the repo
  • Import project from external model (Gradle) -> uncheck 'Create separate module per source set' -> Finish

Enable annotation processing

  • Go to File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors
  • Check 'Enable annotation processing'
  • Store generated sources relative to: 'Module content root' (not the default)
  • Production sources directory: build/classes/java/

Setup formatting

  • File -> Settings -> Editor -> General -> Ensure line feed at file end on Save
  • Install the 'google-java-format' plugin, and enable it in Settings

Setup automatic license header

  • Go to File -> Settings -> Editor -> Copyright -> Copyright Profiles
  • Click the green + button, add a new profile called "Data-Transfer-Project-Authors". Use this as the text:
Copyright $today.year The Data Transfer Project Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
  • Create a new temp file (e.g. Test.java) in Intellij.
  • Inside the file, enter Alt-Insert -> Copyright
  • It should prompt you to select the new Copyright profile
  • The copyright should be added to all new files from now on (note: it might be collapsed so not immediately obvious)

Running locally with Docker

See Running Locally for instructions.

Deploying in production

A demo distribution for Google Cloud Platform is available at distributions/demo-google-deployment.

A demo Azure distribution is also in development.

These distributions have :dockerize tasks which generate dockerfiles and build images, similar to our local demo.

Build Problem F.A.Q

AutoValue errors

If you get an error error: duplicate class... final class AutoValue_... it is indicative of your IDE and gradle clashing. To fix it you want to delete the referenced build/classes directory.

Misc updates

There is a rest version of the client and demo-server in progress. While it is not complete yet and lacks some of the features in the http based client, it is still runnable and works for all services that implement OAuth2.

The following runs the client-rest api

  • cd client-rest
  • ng serve --ssl --port 3000 --proxy-config proxy.conf.json

The following builds and runs the demo-server (which contains the worker and the api) with the jettyrest transport to be used with the client-rest UI.

  • docker network create dataportability
  • ./gradlew -PtransportType=jettyrest -PapiPort=3000 -PcloudType=local clean check :distributions:demo-server:dockerize
  • docker run --rm -p 8080:8080 -p 5005:5005 -p 3000:3000 --env-file distributions/demo-server/env.secrets --name demoserver --network dataportability datatransferproject/demo