Skip to content

swordman1205/java-angular2-dart-project

Repository files navigation

README

This repository contains the backend, web and mobile application code for qurasense. The following modules exists

  • app_facade Application facade to the cloud API and generated models
  • app_mobile Mobile application for iPhone and Android,
  • app_web Web application for end users,
  • cloud_doc Project documentation including scripts used to set up Google cloud
  • cloud_mock Mock/emulator implementation of cloud services
  • service_common Common utilities and infrastructure for developing services
  • service_gateway API gateway which fronts the health, lab and user services
  • service_health API for health data and operations
  • service_lab API for lab data and operations
  • service_user API for user data and operations

Software setup

Updating software

  • Upgrade flutter: flutter upgrade
  • Upgrade Google cloud components: gcloud components update

Web and App development

Web and app development can be done in multiple ways

  1. Using mocked backend services.
  2. Using local running services
  3. Using services running in a Docker image

Using mocked services

  • Web development with mocked services
    1. Open app_web/lib/app_component.dart and set _mockBacked = true.
    2. Open app_web/web/index.html, right click and click Debug index.html
    3. Then open the url http://localhost:8080
  • App development with mocked services
    • TODO

Using local running services

First go through the Running services locally

  • Web development with local services 1. 2. Open user_web/web/index.html, right click and click Debug index.html 3. Then open the url http://localhost:8080
  • App development with local services
    1. In IDEA Select user_mobile in the project pane and click Tools -> FLutter -> Flutter Packages Get
    2. Start device simulator
    3. Open user_mobile/lib/main.dart then right click and select Run main.dart

Using docker deployed services

TODO

API Development

Our services can either be start each to run locally, this is suitable for debugging and when developing APIs, or they can be started from within a docker image

Running services locally

  1. We use Google data store and pub/sub, to do development sp we need to run emulators for these

    gcloud beta emulators datastore start --host-port localhost:8380 --data-dir emulator_data/datastore
    gcloud beta emulators pubsub start --host-port localhost:8381 --data-dir emulator_data/pubsub
  2. In IDEA open Tool Windows -> Run Dashboard and start

    • UserApiApplication
    • HealthApiApplication
  3. Test the services

Model generation from swagger files

We can generate models and distribute it with single gradle task. After this task swagger generated dart code will be copied to user_model

gradle distributeApi

Or we can generate models and after hands manipulations copy it to user_model. Dart code will be avaliable in user_api/build/swagger/out

cd user_api
gradle generateApi

Cloud development

Run locally using Docker

  • docker-machine start dev
  • eval "$(docker-machine env dev)"
  • gradle assemble
  • docker build -t data-api:v1 .
  • docker run -ti --rm -p 8080:8080 data-api:v1

Cloud notes

  • Build image and test locally

    gradle assamble
    docker build -t gcr.io/qurasense-dev-1/user_health:v1 -f Dockerfile .
    docker run -it -P gcr.io/qurasense-dev-1/user_health:v1
    
  • Set default zone 3.

  • Update image

    1. kubectl set image deployment/hello-java hello-java=gcr.io/qurasense-174919/data-api:v2

Resources

Urgent

HIPAA

Learning

URLs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published