Coder Social home page Coder Social logo

angularjs-dropwizard-example's Introduction

General info

This is a little example application that I have used to learn to use the AngularJS and Dropwizard frameworks. It also serves as a project template that can be used to get a new project up and running quickly. A blog article describing what I did can be found here: Getting Started With AngularJS, Jetty and Dropwizard

Architecture information

AngularJS is used to create a simple webapp (angularjs-webapp module), while Dropwizard has been used to create a backend server with RESTful services (dw-server module). The two are deployed on different web servers, as shown here:

Deployment diagram

Topics that have been explored

AngularJS

  • organizing an AngularJS webapp in modules and partials
  • AngularJS directives, filters, calling backend services via $resource, etc.
  • using Bootstrap with AngularJS
  • using $promise returned from $resource calls to ensure that certains functions are executed in sequence

Jetty

  • using Jetty for both the webapp and the backend services
  • embedding Jetty in the application in dw-server so that it is very easy to run and debug from the IDE.
  • configuring Jetty in the angular-webapp as a proxy to the dw-server in order to tackle the issue that a JavaScript application is not allowed to call back to another server than it's origination server.

Dropwizard

  • creating RESTful (JSON) services with Jersey & Jackson, including health checks
  • getting the services to handle requests from AngularJS $resource
  • creating persistence logic with JDBI

Maven

  • using the the appassembler-maven-plugin to generate a script that will set the classpath and run the webapp
  • building fat JARS with Maven Shade Plugin making it possible to deploy Dropwizard services as single .jar files.
  • For those with allergies towards xml bloat, there is a gradle (almost) equivalent build.

Running the app with gradle

  1. Start the dwServer $projectRoot:> ./gradlew runDwServer
  2. Start the webApp $projectRoot:> ./gradlew jettyMrun

First time you run ./gradlew it will download a gradle distribution, not install neeeded.

angularjs-dropwizard-example's People

Contributors

rundis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.