Skip to content

jhonnymertz/spring-angular-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring & AngularJS integration

A project template as an example of integration amoung Spring framework MVC, Rest, Security and Data modules and AngularJS. Inspired in philipsorst/angular-rest-springsecurity project.

Aspects presented in project:

  • A relational or NoSQL database to manage users with Spring data MongoDB or JPA;
  • A REST service to expose users data;
  • Authentication and authorization against the REST service.
  • A set of AngularJS application pages to view or edit users depending on their role.

Features

Spring Framework

  • Application setup with servlet 3.0 specification and without XML configs;
  • Logback set to debug operations;

Spring MVC resources

  • Users data exposes through REST;
  • Exposing HTML, CSS, Javascript and other non-secured resources, however each one can be blocked through a Spring Security rule;
  • Errors and exceptions controlled via advices;

Spring Security resources

  • Rules in order to filter requests to rest application and html pages;
  • Custom authentication entry-point and request filter based on token;
  • Token utils;

AngularJS Security resources

  • Angular Routes;

  • $rootScope and cookies are used to hold and save credentials;

  • routeChange listener checking credentials;

  • HTTP interceptor to catch errors form back-end;

  • User operation methods in $rootScope:

      ng-show = "hasRole('ROLE_ADMINISTRATOR')" #enable or disable content based on roles
      
      ng-click = "logout()" #erase any authetication record
    

Project uses:

Spring projects:

Other projects:

JS libs:

Notes

  • It's only an example/demonstration and does not aim to be used for production projects. Use it to learn about the technologies used.
  • Despite there are many different technogies involved, this project focus on Spring Security and Angular integration;

About

Spring MVC, Rest, Security, Data and AngularJS integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published