Repository: jhipster/generator-jhipster
Pull request #7110 (2018-02-11 23:18:40)

Use a CoreModule to prevent from duplicate Service instances
I started working on Lazy Loading but saw that our SharedModule contains providers, and it shouldn't.
Indeed, each time the SharedModule is imported in a module, the providers are recreated, this might cause some issues as we think our services as singletons.

So I'm proposing to add a CoreModule which will be only imported in the AppModule and provide all the shared services. This is the recommended way from [Angular](https://angular.io/guide/singleton-services).

- [ ] [Travis tests](https://travis-ci.org/jhipster/generator-jhipster/pull_requests) are green
- [ ] Tests are added where necessary
- [ ] Documentation is added/updated where necessary
- [x] Coding Rules & Commit Guidelines as per our [CONTRIBUTING.md document](https://github.com/jhipster/generator-jhipster/blob/master/CONTRIBUTING.md) are followed



Patch:
diff --git a/generators/client/files-angular.js b/generators/client/files-angular.js
index c992243834..359922b569 100644
--- a/generators/client/files-angular.js
+++ b/generators/client/files-angular.js
@@ -260,7 +260,7 @@ const files = {
                 { file: 'account/social/_social-register.component.html', method: 'processHtml' },
                 { file: 'shared/social/_social.component.ts', method: 'processJs' },
                 { file: 'shared/social/_social.component.html', method: 'processHtml' },
-                'shared/social/_social.service.ts'
+                'core/social/_social.service.ts'
             ]
         },
         {
@@ -338,8 +338,8 @@ const files = {
                 { file: 'admin/tracker/_tracker.route.ts', method: 'processJs' },
                 { file: 'admin/tracker/_tracker.component.ts', method: 'processJs' },
                 { file: 'admin/tracker/_tracker.component.html', method: 'processHtml' },
-                'shared/tracker/_tracker.service.ts',
-                'shared/tracker/_window.service.ts'
+                'core/tracker/_tracker.service.ts',
+                'core/tracker/_window.service.ts'
             ]
         },
         {
@@ -370,6 +370,42 @@ const files = {
             ]
         }
     ],
+    angularCore: [
+        {
+            path: ANGULAR_DIR,
+            templates: [
+                'core/_index.ts',
+                'core/_core.module.ts',
+                // login
+                'core/login/_login.service.ts',
+                'core/user/_account.model.ts'
+            ]
+        },
+        {
+            path: ANGULAR_DIR,
+            condition: generator => generator.authenticationType !== 'oauth2',
+            templates: [
+                // login
+                'core/login/_login-modal.service.ts'
+            ]
+        },
+        {
+            condition: generator => !generator.skipUserManagement || generator.authenticationType === 'oauth2',
+            path: ANGULAR_DIR,
+            templates: [
+                'core/user/_user.service.ts',
+                'core/user/_user.model.ts'
+            ]
+        },
+        {
+            condition: generator => generator.enableTranslation,
+            path: ANGULAR_DIR,
+            templates: [
+                'core/language/_language.constants.ts',
+                'core/language/_language.helper.ts'
+            ]
+        }
+    ],
     angularShared: [
         {
             path: ANGULAR_DIR,
@@ -382,9 +418,6 @@ const files = {
                 'shared/constants/_pagination.constants.ts',
                 // models
                 'shared/util/_request-util.ts',
-                'shared/user/_account.model.ts',
-                // login
-                'shared/login/_login.service.ts',
                 // alert service code
                 'shared/alert/_alert.component.ts',
                 'shared/alert/_alert-error.component.ts'
@@ -396,25 +429,14 @@ const files = {
             templates: [
                 // login
                 'shared/login/_login.component.ts',
-                { file: 'shared/login/_login.component.html', method: 'processHtml' },
-                'shared/login/_login-modal.service.ts'
+                { file: 'shared/login/_login.component.html', method: 'processHtml' }
             ]
         },
         {
             condition: generator => generator.enableTranslation,
             path: ANGULAR_DIR,
             templates: [
-                'shared/language/_find-language-from-key.pipe.ts',
-                'shared/language/_language.constants.ts',
-                'shared/language/_language.helper.ts'
-            ]
-        },
-        {
-            condition: generator => !generator.skipUserManagement || generator.authenticationType === 'oauth2',
-            path: ANGULAR_DIR,
-            templates: [
-                'shared/user/_user.model.ts',
-                'shared/user/_user.service.ts'
+                'shared/language/_find-language-from-key.pipe.ts'
             ]
         }
     ],
@@ -422,26 +444,26 @@ const files = {
         {
             path: ANGULAR_DIR,
             templates: [
-                'shared/auth/_csrf.service.ts',
-                'shared/auth/_state-storage.service.ts',
-                'shared/auth/_principal.service.ts',
+                'core/auth/_csrf.service.ts',
+                'core/auth/_state-storage.service.ts',
+                'core/auth/_principal.service.ts',
                 'shared/auth/_has-any-authority.directive.ts',
-                'shared/auth/_account.service.ts',
-                'shared/auth/_user-route-access-service.ts'
+                'core/auth/_account.service.ts',
+                'core/auth/_user-route-access-service.ts'
             ]
         },
         {
             condition: generator => generator.authenticationType === 'jwt' || generator.authenticationType === 'uaa',
             path: ANGULAR_DIR,
             templates: [
-                'shared/auth/_auth-jwt.service.ts'
+                'core/auth/_auth-jwt.service.ts'
             ]
         },
         {
             condition: generator => generator.authenticationType === 'session' || generator.authenticationType === 'oauth2',
             path: ANGULAR_DIR,
             templates: [
-                'shared/auth/_auth-session.service.ts'
+                'core/auth/_auth-session.service.ts'
             ]
         }
     ],
@@ -495,7 +517,7 @@ const files = {
                 'spec/app/admin/user-management/_user-management-dialog.component.spec.ts',
                 'spec/app/admin/user-management/_user-management-delete-dialog.component.spec.ts',
                 // user service tests
-                'spec/app/shared/user/_user.service.spec.ts'
+                'spec/app/core/user/_user.service.spec.ts'
             ]
         },
         {
diff --git a/generators/client/templates/angular/src/main/webapp/app/_app.module.ts b/generators/client/templates/angular/src/main/webapp/app/_app.module.ts
index d7d77b8223..d7ff95efb9 100644
--- a/generators/client/templates/angular/src/main/webapp/app/_app.module.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/_app.module.ts
@@ -30,7 +30,8 @@ import { AuthInterceptor } from './blocks/interceptor/auth.interceptor';
 import { AuthExpiredInterceptor } from './blocks/interceptor/auth-expired.interceptor';
 import { ErrorHandlerInterceptor } from './blocks/interceptor/errorhandler.interceptor';
 import { NotificationInterceptor } from './blocks/interceptor/notification.interceptor';
-import { <%=angularXAppName%>SharedModule, UserRouteAccessService } from 'app/shared';
+import { <%=angularXAppName%>SharedModule } from 'app/shared';
+import { <%=angularXAppName%>CoreModule } from 'app/core';
 import { <%=angularXAppName%>AppRoutingModule} from './app-routing.module';
 import { <%=angularXAppName%>HomeModule } from './home/home.module';
 import { <%=angularXAppName%>AdminModule } from './admin/admin.module';
@@ -40,7 +41,7 @@ import { <%=angularXAppName%>AccountModule } from './account/account.module';
 import { <%=angularXAppName%>EntityModule } from './entities/entity.module';
 import { PaginationConfig } from './blocks/config/uib-pagination.config';
 <%_ if (['session', 'oauth2'].includes(authenticationType)) { _%>
-import { StateStorageService } from 'app/shared/auth/state-storage.service';
+import { StateStorageService } from 'app/core/auth/state-storage.service';
 <%_ } _%>
 // jhipster-needle-angular-add-module-import JHipster will add new module here
 import {
@@ -61,6 +62,7 @@ import {
         <%=angularXAppName%>AppRoutingModule,
         Ng2Webstorage.forRoot({ prefix: '<%=jhiPrefixDashed %>', separator: '-'}),
         <%=angularXAppName%>SharedModule,
+        <%=angularXAppName%>CoreModule,
         <%=angularXAppName%>HomeModule,
         <%=angularXAppName%>AdminModule,
         <%_ if (authenticationType !== 'oauth2') { _%>
@@ -82,7 +84,6 @@ import {
     providers: [
         ProfileService,
         PaginationConfig,
-        UserRouteAccessService,
         <%_ if (authenticationType === 'jwt') { _%>
         {
             provide: HTTP_INTERCEPTORS,
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/activate/_activate.component.ts b/generators/client/templates/angular/src/main/webapp/app/account/activate/_activate.component.ts
index 6994062741..7b56248a5a 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/activate/_activate.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/activate/_activate.component.ts
@@ -20,7 +20,7 @@ import { Component, OnInit } from '@angular/core';
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 import { ActivatedRoute } from '@angular/router';
 
-import { LoginModalService } from 'app/shared';
+import { LoginModalService } from 'app/core';
 import { ActivateService } from './activate.service';
 
 @Component({
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/activate/_activate.route.ts b/generators/client/templates/angular/src/main/webapp/app/account/activate/_activate.route.ts
index 3d2339e37c..3c05036881 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/activate/_activate.route.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/activate/_activate.route.ts
@@ -18,7 +18,7 @@
 -%>
 import { Route } from '@angular/router';
 
-import { UserRouteAccessService } from 'app/shared';
+import { UserRouteAccessService } from 'app/core';
 import { ActivateComponent } from './activate.component';
 
 export const activateRoute: Route = {
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/_password-reset-finish.component.ts b/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/_password-reset-finish.component.ts
index 32b1f887ba..10a988a520 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/_password-reset-finish.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/_password-reset-finish.component.ts
@@ -20,7 +20,7 @@ import { Component, OnInit, AfterViewInit, Renderer, ElementRef } from '@angular
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 import { ActivatedRoute } from '@angular/router';
 
-import { LoginModalService } from 'app/shared';
+import { LoginModalService } from 'app/core';
 import { PasswordResetFinishService } from './password-reset-finish.service';
 
 @Component({
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/_password-reset-finish.route.ts b/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/_password-reset-finish.route.ts
index bf227ccf1c..f2750e910b 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/_password-reset-finish.route.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/_password-reset-finish.route.ts
@@ -18,7 +18,7 @@
 -%>
 import { Route } from '@angular/router';
 
-import { UserRouteAccessService } from 'app/shared';
+import { UserRouteAccessService } from 'app/core';
 import { PasswordResetFinishComponent } from './password-reset-finish.component';
 
 export const passwordResetFinishRoute: Route = {
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/_password-reset-init.component.ts b/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/_password-reset-init.component.ts
index c7241e21ed..a1e032710f 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/_password-reset-init.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/_password-reset-init.component.ts
@@ -17,10 +17,10 @@
  limitations under the License.
 -%>
 import { Component, OnInit, AfterViewInit, Renderer, ElementRef } from '@angular/core';
-
 import { EMAIL_NOT_FOUND_TYPE } from 'app/shared';
 import { PasswordResetInitService } from './password-reset-init.service';
 
+
 @Component({
     selector: '<%= jhiPrefixDashed %>-password-reset-init',
     templateUrl: './password-reset-init.component.html'
@@ -54,7 +54,7 @@ export class PasswordResetInitComponent implements OnInit, AfterViewInit {
             this.success = 'OK';
         }, (response) => {
             this.success = null;
-            if (response.status === 400 && response.json().type === EMAIL_NOT_FOUND_TYPE) {
+            if (response.status === 400 && response.error.type === EMAIL_NOT_FOUND_TYPE) {
                 this.errorEmailNotExists = 'ERROR';
             } else {
                 this.error = 'ERROR';
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/_password-reset-init.route.ts b/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/_password-reset-init.route.ts
index e5729e3307..0db16c7bef 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/_password-reset-init.route.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/_password-reset-init.route.ts
@@ -18,7 +18,7 @@
 -%>
 import { Route } from '@angular/router';
 
-import { UserRouteAccessService } from 'app/shared';
+import { UserRouteAccessService } from 'app/core';
 import { PasswordResetInitComponent } from './password-reset-init.component';
 
 export const passwordResetInitRoute: Route = {
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/password/_password.component.ts b/generators/client/templates/angular/src/main/webapp/app/account/password/_password.component.ts
index 4685b8f4aa..dca5d94671 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/password/_password.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/password/_password.component.ts
@@ -18,7 +18,7 @@
 -%>
 import { Component, OnInit } from '@angular/core';
 
-import { Principal } from 'app/shared';
+import { Principal } from 'app/core';
 import { PasswordService } from './password.service';
 
 @Component({
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/password/_password.route.ts b/generators/client/templates/angular/src/main/webapp/app/account/password/_password.route.ts
index 92ab6ae516..ba3d6f3303 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/password/_password.route.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/password/_password.route.ts
@@ -18,7 +18,7 @@
 -%>
 import { Route } from '@angular/router';
 
-import { UserRouteAccessService } from 'app/shared';
+import { UserRouteAccessService } from 'app/core';
 import { PasswordComponent } from './password.component';
 
 export const passwordRoute: Route = {
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/register/_register.component.ts b/generators/client/templates/angular/src/main/webapp/app/account/register/_register.component.ts
index e1d5c053eb..c8abb6dcac 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/register/_register.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/register/_register.component.ts
@@ -21,7 +21,8 @@ import { HttpErrorResponse } from '@angular/common/http';
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 import { JhiLanguageService } from 'ng-jhipster';
 
-import { LoginModalService, EMAIL_ALREADY_USED_TYPE, LOGIN_ALREADY_USED_TYPE } from 'app/shared';
+import { EMAIL_ALREADY_USED_TYPE, LOGIN_ALREADY_USED_TYPE } from 'app/shared';
+import { LoginModalService } from 'app/core';
 import { Register } from './register.service';
 
 @Component({
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/sessions/_sessions.component.ts b/generators/client/templates/angular/src/main/webapp/app/account/sessions/_sessions.component.ts
index edefadcfc5..ec9f22af84 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/sessions/_sessions.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/sessions/_sessions.component.ts
@@ -18,7 +18,7 @@
 -%>
 import { Component, OnInit } from '@angular/core';
 
-import { Principal } from 'app/shared';
+import { Principal } from 'app/core';
 import { Session } from './session.model';
 import { SessionsService } from './sessions.service';
 
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/sessions/_sessions.route.ts b/generators/client/templates/angular/src/main/webapp/app/account/sessions/_sessions.route.ts
index 1f374f708a..8b5cc8c784 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/sessions/_sessions.route.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/sessions/_sessions.route.ts
@@ -18,7 +18,7 @@
 -%>
 import { Route } from '@angular/router';
 
-import { UserRouteAccessService } from 'app/shared';
+import { UserRouteAccessService } from 'app/core';
 import { SessionsComponent } from './sessions.component';
 
 export const sessionsRoute: Route = {
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/settings/_settings.component.ts b/generators/client/templates/angular/src/main/webapp/app/account/settings/_settings.component.ts
index 024c1d2c71..6dee898063 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/settings/_settings.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/settings/_settings.component.ts
@@ -19,7 +19,7 @@
 import { Component, OnInit } from '@angular/core';
 import { JhiLanguageService } from 'ng-jhipster';
 
-import { Principal, AccountService<% if (enableTranslation) { %>, JhiLanguageHelper<% } %> } from 'app/shared';
+import { Principal, AccountService<% if (enableTranslation) { %>, JhiLanguageHelper<% } %> } from 'app/core';
 
 @Component({
     selector: '<%= jhiPrefixDashed %>-settings',
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/settings/_settings.route.ts b/generators/client/templates/angular/src/main/webapp/app/account/settings/_settings.route.ts
index 4c0ad98b2b..9aee68675b 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/settings/_settings.route.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/settings/_settings.route.ts
@@ -18,7 +18,7 @@
 -%>
 import { Route } from '@angular/router';
 
-import { UserRouteAccessService } from 'app/shared';
+import { UserRouteAccessService } from 'app/core';
 import { SettingsComponent } from './settings.component';
 
 export const settingsRoute: Route = {
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/social/_social-auth.component.ts b/generators/client/templates/angular/src/main/webapp/app/account/social/_social-auth.component.ts
index 05f0fbfea3..dba70403ba 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/social/_social-auth.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/social/_social-auth.component.ts
@@ -20,7 +20,7 @@ import { Component, OnInit } from '@angular/core';
 import { Router } from '@angular/router';
 import { CookieService } from 'ngx-cookie';
 
-import { LoginService } from 'app/shared';
+import { LoginService } from 'app/core';
 
 @Component({
     selector: '<%= jhiPrefixDashed %>-auth',
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/social/_social-register.component.ts b/generators/client/templates/angular/src/main/webapp/app/account/social/_social-register.component.ts
index 6ddf789b7e..f6e98c1ee9 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/social/_social-register.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/social/_social-register.component.ts
@@ -20,7 +20,7 @@ import { Component, OnInit } from '@angular/core';
 import { ActivatedRoute } from '@angular/router';
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 
-import { LoginModalService } from 'app/shared';
+import { LoginModalService } from 'app/core';
 
 @Component({
     selector: '<%= jhiPrefixDashed %>-register',
diff --git a/generators/client/templates/angular/src/main/webapp/app/account/social/_social.route.ts b/generators/client/templates/angular/src/main/webapp/app/account/social/_social.route.ts
index a0a9dcd437..ec443f7ee8 100644
--- a/generators/client/templates/angular/src/main/webapp/app/account/social/_social.route.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/account/social/_social.route.ts
@@ -18,7 +18,7 @@
 -%>
 import { Route } from '@angular/router';
 
-import { UserRouteAccessService } from 'app/shared';
+import { UserRouteAccessService } from 'app/core';
 import { SocialRegisterComponent } from './social-register.component';
 <%_ if (authenticationType === 'jwt') { _%>
 import { SocialAuthComponent } from './social-auth.component';
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/_admin.module.ts b/generators/client/templates/angular/src/main/webapp/app/admin/_admin.module.ts
index 2674c3f297..d56af6438d 100644
--- a/generators/client/templates/angular/src/main/webapp/app/admin/_admin.module.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/admin/_admin.module.ts
@@ -19,9 +19,6 @@
 import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
 import { RouterModule } from '@angular/router';
 
-<%_ if (websocket === 'spring-websocket') { _%>
-import { <%=jhiPrefixCapitalized%>TrackerService } from 'app/shared/tracker/tracker.service';
-<%_ } _%>
 import { <%=angularXAppName%>SharedModule } from 'app/shared';
 /* jhipster-needle-add-admin-module-import - JHipster will add admin modules imports here */
 
@@ -119,9 +116,6 @@ import {
         GatewayRoutesService,
         <%_ } _%>
         LogsService,
-        <%_ if (websocket === 'spring-websocket') { _%>
-        <%=jhiPrefixCapitalized%>TrackerService,
-        <%_ } _%>
         <%_ if (!skipUserManagement) { _%>
         UserResolvePagingParams,
         UserResolve,
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/_admin.route.ts b/generators/client/templates/angular/src/main/webapp/app/admin/_admin.route.ts
index e7201ddb46..bb9e78ac81 100644
--- a/generators/client/templates/angular/src/main/webapp/app/admin/_admin.route.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/admin/_admin.route.ts
@@ -39,7 +39,7 @@ import {
     <%_ } _%>
 } from './';
 
-import { UserRouteAccessService } from 'app/shared';
+import { UserRouteAccessService } from 'app/core';
 
 const ADMIN_ROUTES = [
     <%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%>
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/tracker/_tracker.component.ts b/generators/client/templates/angular/src/main/webapp/app/admin/tracker/_tracker.component.ts
index 83fec94d88..c8a5bf462b 100644
--- a/generators/client/templates/angular/src/main/webapp/app/admin/tracker/_tracker.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/admin/tracker/_tracker.component.ts
@@ -18,7 +18,7 @@
 -%>
 import { Component, OnInit, OnDestroy } from '@angular/core';
 
-import { <%=jhiPrefixCapitalized%>TrackerService } from 'app/shared';
+import { <%=jhiPrefixCapitalized%>TrackerService } from 'app/core';
 
 @Component({
     selector: '<%= jhiPrefixDashed %>-tracker',
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-delete-dialog.component.ts b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-delete-dialog.component.ts
index 566be0c2a0..17bdf92224 100644
--- a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-delete-dialog.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-delete-dialog.component.ts
@@ -21,7 +21,7 @@ import { ActivatedRoute } from '@angular/router';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { JhiEventManager } from 'ng-jhipster';
 
-import { User, UserService } from 'app/shared';
+import { User, UserService } from 'app/core';
 import { UserModalService } from './user-modal.service';
 
 @Component({
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-detail.component.ts b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-detail.component.ts
index 00632e10f5..cabbfe7d86 100644
--- a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-detail.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-detail.component.ts
@@ -20,7 +20,7 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
 import { ActivatedRoute } from '@angular/router';
 import { Subscription } from 'rxjs/Subscription';
 
-import { User, UserService } from 'app/shared';
+import { User, UserService } from 'app/core';
 
 @Component({
     selector: '<%= jhiPrefixDashed %>-user-mgmt-detail',
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-dialog.component.ts b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-dialog.component.ts
index 0ce6d55d56..f1ac6781b3 100644
--- a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-dialog.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management-dialog.component.ts
@@ -22,7 +22,7 @@ import { ActivatedRoute } from '@angular/router';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { JhiEventManager } from 'ng-jhipster';
 
-import { <% if (enableTranslation) { %>JhiLanguageHelper,<% } %> User, UserService } from 'app/shared';
+import { <% if (enableTranslation) { %>JhiLanguageHelper,<% } %> User, UserService } from 'app/core';
 import { UserModalService } from './user-modal.service';
 
 @Component({
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.component.ts b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.component.ts
index dba59d18ba..d5e4a5b570 100644
--- a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.component.ts
@@ -22,11 +22,12 @@ import { HttpResponse } from '@angular/common/http';
 import { ActivatedRoute, Router } from '@angular/router';
 import { JhiEventManager, JhiParseLinks, JhiAlertService } from 'ng-jhipster';
 
-import { ITEMS_PER_PAGE, Principal, User, UserService } from 'app/shared';
+import { ITEMS_PER_PAGE } from 'app/shared';
+import { Principal, UserService, User } from 'app/core';
 <%_ } else { _%>
 import { JhiEventManager, JhiAlertService } from 'ng-jhipster';
 
-import { Principal, User, UserService } from 'app/shared';
+import { Principal, UserService, User } from 'app/core';
 <%_ } _%>
 
 @Component({
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.route.ts b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.route.ts
index e91eafc702..176a3825a5 100644
--- a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.route.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.route.ts
@@ -20,7 +20,7 @@ import { Injectable } from '@angular/core';
 import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes, CanActivate } from '@angular/router';
 import { JhiPaginationUtil } from 'ng-jhipster';
 
-import { Principal } from 'app/shared';
+import { Principal } from 'app/core';
 import { UserMgmtComponent } from './user-management.component';
 import { UserMgmtDetailComponent } from './user-management-detail.component';
 import { UserDialogComponent } from './user-management-dialog.component';
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-modal.service.ts b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-modal.service.ts
index 972358d3c5..a5571ac5ad 100644
--- a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-modal.service.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-modal.service.ts
@@ -20,7 +20,7 @@ import { Injectable, Component } from '@angular/core';
 import { Router } from '@angular/router';
 import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 
-import { User, UserService } from 'app/shared';
+import { User, UserService } from 'app/core';
 
 @Injectable()
 export class UserModalService {
diff --git a/generators/client/templates/angular/src/main/webapp/app/blocks/interceptor/_auth-expired.interceptor.ts b/generators/client/templates/angular/src/main/webapp/app/blocks/interceptor/_auth-expired.interceptor.ts
index 9f3492260a..0c07a0f8d7 100644
--- a/generators/client/templates/angular/src/main/webapp/app/blocks/interceptor/_auth-expired.interceptor.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/blocks/interceptor/_auth-expired.interceptor.ts
@@ -23,17 +23,18 @@ import 'rxjs/add/operator/do';
 <%_ if (['oauth2', 'jwt', 'uaa'].includes(authenticationType)) { _%>
     <%_ if (authenticationType === 'uaa') { _%>
 import { Router } from '@angular/router';
-import { LoginModalService } from 'app/shared/login/login-modal.service';
-import { Principal } from 'app/shared/auth/principal.service';
+
+import { LoginModalService } from 'app/core/login/login-modal.service';
+import { Principal } from 'app/core/auth/principal.service';
     <%_ } _%>
-import { LoginService } from 'app/shared/login/login.service';
+import { LoginService } from 'app/core/login/login.service';
 <%_ } _%>
 <%_ if (['session', 'oauth2'].includes(authenticationType)) { _%>
     <%_ if (authenticationType === 'session') { _%>
-import { AuthServerProvider } from 'app/shared/auth/auth-session.service';
-import { LoginModalService } from 'app/shared/login/login-modal.service';
+import { AuthServerProvider } from 'app/core/auth/auth-session.service';
+import { LoginModalService } from 'app/core/login/login-modal.service';
     <%_ } _%>
-import { StateStorageService } from 'app/shared/auth/state-storage.service';
+import { StateStorageService } from 'app/core/auth/state-storage.service';
 <%_ } _%>
 
 export class AuthExpiredInterceptor implements HttpInterceptor {
diff --git a/generators/client/templates/angular/src/main/webapp/app/core/_core.module.ts b/generators/client/templates/angular/src/main/webapp/app/core/_core.module.ts
new file mode 100644
index 0000000000..07edd7c955
--- /dev/null
+++ b/generators/client/templates/angular/src/main/webapp/app/core/_core.module.ts
@@ -0,0 +1,83 @@
+import { NgModule, LOCALE_ID } from '@angular/core';
+import { DatePipe, registerLocaleData } from '@angular/common';
+import { Title } from '@angular/platform-browser';
+<%_ const localeId = getLocaleId(nativeLanguage); _%>
+import locale from '@angular/common/locales/<%= localeId %>';
+
+import {
+    <%_ if (websocket === 'spring-websocket') { _%>
+    <%=jhiPrefixCapitalized%>TrackerService,
+    WindowRef,
+    <%_ } _%>
+    <%_ if (enableTranslation) { _%>
+    JhiLanguageHelper,
+    <%_ } _%>
+    LoginService,
+    <%_ if (authenticationType !== 'oauth2') { _%>
+    LoginModalService,
+    <%_ } _%>
+    <%_ if (enableSocialSignIn) { _%>
+    SocialService,
+    <%_ } _%>
+    AccountService,
+    StateStorageService,
+    Principal,
+    CSRFService,
+    AuthServerProvider,
+    <%_ if (!skipUserManagement || authenticationType === 'oauth2') { _%>
+    UserService,
+    <%_ } _%>
+    UserRouteAccessService
+} from './';
+<%_ if (enableI18nRTL) { _%>
+import {
+    FindLanguageFromKeyPipe
+} from 'app/shared';<%_ } _%>
+
+@NgModule({
+    imports: [],
+    exports: [],
+    declarations: [],
+    providers: [
+        <%_ if (websocket === 'spring-websocket') { _%>
+        <%=jhiPrefixCapitalized%>TrackerService,
+        WindowRef,
+        <%_ } _%>
+        LoginService,
+        <%_ if (authenticationType !== 'oauth2') { _%>
+        LoginModalService,
+        <%_ } _%>
+        <%_ if (enableSocialSignIn) { _%>
+        SocialService,
+        <%_ } _%>
+        Title,
+        {
+            provide: LOCALE_ID,
+        <%_ if (skipLanguageForLocale(nativeLanguage)) { _%>
+            useValue: 'en'
+        <%_ } else { _%>
+            useValue: '<%= localeId %>'
+        <%_ } _%>
+        },
+        <%_ if (enableI18nRTL) { _%>
+        FindLanguageFromKeyPipe,
+        <%_ } if (enableTranslation) { _%>
+        JhiLanguageHelper,
+        <%_ } _%>
+        AccountService,
+        StateStorageService,
+        Principal,
+        CSRFService,
+        AuthServerProvider,
+        <%_ if (!skipUserManagement || authenticationType === 'oauth2') { _%>
+        UserService,
+        <%_ } _%>
+        DatePipe,
+        UserRouteAccessService
+    ]
+})
+export class <%=angularXAppName%>CoreModule {
+    constructor() {
+        registerLocaleData(locale);
+    }
+}
diff --git a/generators/client/templates/angular/src/main/webapp/app/core/_index.ts b/generators/client/templates/angular/src/main/webapp/app/core/_index.ts
new file mode 100644
index 0000000000..913b8f7f96
--- /dev/null
+++ b/generators/client/templates/angular/src/main/webapp/app/core/_index.ts
@@ -0,0 +1,31 @@
+export * from './auth/csrf.service';
+export * from './auth/state-storage.service';
+export * from './auth/account.service';
+<%_ if (authenticationType === 'jwt' || authenticationType === 'uaa') { _%>
+export * from './auth/auth-jwt.service';
+<%_ } else if (authenticationType === 'session' || authenticationType === 'oauth2') { _%>
+export * from './auth/auth-session.service';
+<%_ } _%>
+<%_ if (websocket === 'spring-websocket') { _%>
+export * from './tracker/tracker.service';
+export * from './tracker/window.service';
+<%_ } _%>
+<%_ if (enableSocialSignIn) { _%>
+export * from './social/social.service';
+<%_ } _%>
+<%_ if (enableTranslation) { _%>
+export * from './language/language.helper';
+export * from './language/language.constants';
+<%_ } _%>
+export * from './user/account.model';
+<%_ if (!skipUserManagement || authenticationType === 'oauth2') { _%>
+export * from './user/user.model';
+<%_ } _%>
+export * from './auth/principal.service';
+export * from './auth/user-route-access-service';
+<%_ if (authenticationType !== 'oauth2') { _%> 
+export * from './login/login-modal.service';
+<%_ } _%> 
+export * from './login/login.service';
+export * from './user/user.service';
+export * from './core.module';
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/auth/_account.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/auth/_account.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/auth/_account.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/auth/_account.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/auth/_auth-jwt.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/auth/_auth-jwt.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/auth/_auth-jwt.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/auth/_auth-jwt.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/auth/_auth-session.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/auth/_auth-session.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/auth/_auth-session.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/auth/_auth-session.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/auth/_csrf.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/auth/_csrf.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/auth/_csrf.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/auth/_csrf.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/auth/_principal.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/auth/_principal.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/auth/_principal.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/auth/_principal.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/auth/_state-storage.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/auth/_state-storage.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/auth/_state-storage.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/auth/_state-storage.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/auth/_user-route-access-service.ts b/generators/client/templates/angular/src/main/webapp/app/core/auth/_user-route-access-service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/auth/_user-route-access-service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/auth/_user-route-access-service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/language/_language.constants.ts b/generators/client/templates/angular/src/main/webapp/app/core/language/_language.constants.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/language/_language.constants.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/language/_language.constants.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/language/_language.helper.ts b/generators/client/templates/angular/src/main/webapp/app/core/language/_language.helper.ts
similarity index 95%
rename from generators/client/templates/angular/src/main/webapp/app/shared/language/_language.helper.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/language/_language.helper.ts
index b0357fd634..b3be625452 100644
--- a/generators/client/templates/angular/src/main/webapp/app/shared/language/_language.helper.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/core/language/_language.helper.ts
@@ -21,9 +21,9 @@ import { Title } from '@angular/platform-browser';
 import { Router, ActivatedRouteSnapshot } from '@angular/router';
 import { TranslateService, LangChangeEvent } from '@ngx-translate/core';
 
-import { LANGUAGES } from './language.constants';
+import { LANGUAGES } from 'app/core/language/language.constants';
 <%_ if (enableI18nRTL) { _%>
-import { FindLanguageFromKeyPipe } from './find-language-from-key.pipe';
+import { FindLanguageFromKeyPipe } from 'app/shared/language/find-language-from-key.pipe';
 <%_ } _%>
 
 @Injectable()
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/login/_login-modal.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/login/_login-modal.service.ts
similarity index 93%
rename from generators/client/templates/angular/src/main/webapp/app/shared/login/_login-modal.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/login/_login-modal.service.ts
index 4393a30ef6..12ec6dc727 100644
--- a/generators/client/templates/angular/src/main/webapp/app/shared/login/_login-modal.service.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/core/login/_login-modal.service.ts
@@ -19,7 +19,7 @@
 import { Injectable } from '@angular/core';
 import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 
-import { <%=jhiPrefixCapitalized%>LoginModalComponent } from './login.component';
+import { <%=jhiPrefixCapitalized%>LoginModalComponent } from 'app/shared/login/login.component';
 
 @Injectable()
 export class LoginModalService {
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/login/_login.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/login/_login.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/login/_login.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/login/_login.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/social/_social.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/social/_social.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/social/_social.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/social/_social.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/tracker/_tracker.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/tracker/_tracker.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/tracker/_tracker.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/tracker/_tracker.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/tracker/_window.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/tracker/_window.service.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/tracker/_window.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/tracker/_window.service.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/user/_account.model.ts b/generators/client/templates/angular/src/main/webapp/app/core/user/_account.model.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/user/_account.model.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/user/_account.model.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/user/_user.model.ts b/generators/client/templates/angular/src/main/webapp/app/core/user/_user.model.ts
similarity index 100%
rename from generators/client/templates/angular/src/main/webapp/app/shared/user/_user.model.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/user/_user.model.ts
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/user/_user.service.ts b/generators/client/templates/angular/src/main/webapp/app/core/user/_user.service.ts
similarity index 97%
rename from generators/client/templates/angular/src/main/webapp/app/shared/user/_user.service.ts
rename to generators/client/templates/angular/src/main/webapp/app/core/user/_user.service.ts
index 55a816599d..76a504f765 100644
--- a/generators/client/templates/angular/src/main/webapp/app/shared/user/_user.service.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/core/user/_user.service.ts
@@ -21,8 +21,8 @@ import { HttpClient, HttpResponse } from '@angular/common/http';
 import { Observable } from 'rxjs/Observable';
 
 import { SERVER_API_URL } from 'app/app.constants';
+import { createRequestOption } from 'app/shared/util/request-util';
 import { IUser } from './user.model';
-import { createRequestOption } from '../util/request-util';
 
 @Injectable()
 export class UserService {
diff --git a/generators/client/templates/angular/src/main/webapp/app/home/_home.component.ts b/generators/client/templates/angular/src/main/webapp/app/home/_home.component.ts
index 9fb153a614..da2df3d421 100644
--- a/generators/client/templates/angular/src/main/webapp/app/home/_home.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/home/_home.component.ts
@@ -22,7 +22,7 @@ import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 <%_ } _%>
 import { JhiEventManager } from 'ng-jhipster';
 
-import { Account, <% if (authenticationType !== 'oauth2') { %>LoginModalService<% } else { %>LoginService<% } %>, Principal } from 'app/shared';
+import { <% if (authenticationType !== 'oauth2') { %>LoginModalService<% } else { %>LoginService<% } %>, Principal, Account } from 'app/core';
 
 @Component({
     selector: '<%= jhiPrefixDashed %>-home',
diff --git a/generators/client/templates/angular/src/main/webapp/app/layouts/main/_main.component.ts b/generators/client/templates/angular/src/main/webapp/app/layouts/main/_main.component.ts
index 99021ada34..0bae640d89 100644
--- a/generators/client/templates/angular/src/main/webapp/app/layouts/main/_main.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/layouts/main/_main.component.ts
@@ -20,7 +20,7 @@ import { Component, OnInit } from '@angular/core';
 import { Router, ActivatedRouteSnapshot, NavigationEnd } from '@angular/router';
 
 <%_ if (enableTranslation) { _%>
-import { JhiLanguageHelper } from 'app/shared';
+import { JhiLanguageHelper } from 'app/core';
 <%_ } else { _%>
 import { Title } from '@angular/platform-browser';
 <%_ } _%>
diff --git a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/_navbar.component.ts b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/_navbar.component.ts
index 308e867082..7962b2048a 100644
--- a/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/_navbar.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/_navbar.component.ts
@@ -24,7 +24,7 @@ import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 import { JhiLanguageService } from 'ng-jhipster';
 
 import { VERSION } from 'app/app.constants';
-import { <% if (enableTranslation) { %>JhiLanguageHelper, <% } %>Principal, <% if (authenticationType !== 'oauth2') { %>LoginModalService, <% } %>LoginService } from 'app/shared';
+import { <% if (enableTranslation) { %>JhiLanguageHelper, <% } %>Principal, <% if (authenticationType !== 'oauth2') { %>LoginModalService, <% } %>LoginService } from 'app/core';
 import { ProfileService } from '../profiles/profile.service';
 
 @Component({
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/_index.ts b/generators/client/templates/angular/src/main/webapp/app/shared/_index.ts
index 0e695e6a68..95c255a186 100644
--- a/generators/client/templates/angular/src/main/webapp/app/shared/_index.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/shared/_index.ts
@@ -20,38 +20,15 @@ export * from './constants/error.constants';
 export * from './constants/pagination.constants';
 export * from './alert/alert.component';
 export * from './alert/alert-error.component';
-export * from './auth/csrf.service';
-export * from './auth/state-storage.service';
-export * from './auth/account.service';
-<%_ if (authenticationType === 'jwt' || authenticationType === 'uaa') { _%>
-export * from './auth/auth-jwt.service';
-<%_ } else if (authenticationType === 'session' || authenticationType === 'oauth2') { _%>
-export * from './auth/auth-session.service';
-<%_ } _%>
-export * from './auth/principal.service';
 export * from './auth/has-any-authority.directive';
-export * from './auth/user-route-access-service';
 <%_ if (enableTranslation) { _%>
-export * from './language/language.constants';
-export * from './language/language.helper';
 export * from './language/find-language-from-key.pipe';
 <%_ } _%>
-<%_ if (websocket === 'spring-websocket') { _%>
-export * from './tracker/tracker.service';
-<%_ } _%>
 <%_ if (authenticationType !== 'oauth2') { _%>
 export * from './login/login.component';
-export * from './login/login-modal.service';
-<%_ } _%>
-export * from './login/login.service';
-export * from './user/account.model';
-<%_ if (!skipUserManagement || authenticationType === 'oauth2') { _%>
-export * from './user/user.model';
-export * from './user/user.service';
 <%_ } _%>
 export * from './util/request-util';
 <%_ if (enableSocialSignIn) { _%>
-export * from './social/social.service';
 export * from './social/social.component';
 <%_ } _%>
 export * from './shared-libs.module';
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/_shared-common.module.ts b/generators/client/templates/angular/src/main/webapp/app/shared/_shared-common.module.ts
index 1a4300b1e0..8a58252e3a 100644
--- a/generators/client/templates/angular/src/main/webapp/app/shared/_shared-common.module.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/shared/_shared-common.module.ts
@@ -16,19 +16,11 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -%>
-import { NgModule, LOCALE_ID } from '@angular/core';
-import { Title } from '@angular/platform-browser';
-import { registerLocaleData } from '@angular/common';
-<%_ const localeId = getLocaleId(nativeLanguage); _%>
-import locale from '@angular/common/locales/<%= localeId %>';
+import { NgModule } from '@angular/core';
 
-<%_ if (websocket === 'spring-websocket') { _%>
-import { WindowRef } from './tracker/window.service';
-<%_ } _%>
 import {
     <%=angularXAppName%>SharedLibsModule,
     <%_ if (enableTranslation) { _%>
-    JhiLanguageHelper,
     FindLanguageFromKeyPipe,
     <%_ } _%>
     <%=jhiPrefixCapitalized%>AlertComponent,
@@ -46,24 +38,7 @@ import {
         <%=jhiPrefixCapitalized%>AlertComponent,
         <%=jhiPrefixCapitalized%>AlertErrorComponent
     ],
-    providers: [
-        <%_ if (enableI18nRTL) { _%>
-        FindLanguageFromKeyPipe,
-        <%_ } if (enableTranslation) { _%>
-        JhiLanguageHelper,
-        <%_ } if (websocket === 'spring-websocket') { _%>
-        WindowRef,
-        <%_ } _%>
-        Title,
-        {
-            provide: LOCALE_ID,
-        <%_ if (skipLanguageForLocale(nativeLanguage)) { _%>
-            useValue: 'en'
-        <%_ } else { _%>
-            useValue: '<%= localeId %>'
-        <%_ } _%>
-        },
-    ],
+    providers: [],
     exports: [
         <%=angularXAppName%>SharedLibsModule,
         <%_ if (enableTranslation) { _%>
@@ -73,8 +48,4 @@ import {
         <%=jhiPrefixCapitalized%>AlertErrorComponent
     ]
 })
-export class <%=angularXAppName%>SharedCommonModule {
-    constructor() {
-        registerLocaleData(locale);
-    }
-}
+export class <%=angularXAppName%>SharedCommonModule {}
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/_shared.module.ts b/generators/client/templates/angular/src/main/webapp/app/shared/_shared.module.ts
index 7f09c56032..9259287d91 100644
--- a/generators/client/templates/angular/src/main/webapp/app/shared/_shared.module.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/shared/_shared.module.ts
@@ -17,31 +17,16 @@
  limitations under the License.
 -%>
 import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { DatePipe } from '@angular/common';
 
 import {
     <%=angularXAppName%>SharedLibsModule,
     <%=angularXAppName%>SharedCommonModule,
-    CSRFService,
-    AuthServerProvider,
-    AccountService,
-    <%_ if (!skipUserManagement || authenticationType === 'oauth2') { _%>
-    UserService,
-    <%_ } _%>
-    StateStorageService,
-    LoginService,
     <%_ if (authenticationType !== 'oauth2') { _%>
-    LoginModalService,
     <%=jhiPrefixCapitalized%>LoginModalComponent,
     <%_ } _%>
-    Principal,
-    <%_ if (websocket === 'spring-websocket') { _%>
-    <%=jhiPrefixCapitalized%>TrackerService,
-    <%_ } _%>
     HasAnyAuthorityDirective,
     <%_ if (enableSocialSignIn) { _%>
-    <%=jhiPrefixCapitalized%>SocialComponent,
-    SocialService,
+    <%=jhiPrefixCapitalized%>SocialComponent
     <%_ } _%>
 } from './';
 
@@ -59,27 +44,7 @@ import {
         <%_ } _%>
         HasAnyAuthorityDirective
     ],
-    providers: [
-        LoginService,
-        <%_ if (authenticationType !== 'oauth2') { _%>
-        LoginModalService,
-        <%_ } _%>
-        AccountService,
-        StateStorageService,
-        Principal,
-        CSRFService,
-        <%_ if (websocket === 'spring-websocket') { _%>
-        <%=jhiPrefixCapitalized%>TrackerService,
-        <%_ } _%>
-        AuthServerProvider,
-        <%_ if (enableSocialSignIn) { _%>
-        SocialService,
-        <%_ } _%>
-        <%_ if (!skipUserManagement || authenticationType === 'oauth2') { _%>
-        UserService,
-        <%_ } _%>
-        DatePipe
-    ],
+    providers: [],
     <%_ if (authenticationType !== 'oauth2') { _%>
     entryComponents: [<%=jhiPrefixCapitalized%>LoginModalComponent],
     <%_ } _%>
@@ -91,8 +56,7 @@ import {
         <%_ if (authenticationType !== 'oauth2') { _%>
         <%=jhiPrefixCapitalized%>LoginModalComponent,
         <%_ } _%>
-        HasAnyAuthorityDirective,
-        DatePipe
+        HasAnyAuthorityDirective
     ],
     schemas: [CUSTOM_ELEMENTS_SCHEMA]
 
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/auth/_has-any-authority.directive.ts b/generators/client/templates/angular/src/main/webapp/app/shared/auth/_has-any-authority.directive.ts
index 74b1864aec..c4665e1617 100644
--- a/generators/client/templates/angular/src/main/webapp/app/shared/auth/_has-any-authority.directive.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/shared/auth/_has-any-authority.directive.ts
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';
-import { Principal } from './principal.service';
+import { Principal } from 'app/core/auth/principal.service';
 
 /**
  * @whatItDoes Conditionally includes an HTML element if current user has any
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/login/_login.component.ts b/generators/client/templates/angular/src/main/webapp/app/shared/login/_login.component.ts
index 7baaae57bf..bcdfcf00e9 100644
--- a/generators/client/templates/angular/src/main/webapp/app/shared/login/_login.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/shared/login/_login.component.ts
@@ -21,8 +21,8 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { Router } from '@angular/router';
 import { JhiEventManager } from 'ng-jhipster';
 
-import { LoginService } from './login.service';
-import { StateStorageService } from '../auth/state-storage.service';
+import { LoginService } from 'app/core/login/login.service';
+import { StateStorageService } from 'app/core/auth/state-storage.service';
 
 @Component({
     selector: '<%= jhiPrefixDashed %>-login-modal',
diff --git a/generators/client/templates/angular/src/main/webapp/app/shared/social/_social.component.ts b/generators/client/templates/angular/src/main/webapp/app/shared/social/_social.component.ts
index a16b5d87a3..afaf64cbf7 100644
--- a/generators/client/templates/angular/src/main/webapp/app/shared/social/_social.component.ts
+++ b/generators/client/templates/angular/src/main/webapp/app/shared/social/_social.component.ts
@@ -17,8 +17,9 @@
  limitations under the License.
 -%>
 import { Component, Input, OnInit } from '@angular/core';
-import { SocialService } from './social.service';
-import { CSRFService } from '../auth/csrf.service';
+
+import { SocialService } from 'app/core/social/social.service';
+import { CSRFService } from 'app/core/auth/csrf.service';
 
 @Component({
     selector: '<%= jhiPrefixDashed %>-social',
diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management-dialog.component.ts b/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management-dialog.component.ts
index 6edd60e61f..52413ff9f9 100644
--- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management-dialog.component.ts
+++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management-dialog.component.ts
@@ -53,7 +53,7 @@ Object.keys(differentRelationships).forEach(key => {
         if (uniqueRel.otherEntityAngularName !== entityAngularName) {
             if(uniqueRel.otherEntityAngularName === 'User') {
 _%>
-import { I<%= uniqueRel.otherEntityAngularName %>, <%= uniqueRel.otherEntityAngularName%>Service } from 'app/shared';
+import { I<%= uniqueRel.otherEntityAngularName %>, <%= uniqueRel.otherEntityAngularName%>Service } from 'app/core';
 <%_         } else { _%>
 import { I<%= uniqueRel.otherEntityAngularName %> } from 'app/shared/model/<%= uniqueRel.otherEntityModelName %>.model';
 import { <%= uniqueRel.otherEntityAngularName%>Service } from '../<%= uniqueRel.otherEntityModulePath %>';
diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management.component.ts b/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management.component.ts
index ff8e78bd77..3a2392c469 100644
--- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management.component.ts
+++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management.component.ts
@@ -27,7 +27,10 @@ import { Subscription } from 'rxjs/Subscription';
 import { JhiEventManager, <% if (pagination !== 'no') { %>JhiParseLinks, <% } %>JhiAlertService<% if (fieldsContainBlob) { %>, JhiDataUtils<% } %> } from 'ng-jhipster';
 
 import { I<%= entityAngularName %> } from 'app/shared/model/<%= entityModelFileName %>.model';
-import { <% if (pagination !== 'no') { %>ITEMS_PER_PAGE, <% } %>Principal } from 'app/shared';
+import { Principal } from 'app/core';
+<%_ if (pagination !== 'no') { %>
+import { ITEMS_PER_PAGE } from 'app/shared';
+<%_ } _%>
 import { <%= entityAngularName %>Service } from './<%= entityFileName %>.service';
 
 @Component({
diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management.route.ts b/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management.route.ts
index 3e24d87e81..de34025d4d 100644
--- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management.route.ts
+++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity-management.route.ts
@@ -38,7 +38,7 @@ import { <% if (pagination === 'pagination' || pagination === 'pager') { %>Resol
 import { JhiPaginationUtil } from 'ng-jhipster';
 <%_ } _%>
 
-import { UserRouteAccessService } from 'app/shared';
+import { UserRouteAccessService } from 'app/core';
 import { <%= entityAngularName %>Component } from './<%= entityFileName %>.component';
 import { <%= entityAngularName %>DetailComponent } from './<%= entityFileName %>-detail.component';
 import { <%= entityAngularName %>PopupComponent } from './<%= entityFileName %>-dialog.component';
diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity.model.ts b/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity.model.ts
index 378be96a76..bc7c442fc9 100644
--- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity.model.ts
+++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/_entity.model.ts
@@ -81,7 +81,7 @@ relationships.forEach(relationship => {
 });
 _%>
 <%_ if (hasUserRelationship) { _%>
-import { IUser } from 'app/shared/user/user.model';
+import { IUser } from 'app/core/user/user.model';
 <%_ } _%>
 <%_ typeImports.forEach(typeImport => { _%>
 <%- typeImport %>;
diff --git a/generators/entity/index.js b/generators/entity/index.js
index 485aa74e69..c174bfb4eb 100644
--- a/generators/entity/index.js
+++ b/generators/entity/index.js
@@ -680,7 +680,7 @@ module.exports = class extends BaseGenerator {
                             }
                         } else {
                             relationship.otherEntityModuleName = `${context.angularXAppName}SharedModule`;
-                            relationship.otherEntityModulePath = 'app/shared';
+                            relationship.otherEntityModulePath = 'app/core';
                         }
                     }
                     // Load in-memory data for root
diff --git a/generators/generator-base-private.js b/generators/generator-base-private.js
index 43b4de3500..52dfd03955 100644
--- a/generators/generator-base-private.js
+++ b/generators/generator-base-private.js
@@ -176,7 +176,7 @@ module.exports = class extends Generator {
      * @param languages
      */
     updateLanguagesInLanguageConstantNG2(languages) {
-        const fullPath = `${CLIENT_MAIN_SRC_DIR}app/shared/language/language.constants.ts`;
+        const fullPath = `${CLIENT_MAIN_SRC_DIR}app/core/language/language.constants.ts`;
         try {
             let content = 'export const LANGUAGES: string[] = [\n';
             languages.forEach((language, i) => {
diff --git a/generators/generator-constants.js b/generators/generator-constants.js
index f303fc5cbc..4f94db8e5d 100644
--- a/generators/generator-constants.js
+++ b/generators/generator-constants.js
@@ -41,7 +41,7 @@ const DOCKER_JHIPSTER_LOGSTASH = 'jhipster/jhipster-logstash:v3.0.1';
 const DOCKER_JHIPSTER_IMPORT_DASHBOARDS = 'jhipster/jhipster-import-dashboards:v3.0.1';
 const DOCKER_JHIPSTER_ZIPKIN = 'jhipster/jhipster-zipkin:v3.0.1';
 const DOCKER_TRAEFIK = 'traefik:1.4';
-const DOCKER_CONSUL = 'consul:0.9.3';
+const DOCKER_CONSUL = 'consul:1.0.2';
 const DOCKER_CONSUL_CONFIG_LOADER = 'jhipster/consul-config-loader:v0.2.2';
 const DOCKER_PROMETHEUS = 'prom/prometheus:v1.6.3';
 const DOCKER_PROMETHEUS_ALERTMANAGER = 'prom/alertmanager:v0.6.2';
diff --git a/generators/server/templates/src/main/java/package/service/_UserService.java b/generators/server/templates/src/main/java/package/service/_UserService.java
index 401d67f8ab..00a03fadd0 100644
--- a/generators/server/templates/src/main/java/package/service/_UserService.java
+++ b/generators/server/templates/src/main/java/package/service/_UserService.java
@@ -158,8 +158,7 @@ public class UserService {
                 userSearchRepository.save(user);
                 <%_ } _%>
                 <%_ if (cacheManagerIsAvailable === true) { _%>
-                cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-                cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+                this.clearUserCaches(user);
                 <%_ } _%>
                 log.debug("Activated user: {}", user);
                 return user;
@@ -179,8 +178,7 @@ public class UserService {
                 userRepository.save(user);
                 <%_ } _%>
                 <%_ if (cacheManagerIsAvailable === true) { _%>
-                cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-                cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+                this.clearUserCaches(user);
                 <%_ } _%>
                 return user;
            });
@@ -196,8 +194,7 @@ public class UserService {
                 userRepository.save(user);
                 <%_ } _%>
                 <%_ if (cacheManagerIsAvailable === true) { _%>
-                cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-                cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+                this.clearUserCaches(user);
                 <%_ } _%>
                 return user;
             });
@@ -205,9 +202,7 @@ public class UserService {
 
     public User registerUser(UserDTO userDTO, String password) {
 
-        User newUser = new User();<% if (databaseType === 'sql' || databaseType === 'mongodb') { %>
-        Authority authority = authorityRepository.findById(AuthoritiesConstants.USER).get();
-        Set<Authority> authorities = new HashSet<>();<% } %><% if (databaseType === 'cassandra') { %>
+        User newUser = new User();<% if (databaseType === 'cassandra') { %>
         newUser.setId(UUID.randomUUID().toString());<% } %><% if (databaseType === 'cassandra' || databaseType === 'couchbase') { %>
         Set<String> authorities = new HashSet<>();<% } %>
         String encryptedPassword = passwordEncoder.encode(password);
@@ -226,7 +221,8 @@ public class UserService {
         // new user gets registration key
         newUser.setActivationKey(RandomUtil.generateActivationKey());
         <%_ if (databaseType === 'sql' || databaseType === 'mongodb') { _%>
-        authorities.add(authority);
+        Set<Authority> authorities = new HashSet<>();
+        authorityRepository.findById(AuthoritiesConstants.USER).ifPresent(authorities::add);
         <%_ } _%>
         <%_ if (databaseType === 'cassandra' || databaseType === 'couchbase') { _%>
         authorities.add(AuthoritiesConstants.USER);
@@ -235,8 +231,7 @@ public class UserService {
         userRepository.save(newUser);<% if (searchEngine === 'elasticsearch') { %>
         userSearchRepository.save(newUser);<% } %>
         <%_ if (cacheManagerIsAvailable === true) { _%>
-        cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(newUser.getLogin());
-        cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(newUser.getEmail());
+        this.clearUserCaches(newUser);
         <%_ } _%>
         log.debug("Created Information for User: {}", newUser);
         return newUser;
@@ -278,8 +273,7 @@ public class UserService {
         userRepository.save(user);<% if (searchEngine === 'elasticsearch') { %>
         userSearchRepository.save(user);<% } %>
         <%_ if (cacheManagerIsAvailable === true) { _%>
-        cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-        cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+        this.clearUserCaches(user);
         <%_ } _%>
         log.debug("Created Information for User: {}", user);
         return user;
@@ -301,9 +295,6 @@ public class UserService {
         SecurityUtils.getCurrentUserLogin()
             .flatMap(userRepository::findOneByLogin)
             .ifPresent(user -> {
-                <%_ if (cacheManagerIsAvailable === true) { _%>
-                cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
-                <%_ } _%>
                 user.setFirstName(firstName);
                 user.setLastName(lastName);
                 user.setEmail(email);
@@ -318,8 +309,7 @@ public class UserService {
                 userSearchRepository.save(user);
                 <%_ } _%>
                 <%_ if (cacheManagerIsAvailable === true) { _%>
-                cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-                cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+                this.clearUserCaches(user);
                 <%_ } _%>
                 log.debug("Changed Information for User: {}", user);
             });
@@ -343,8 +333,7 @@ public class UserService {
                 }
                 <%_ } _%>
                 <%_ if (cacheManagerIsAvailable === true) { _%>
-                cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-                cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+                this.clearUserCaches(user);
                 <%_ } _%>
                 user.setLogin(userDTO.getLogin());
                 user.setFirstName(userDTO.getFirstName());
@@ -373,8 +362,7 @@ public class UserService {
                 userSearchRepository.save(user);
                 <%_ } _%>
                 <%_ if (cacheManagerIsAvailable === true) { _%>
-                cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-                cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+                this.clearUserCaches(user);
                 <%_ } _%>
                 log.debug("Changed Information for User: {}", user);
                 return user;
@@ -392,8 +380,7 @@ public class UserService {
             userSearchRepository.delete(user);
             <%_ } _%>
             <%_ if (cacheManagerIsAvailable === true) { _%>
-            cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-            cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+            this.clearUserCaches(user);
             <%_ } _%>
             log.debug("Deleted User: {}", user);
         });
@@ -412,8 +399,7 @@ public class UserService {
                 userRepository.save(user);
                 <%_ } _%>
                 <%_ if (cacheManagerIsAvailable === true) { _%>
-                cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-                cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+                this.clearUserCaches(user);
                 <%_ } _%>
                 log.debug("Changed password for User: {}", user);
             });
@@ -504,8 +490,7 @@ public class UserService {
             userSearchRepository.delete(user);
             <%_ } _%>
             <%_ if (cacheManagerIsAvailable === true) { _%>
-            cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-            cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+            this.clearUserCaches(user);
             <%_ } _%>
         }
     }
@@ -571,8 +556,7 @@ public class UserService {
             log.debug("Saving user '{}' in local database...", user.getLogin());
             userRepository.save(user);
             <%_ if (cacheManagerIsAvailable === true) { _%>
-            cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).evict(user.getLogin());
-            cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).evict(user.getEmail());
+            this.clearUserCaches(user);
             <%_ } _%>
         }
         return user;
@@ -650,5 +634,11 @@ public class UserService {
                     })<% } %>.collect(Collectors.toSet());
     }
     <%_ } _%>
+    <%_ if (cacheManagerIsAvailable === true) { _%>
 
+    private void clearUserCaches(User user) {
+        Objects.requireNonNull(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE)).evict(user.getLogin());
+        Objects.requireNonNull(cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE)).evict(user.getEmail());
+    }
+    <%_ } _%>
 }


Test patch:
diff --git a/generators/client/templates/angular/src/test/javascript/spec/_test.module.ts b/generators/client/templates/angular/src/test/javascript/spec/_test.module.ts
index 6a0db4b27c..073a60c884 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/_test.module.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/_test.module.ts
@@ -25,11 +25,11 @@ import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
 import { JhiLanguageService, JhiDataUtils, JhiDateUtils, JhiEventManager, JhiAlertService, JhiParseLinks } from 'ng-jhipster';
 
 import { MockLanguageService, MockLanguageHelper } from './helpers/mock-language.service';
-import { JhiLanguageHelper, Principal, AccountService<% if (authenticationType !== 'oauth2') { %>, LoginModalService<% } %><% if (websocket === 'spring-websocket') { %>, <%=jhiPrefixCapitalized%>TrackerService<% } %> } from 'app/shared';
+import { JhiLanguageHelper, Principal, AccountService<% if (authenticationType !== 'oauth2') { %>, LoginModalService<% } %><% if (websocket === 'spring-websocket') { %>, <%=jhiPrefixCapitalized%>TrackerService<% } %> } from 'app/core';
 <%_ } else { _%>
 import { JhiDataUtils, JhiDateUtils, JhiEventManager, JhiAlertService, JhiParseLinks } from 'ng-jhipster';
 
-import { Principal, AccountService<% if (authenticationType !== 'oauth2') { %>, LoginModalService<% } %><% if (websocket === 'spring-websocket') { %>, JhiTrackerService<% } %> } from 'app/shared';
+import { Principal, AccountService<% if (authenticationType !== 'oauth2') { %>, LoginModalService<% } %><% if (websocket === 'spring-websocket') { %>, JhiTrackerService<% } %> } from 'app/core';
 <%_ } _%>
 import { MockPrincipal } from './helpers/mock-principal.service';
 import { MockAccountService } from './helpers/mock-account.service';
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/account/password-reset/init/_password-reset-init.component.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/account/password-reset/init/_password-reset-init.component.spec.ts
index eaf690b7d1..314335a097 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/account/password-reset/init/_password-reset-init.component.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/account/password-reset/init/_password-reset-init.component.spec.ts
@@ -98,9 +98,7 @@ describe('Component Tests', () => {
             inject([PasswordResetInitService], (service: PasswordResetInitService) => {
                 spyOn(service, 'save').and.returnValue(Observable.throw({
                     status: 400,
-                    json() {
-                        return {type : EMAIL_NOT_FOUND_TYPE};
-                    }
+                    error : {type : EMAIL_NOT_FOUND_TYPE }
                 }));
                 comp.resetAccount.email = 'user@domain.com';
 
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/account/password/_password.component.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/account/password/_password.component.spec.ts
index c959fa468b..f68ae19eb4 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/account/password/_password.component.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/account/password/_password.component.spec.ts
@@ -23,10 +23,10 @@ import { Observable } from 'rxjs/Observable';
 import { <%=angularXAppName%>TestModule } from '../../../test.module';
 import { PasswordComponent } from 'app/account/password/password.component';
 import { PasswordService } from 'app/account/password/password.service';
-import { Principal } from 'app/shared/auth/principal.service';
-import { AccountService } from 'app/shared/auth/account.service';
+import { Principal } from 'app/core/auth/principal.service';
+import { AccountService } from 'app/core/auth/account.service';
 <%_ if (websocket === 'spring-websocket') { _%>
-import { <%=jhiPrefixCapitalized%>TrackerService } from 'app/shared/tracker/tracker.service';
+import { <%=jhiPrefixCapitalized%>TrackerService } from 'app/core/tracker/tracker.service';
 import { MockTrackerService } from '../../../helpers/mock-tracker.service';
 <%_ } _%>
 
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/account/sessions/_sessions.component.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/account/sessions/_sessions.component.spec.ts
index efc52a7e60..95bb93f674 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/account/sessions/_sessions.component.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/account/sessions/_sessions.component.spec.ts
@@ -24,7 +24,7 @@ import { Session } from 'app/account/sessions/session.model';
 import { SessionsComponent } from 'app/account/sessions/sessions.component';
 import { SessionsService } from 'app/account/sessions/sessions.service';
 import { MockPrincipal } from '../../../helpers/mock-principal.service';
-import { Principal } from 'app/shared/auth/principal.service';
+import { Principal } from 'app/core/auth/principal.service';
 
 describe('Component Tests', () => {
 
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/account/settings/_settings.component.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/account/settings/_settings.component.spec.ts
index 236387b7b0..e29ed5d16e 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/account/settings/_settings.component.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/account/settings/_settings.component.spec.ts
@@ -20,10 +20,10 @@ import { ComponentFixture, TestBed, async } from '@angular/core/testing';
 import { Observable } from 'rxjs/Observable';
 
 import { <%=angularXAppName%>TestModule } from '../../../test.module';
-import { Principal, AccountService } from 'app/shared';
+import { Principal, AccountService } from 'app/core';
 import { SettingsComponent } from 'app/account/settings/settings.component';
 <%_ if (websocket === 'spring-websocket') { _%>
-import { <%=jhiPrefixCapitalized%>TrackerService } from 'app/shared/tracker/tracker.service';
+import { <%=jhiPrefixCapitalized%>TrackerService } from 'app/core/tracker/tracker.service';
 import { MockTrackerService } from '../../../helpers/mock-tracker.service';
 <%_ } _%>
 
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-delete-dialog.component.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-delete-dialog.component.spec.ts
index ee66fa96b6..ef1541cd7d 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-delete-dialog.component.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-delete-dialog.component.spec.ts
@@ -23,7 +23,7 @@ import { JhiEventManager } from 'ng-jhipster';
 
 import { <%=angularXAppName%>TestModule } from '../../../test.module';
 import { UserMgmtDeleteDialogComponent } from 'app/admin/user-management/user-management-delete-dialog.component';
-import { UserService } from 'app/shared';
+import { UserService } from 'app/core';
 
 describe('Component Tests', () => {
 
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-detail.component.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-detail.component.spec.ts
index 3b389c01b1..38ae85eb56 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-detail.component.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-detail.component.spec.ts
@@ -6,7 +6,7 @@ import { Observable } from 'rxjs/Observable';
 import { <%=angularXAppName%>TestModule } from '../../../test.module';
 import { MockActivatedRoute } from '../../../helpers/mock-route.service';
 import { UserMgmtDetailComponent } from 'app/admin/user-management/user-management-detail.component';
-import { UserService, User } from 'app/shared';
+import { UserService, User } from 'app/core';
 
 describe('Component Tests', () => {
 
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-dialog.component.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-dialog.component.spec.ts
index 84d544d716..411c2a67b2 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-dialog.component.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management-dialog.component.spec.ts
@@ -27,7 +27,7 @@ import { JhiEventManager } from 'ng-jhipster';
 
 import { <%=angularXAppName%>TestModule } from '../../../test.module';
 import { UserMgmtDialogComponent } from 'app/admin/user-management/user-management-dialog.component';
-import { UserService, User<% if(enableTranslation) { %>, JhiLanguageHelper<% } %> } from 'app/shared';
+import { UserService, User<% if(enableTranslation) { %>, JhiLanguageHelper<% } %> } from 'app/core';
 
 describe('Component Tests', () => {
 
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management.component.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management.component.spec.ts
index 78e4fa4c2e..74d6caa8af 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management.component.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/_user-management.component.spec.ts
@@ -25,7 +25,7 @@ import { HttpHeaders, HttpResponse } from '@angular/common/http';
 
 import { <%=angularXAppName%>TestModule } from '../../../test.module';
 import { UserMgmtComponent } from 'app/admin/user-management/user-management.component';
-import { UserService, User } from 'app/shared';
+import { UserService, User } from 'app/core';
 
 describe('Component Tests', () => {
 
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/shared/user/_user.service.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/core/user/_user.service.spec.ts
similarity index 98%
rename from generators/client/templates/angular/src/test/javascript/spec/app/shared/user/_user.service.spec.ts
rename to generators/client/templates/angular/src/test/javascript/spec/app/core/user/_user.service.spec.ts
index d1e469930d..27cd0babe5 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/shared/user/_user.service.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/core/user/_user.service.spec.ts
@@ -19,7 +19,7 @@ limitations under the License.
 import { TestBed } from '@angular/core/testing';
 import { JhiDateUtils } from 'ng-jhipster';
 
-import { UserService, User } from 'app/shared';
+import { UserService, User } from 'app/core';
 import { SERVER_API_URL } from 'app/app.constants';
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/shared/login/_login.component.spec.ts b/generators/client/templates/angular/src/test/javascript/spec/app/shared/login/_login.component.spec.ts
index b1e8ee2e07..2fb800aac0 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/shared/login/_login.component.spec.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/shared/login/_login.component.spec.ts
@@ -21,9 +21,9 @@ import { Router } from '@angular/router';
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { JhiEventManager } from 'ng-jhipster';
 
-import { LoginService } from 'app/shared/login/login.service';
+import { LoginService } from 'app/core/login/login.service';
 import { <%=jhiPrefixCapitalized%>LoginModalComponent } from 'app/shared/login/login.component';
-import { StateStorageService } from 'app/shared/auth/state-storage.service';
+import { StateStorageService } from 'app/core/auth/state-storage.service';
 import { <%=angularXAppName%>TestModule } from '../../../test.module';
 import { MockLoginService } from '../../../helpers/mock-login.service';
 import { MockStateStorageService } from '../../../helpers/mock-state-storage.service';
diff --git a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-account.service.ts b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-account.service.ts
index c9f26d7b30..f82c71cb96 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-account.service.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-account.service.ts
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 import { SpyObject } from './spyobject';
-import { AccountService } from 'app/shared/auth/account.service';
+import { AccountService } from 'app/core/auth/account.service';
 import Spy = jasmine.Spy;
 
 export class MockAccountService extends SpyObject {
diff --git a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-language.service.ts b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-language.service.ts
index 3e9989394b..cdacb3ac64 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-language.service.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-language.service.ts
@@ -18,7 +18,7 @@
 -%>
 import { SpyObject } from './spyobject';
 import { JhiLanguageService } from 'ng-jhipster';
-import { JhiLanguageHelper } from 'app/shared/language/language.helper';
+import { JhiLanguageHelper } from 'app/core/language/language.helper';
 import Spy = jasmine.Spy;
 
 export class MockLanguageService extends SpyObject {
diff --git a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-login.service.ts b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-login.service.ts
index 9b738072d2..6c0802d670 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-login.service.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-login.service.ts
@@ -17,7 +17,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 -%>
 import { SpyObject } from './spyobject';
-import { LoginService } from 'app/shared/login/login.service';
+import { LoginService } from 'app/core/login/login.service';
 import Spy = jasmine.Spy;
 
 export class MockLoginService extends SpyObject {
diff --git a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-principal.service.ts b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-principal.service.ts
index a838afb410..895f914bca 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-principal.service.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-principal.service.ts
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 import { SpyObject } from './spyobject';
-import { Principal } from 'app/shared/auth/principal.service';
+import { Principal } from 'app/core/auth/principal.service';
 import Spy = jasmine.Spy;
 
 export class MockPrincipal extends SpyObject {
diff --git a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-state-storage.service.ts b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-state-storage.service.ts
index fbd293504a..dbac863c51 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-state-storage.service.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-state-storage.service.ts
@@ -17,7 +17,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 -%>
 import { SpyObject } from './spyobject';
-import { StateStorageService } from 'app/shared/auth/state-storage.service';
+import { StateStorageService } from 'app/core/auth/state-storage.service';
 import Spy = jasmine.Spy;
 
 export class MockStateStorageService extends SpyObject {
diff --git a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-tracker.service.ts b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-tracker.service.ts
index bed4ffbe74..0e8e0630da 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-tracker.service.ts
+++ b/generators/client/templates/angular/src/test/javascript/spec/helpers/_mock-tracker.service.ts
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 import { SpyObject } from './spyobject';
-import { <%=jhiPrefixCapitalized%>TrackerService } from 'app/shared/tracker/tracker.service';
+import { <%=jhiPrefixCapitalized%>TrackerService } from 'app/core/tracker/tracker.service';
 
 export class MockTrackerService extends SpyObject {
 
diff --git a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/_entity-management-dialog.component.spec.ts b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/_entity-management-dialog.component.spec.ts
index 592d61dfc3..9c7f260c91 100644
--- a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/_entity-management-dialog.component.spec.ts
+++ b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/_entity-management-dialog.component.spec.ts
@@ -45,7 +45,7 @@ Object.keys(differentRelationships).forEach(key => {
         const uniqueRel = differentRelationships[key][0];
         if (uniqueRel.otherEntityAngularName !== entityAngularName) {
             const modulePath = uniqueRel.otherEntityAngularName === 'User' ?
-                `app/shared`
+                `app/core`
                 : `app/entities/${uniqueRel.otherEntityClientRootFolder ? `${uniqueRel.otherEntityClientRootFolder}/` : ''}${uniqueRel.otherEntityFileName}`
 _%>
 import { <%= uniqueRel.otherEntityAngularName%>Service } from '<%= modulePath %>';
diff --git a/generators/server/templates/src/test/java/package/web/rest/_AccountResourceIntTest.java b/generators/server/templates/src/test/java/package/web/rest/_AccountResourceIntTest.java
index b8bc29ea74..d4fc0d6727 100644
--- a/generators/server/templates/src/test/java/package/web/rest/_AccountResourceIntTest.java
+++ b/generators/server/templates/src/test/java/package/web/rest/_AccountResourceIntTest.java
@@ -641,7 +641,7 @@ public class AccountResourceIntTest <% if (databaseType === 'cassandra') { %>ext
         validUser.setImageUrl("http://placehold.it/50x50");
         <%_ } _%>
         validUser.setLangKey(Constants.DEFAULT_LANGUAGE);
-        validUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER));
+        validUser.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN));
 
         restMvc.perform(
             post("/api/register")
diff --git a/test/app.spec.js b/test/app.spec.js
index 54b3714839..21a007dbb5 100644
--- a/test/app.spec.js
+++ b/test/app.spec.js
@@ -935,7 +935,7 @@ describe('JHipster generator', () => {
                 }));
             });
             it('contains updatePageDirection in language helper', () => {
-                assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/shared/language/language.helper.ts`, /private updatePageDirection/);
+                assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/core/language/language.helper.ts`, /private updatePageDirection/);
             });
         });
     });
diff --git a/test/utils/expected-files.js b/test/utils/expected-files.js
index 6a30ea4602..92ddba4d32 100644
--- a/test/utils/expected-files.js
+++ b/test/utils/expected-files.js
@@ -188,13 +188,13 @@ const expectedFiles = {
         `${CLIENT_MAIN_SRC_DIR}app/admin/user-management/user-management.component.html`,
         `${CLIENT_MAIN_SRC_DIR}app/admin/user-management/user-management.route.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/admin/user-management/user-modal.service.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/user/user.model.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/user/user.service.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/user/user.model.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/user/user.service.ts`,
         `${CLIENT_TEST_SRC_DIR}spec/app/admin/user-management/user-management-delete-dialog.component.spec.ts`,
         `${CLIENT_TEST_SRC_DIR}spec/app/admin/user-management/user-management-detail.component.spec.ts`,
         `${CLIENT_TEST_SRC_DIR}spec/app/admin/user-management/user-management-dialog.component.spec.ts`,
         `${CLIENT_TEST_SRC_DIR}spec/app/admin/user-management/user-management.component.spec.ts`,
-        `${CLIENT_TEST_SRC_DIR}spec/app/shared/user/user.service.spec.ts`,
+        `${CLIENT_TEST_SRC_DIR}spec/app/core/user/user.service.spec.ts`,
     ],
 
     client: [
@@ -302,27 +302,29 @@ const expectedFiles = {
         `${CLIENT_MAIN_SRC_DIR}app/polyfills.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/alert/alert-error.component.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/alert/alert.component.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/auth/account.service.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/auth/csrf.service.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/auth/account.service.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/auth/csrf.service.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/auth/has-any-authority.directive.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/auth/principal.service.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/auth/state-storage.service.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/auth/user-route-access-service.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/auth/principal.service.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/auth/state-storage.service.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/auth/user-route-access-service.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/constants/error.constants.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/constants/pagination.constants.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/index.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/language/find-language-from-key.pipe.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/language/language.constants.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/language/language.helper.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/login/login-modal.service.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/language/language.constants.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/language/language.helper.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/login/login-modal.service.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/login/login.component.html`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/login/login.component.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/login/login.service.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/login/login.service.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/util/request-util.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/shared-common.module.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/shared-libs.module.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/shared.module.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/user/account.model.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/user/account.model.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/core.module.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/index.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/vendor.ts`,
         `${CLIENT_MAIN_SRC_DIR}content/css/documentation.css`,
         `${CLIENT_MAIN_SRC_DIR}content/css/global.css`,
@@ -375,8 +377,8 @@ const expectedFiles = {
         `${SERVER_MAIN_RES_DIR}i18n/messages_fr.properties`,
         `${CLIENT_MAIN_SRC_DIR}i18n/en/global.json`,
         `${CLIENT_MAIN_SRC_DIR}i18n/fr/global.json`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/language/language.constants.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/language/language.helper.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/language/language.constants.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/language/language.helper.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/language/find-language-from-key.pipe.ts`
     ],
 
@@ -385,9 +387,9 @@ const expectedFiles = {
         `${SERVER_MAIN_RES_DIR}i18n/messages_ar_ly.properties`,
         `${CLIENT_MAIN_SRC_DIR}i18n/en/global.json`,
         `${CLIENT_MAIN_SRC_DIR}i18n/ar-ly/global.json`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/language/language.constants.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/language/language.constants.ts`,
         `${CLIENT_MAIN_SRC_DIR}content/css/rtl.css`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/language/language.helper.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/language/language.helper.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/shared/language/find-language-from-key.pipe.ts`
     ],
 
@@ -412,7 +414,7 @@ const expectedFiles = {
         `${CLIENT_MAIN_SRC_DIR}app/account/sessions/sessions.component.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/account/sessions/sessions.route.ts`,
         `${CLIENT_MAIN_SRC_DIR}app/account/sessions/sessions.service.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/auth/auth-session.service.ts`,
+        `${CLIENT_MAIN_SRC_DIR}app/core/auth/auth-session.service.ts`,
         `${CLIENT_TEST_SRC_DIR}spec/app/account/sessions/sessions.component.spec.ts`
     ],
 
@@ -424,7 +426,7 @@ const expectedFiles = {
 
     jwtClient: [
         `${CLIENT_MAIN_SRC_DIR}app/blocks/interceptor/auth.interceptor.ts`,
-        `${CLIENT_MAIN_SRC_DIR}app/shared/auth/auth-jwt.service.ts`
+        `${CLIENT_MAIN_SRC_DIR}app/core/auth/auth-jwt.service.ts`
     ],
 
     oauth2: [