Skip to content

An application that use Spring Boot as backend to provide REST APIs, consumed by Angular as frontend, protect endpoints with JWT, integrate Swagger for API documentation, Postgres as persistence layer and Flyway for database migration.

Notifications You must be signed in to change notification settings

nqminhuit/mini-auth

Repository files navigation

Project Setup

Build:

$ cd mini-auth/
$ ./gradlew clean
$ ./gradlew npmRunBuild
$ ./gradlew assemble

Create database:

Make sure a Postgres database is created under the name "mini_auth" by user "postgres" (*)

$ sudo su - postgres
$ create database mini_auth

(*) user "postgres" is created as default user for using Postgres DB

Deploy:

$ java -jar mini-auth-boot/build/libs/mini-auth-boot-<app_version>.jar

Application business:

  • Access application at: http://localhost:8080
  • You will be redirected to login page: http://localhost:8080/login
  • Provide credentials (see the table below)
  • Upon successful login, you will be redirected to http://localhost:8080/customer
  • Only user with ADMIN role can perform "List all customers" function
  • Only user with ADMIN role can perform add, edit and remove customer
  • The JWT token will be valid for 3 minutes, after that, user have to login again.

Initial list of credentials:

ID Username Role password
0 batman admin m1n14uth
1 joker user m1n14uth
2 catwoman user m1n14uth

Swagger:

Docker:

Build image:

$ cd mini-auth/
$ sudo docker-compose up --build

Authomation tests:

for optimal run:

$ ./gradlew test systemTest --parallel

About

An application that use Spring Boot as backend to provide REST APIs, consumed by Angular as frontend, protect endpoints with JWT, integrate Swagger for API documentation, Postgres as persistence layer and Flyway for database migration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages