Skip to content

arityllc/referenceapp

Repository files navigation

Welcome to Arity!

Arity is a technology company that analyzes billions of miles of driving data to generate insights and scores that help our partners better evaluate risk and revolutionize driver safety, connectivity and value.

At Arity, we believe in using the best tech tools. We also believe in helping the technical community grow, and we decided to put together a reference application to help our developers and you learn the latest tech tools and techniques. The below application is designed to showcase many tech tools we use in the most simplistic manner possible. The app is designed to show/teach the tools and provide a simple app you can copy and enhance.

Currently this app showcases the following technologies: Spring Boot, REST, ZUUL, SSO, Redis, Swagger, Hystrix, Turbine, Graphite, DropWizard, DropWizard Metrics, Docker, Docker Compose, Maven, AngularJS, ReactJS, Eureka

IMPORTANT

Pre-requisites

  • You must have a working Docker environment running locally.

For Windows (prior to V10 with Hyper-V support) or Mac environments, you must use a docker machine locally. Make sure you have a docker machine running at 192.168.99.100. For Windows Pro or Enterprise with Hyper-V support, a docker-machine is not needed and docker services use 'localhost'. You must run and build under profile name 'localDocker'.

  • You MUST start the app/microservices in specific order.
  • If your using IntelliJ, you must turn on Annotation Processors via menu option Preferences > Build, Execution, Deployment > Compiler > Annotation Processors.

Contributors: Sherjeel Ghouse, Scott Kramer, Dan Mohnen, Derek Ashmore

Contributing Process: We would love you to contribute to this reference application! Please keep in mind at all times the project mission making this application simplistic and easy to learn from.

Things you can add to the project...

  1. Config Server
  2. Convert to Gradle Project.
  3. oWasp JSON libraries
  4. PIT testing; Unit Test
  5. Jenkins using Docker and CI Integration
  6. JMeter or Selenium
  7. RestEasy
  8. Spring Config
  9. oAuth
  10. Splunk or elastic search or kibanna
  11. Flyway
  12. PCF Deployment?
  13. Rest Assured
  14. Artifactory
  15. Spring Sleuth
  16. Add React
  17. Deploy scripts to Docker & AWS
  18. Zipkin
  19. Jest & Enzyme? Not sure if we will add Mock MVC, influxDB, CollectD, Archaius, PCF, Spring Integration, RabbitMQ, Connection Pooling, Kafka, Netflix Ribbon

Start Up Instructions

  1. START DOCKER CONTAINERS
    a. Failure to start Docker first will cause errors.
    b.At command/terminal prompt (in base project directory): docker-compose up

  2. BUILD ALL PROJECTS
    a. At command/terminal prompt (in base project directory): mvn clean package
    Errors? fail to build? - make sure you have redis running on 192.168.99.100:6379 via command line docker ps -a

  3. START GATEWAY APPLICATION
    a. In your IDE (IntelliJ or Eclipse/STS), right click on "gateway" Microservice Project, src/ main/ java/ demo/ GatewayApplication Run As Spring Boot Application

  4. START SERVICE-REGISTRY APPLICATION
    a. In your IDE (IntelliJ or Eclipse/STS), right click on "service-registry" Microservice Project, src/ main/ java/ demo/ ServiceRegistryApplication Run As Spring Boot Application

  5. Start Other Services
    a. In your IDE (IntelliJ or Eclipse/STS), right click on EACH Microservice Project
    b. deviceservice/src/main/java/demo/DeviceServiceApplication Run As Spring Boot Application
    c. deviceui/src/main/java/demo/DeviceUiApplication Run As Spring Boot Application
    d. hystrixdashboard/src/main/java/demo/HystrixDashboardApplication Run As Spring Boot Application
    e. admin-ui/src/main/java/demo/AdminUIApplication Run As Dropwizard Application

How to Use The Reference App

  1. TEST USER INTERFACE
    Go to http://localhost:8080/
    Login user/user or admin/admin
    Click 'Device' button
    Add a device and click Submit
    Click 'Admin' button
    Click [refresh] to display health of one of the services listed

  2. TEST HYSTRIX
    Go to http://localhost:8686/hystrix
    Enter stream http://localhost:8080/hystrix.stream
    Click Monitor button
    Test a failure Go to http://localhost:8080/epicfail/1

  3. TEST TURBINE
    Go to localhost:8686/hystrix
    Enter stream
    http://localhost:8686/turbine.stream?cluster=SAMPLE-HYSTRIX-AGGREGATE
    Click Monitor button
    Test a failure Go to http://localhost:8080/epicfail/1

  4. TEST DROPWIZARD CONSOLE METRICS
    Go to console for device-ui

  5. TEST GRAPHITE
    Go to http://192.168.99.100:8780 login: guest/guest