DiegoKrupitza / spring-angular-template

A template for a spring boot angular application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Boot Angular Application Template

  • Backend with Jwt Authentication
  • Jwt refresh token implemented
  • Application properties
  • Add Angular frontend
  • Global notification service in angular
  • Link frontend with backend

Backend architecture

The backend uses a layered architecture to provide maximum modularity.

  • config: configuration for the application
  • domain: holds the entities of the application that will be created automaticly by hibernate
  • endpoints: contains all the rest endpoints that can be called from the client
  • exceptions: all the custom exceptions that can be thrown by the backend
  • persistence: Spring data jpa repositories
  • security: all the security configuration and jwt things ;)
  • service: holding the business logic

Applicationproperties

For the backend you can define properties in the application.yml file. The class ApplicationProperties has fields that access the properties with the prefix application from the application.yml file.

Applicationroles

Roles can be defined in the enum ApplicationRoles. At application startup the roles will be created if they dont exist already in the db.

Notificationservice Frontend

To get notification global on the frontend there is a notificationservice. Usage:

export class LoginComponent implements OnInit {

  constructor(private notificationService: NotificationService) {

    this.loginForm = this.formBuilder.group({
      username: ['', [Validators.required]],
      password: ['', [Validators.required, Validators.minLength(8)]]
    });

  }
}

Note:

About

A template for a spring boot angular application


Languages

Language:Java 58.3%Language:TypeScript 27.2%Language:HTML 10.2%Language:JavaScript 3.1%Language:CSS 1.2%