Releases: aryokkynen/bookstore
Releases · aryokkynen/bookstore
React front, REST, Spring Boot security
Week 6&7
Task 1.
Add react.js to your Spring Boot project
Task 2.
Print your bookstore database content in table form
Task 3.
Add delete button which removes book from database
Task 4.
Add form to create new book & refresh view once book is added
Task 5.
Add authentication using Spring Security module
Third release, Security and REST
Bookstore: Securing the web application
Part 1
- Add Spring Security to your project by adding dependency
- Add Spring Security configuration class which will secure all URLs (requires authentication in all URLs) and add two in-memory users with roles USER and ADMIN
- Create the login page and add login method to controller
- Add logout functionality to your booklist page
- Show authenticated username in your booklist page
- Restrict Delete book functionality only to users with ADMIN role
Part 2 - Securing the web application Part II
- Create user entity for your application endusers
- Attributes: username (unique), password, email, role
- Create crud repository for user entity
- Implement UserDetailService
- Add some users to your database and hash the passwords with BCrypt hashing algorithm
- Change Spring Security configuration to use user entites instead of in-memory users in authentication
Part 3 - REST
- Create REST service that return all books (JSON)
1 . Create a method to controller
2 . Ignore one-to-many link from JSON - Create REST service that return one book by id (JSON)
1 . Create a method to controller
2 . Use path variable to get book id - Change REST api path to /api
1 . Modify your application.properties
Second release
#Week 2 on bookstore assigment
Toinen viikko
- Bookstore: Add JPA and database
-Add JPA support and H2 database to your bookstore project (in GitHub) by modifying pom.xml file - Create an entity from your Book class
- Add command line runner to insert few example data to your database
- Modify properties to show sql statements
- Create a template called booklist.html which shows all books from the database in html table.
-To show the books you have to add new method to controller that handle GET request from endpoint like /booklist - Add Create and Delete functionalities to your Bookstore application
-For create functionality add new thymeleaft emplate called addstudent.htmlUsed form on booklist page
-For deletion use @PathVariable annotation - A Little bit Front-end (Extra)
-Add Bootstrap to your bookstore application. Download bootstrap.min.css from the bootstrapsite.
-Copy it to your projects resources\static\css folder.
-Add link to your booklist template file.
First release
First week
- Create project called Bookstore using Spring Initializer (Add web, test dependencies)
- Add new controller named BookController, mapped at /index
- Add new model-class Book, has following attributes: title, author, year, isbn, price
- Add your project to Github from commandline
- Use suggested Spring Boot project hierarchy