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.
Build the docker image for all services with default maven profile
mvn install
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
After building applications run all containers with docker-compose
docker-compose up
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
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
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
Running unit tests:
cd shardis-ui
npm run test
Running e2e tests:
cd shardis-ui
npm run e2e