kucharzyk / spring-angular2-starter

PROJECT DISCONTINUED
MIT License
210 stars 65 forks source link

SPRING BOOT ANGULAR 2 STARTER


PROJECT DISCONTINUED


Build Status

PROJECT DESCRIPTION:

This sample project demonstrates how to integrate Spring Boot application with Angular 2. It could be used as base for your future Angular2 Java projects. Node and npm are installed as part of maven build. Also webpack build and karma tests runs with maven. It also uses Spring Cloud microservices and Spring Security with Oauth2 JWT tokens.

FEATURES:

MICROSERVICES:

docs/diagram.png

USAGE WITH DOCKER (RECOMMENDED)

DOCKER BUILD (PRODUCTION MODE):

Build the docker image for all services with default maven profile

mvn install

DOCKER BUILD (DEVELOPMENT MODE):

Build the docker image for all services with dev maven profile To use development mode you need also webpack development server running in background

mvn install -P dev

RUNNING CONTAINERS:

After building applications run all containers with docker-compose

docker-compose up

STANDALONE USAGE WITHOUT DOCKER (NO LONGER RECOMMENDED)

RUNNING IN PRODUCTION MODE:

If you want to work without docker you need to use prod-standalone maven profile

Compile and package project:

mvn clean package -P prod-standalone

Then run config server:

cd shardis-config/
java -jar ./target/shardis-config-2.2.0.jar

Then run discovery server:

cd shardis-discovery/
java -jar ./target/shardis-discovery-2.2.0.jar

Then run gateway server:

cd shardis-gateway/
java -jar ./target/shardis-gateway-2.2.0.jar

Then run api server:

cd shardis-api/
java -jar ./target/shardis-api-2.2.0.jar

Then run auth server:

cd shardis-auth/
java -jar ./target/shardis-auth-2.2.0.jar

Then run ui server:

cd shardis-ui/
java -jar ./target/shardis-ui-2.2.0.jar

Then run admin server (optional):

cd shardis-admin/
java -jar ./target/shardis-admin-2.2.0.jar

RUNNING IN DEVELOPMENT MODE:

If you want to work without docker you need to use dev-standalone maven profile To use development mode you need also webpack development server running in background

Install all dependencies at first:

mvn clean install -P dev-standalone

Run config server in development mode:

cd shardis-config
mvn spring-boot:run -P dev-standalone

Run discovery server in development mode:

cd shardis-discovery
mvn spring-boot:run -P dev-standalone

Run gateway server in development mode:

cd shardis-gateway
mvn spring-boot:run -P dev-standalone

Run api server in development mode:

cd shardis-api
mvn spring-boot:run -P dev-standalone

Run auth server in development mode:

cd shardis-auth
mvn spring-boot:run -P dev-standalone

Run ui server in development mode:

cd shardis-ui
mvn spring-boot:run -P dev-standalone

Run admin server (optional) in development mode:

cd shardis-admin
mvn spring-boot:run -P dev-standalone

RUNNING DEV SERVER FOR DEVELOPMENT MODE:

Run development server:

cd shardis-ui
npm run server

Visit your app at http://localhost:4200/

Proxies for api calls can be configured in proxy.json file. Default configuration assumes that your api is running at localhost:8080

TESTING ANGULAR FRONTEND

Running unit tests:

cd shardis-ui
npm run test

Running e2e tests:

cd shardis-ui
npm run e2e

CHANGELOG:

2.2.0 (09.10.2016)

2.1.0 (28.08.2016)

2.0.0 (16.08.2016)

show full changelog