r/learnjava • • Jul 25 '20

Java Spring App Boilerplate - JWT Auth, PostgreSQL, deploy to AWS

Hi community!

Inspired by this YouTube tutorial by AmigosCode and as a follow-up to my previous Java Spring Security boilerplate project here, I have put together another Java Spring reference boilerplate, which has the following features:

  • JWT User authentications

  • Persistent data with PostgreSQL database

  • Deploy to Production onto AWS Elastic Beanstalk and AWS RDS database

The app has plenty of to-do's such as:

  • Adding other HTTP methods such as DELETE, PATCH

  • Connect UserService with the PostgreSQL database

  • Build a front-end React client (currently a react app is in the src/client directory)

Please feel free to take a look, thank you!

Github project link: https://github.com/MatthewCYLau/java-spring-skills-tracker

31 Upvotes

2 comments sorted by

1

u/Italsr Jul 26 '20

learning more about spring security and jwt this helps a lot! I just have one question, at what point do you assign roles and permissions to a user? If I understand correctly, every new user would have all these fields?

private final String username;
private final String password;
private final Set<? extends GrantedAuthority> grantedAuthorities;
private final boolean isAccountNonExpired;
private final boolean isAccountNonLocked;
private final boolean isCredentialsNonExpired;
private final boolean isEnabled;

4

u/Cross2409 Jul 26 '20

Check javabrains on YouTube, he has a playlist dedicated to Spring Security, you will love it:)