This is a library that allows to perform CRUD operations with books and their authors. It was created as part of an interview test task at Godel Technologies. Main goals of this task are described in Mogilev Mastery 2021 Task.pdf located in the project root.
- Ability to create books that contain following information: book name, year of publication, authors, publisher.
- A book can have one or more authors. The book must have at least one author on creation/editing.
- Ability to edit the authors of the book.
- Ability to create authors that contain following information: first name, last name, date of birth, sex.
- If author was born later than the book was published, then he is not shown in the list of authors to be added as book author.
- The author can have any number of books under his own authorship, including 0.
- When an author is deleted, all books written by him are also deleted.
- Ability to get/add/edit/delete the Book and the Author including adding and removing the author of the book.
- Validation upon add/edit operation.
- The application provides the ability to search criteria for books (including their combinations):
- by name (including the first letters);
- by year of publication (in range);
- by the name of the publisher (including the first letters);
- by the first name / last name of the author (including the first letters);
- by sex;
- by year of birth (in range).
- Application contains an SQL script to initialize predefined data on application startup.
- Java
- Maven
- Spring Web MVC
- Spring JDBC
- Thymeleaf
- PostgreSQL
- Git
- SonarCloud via GitHub Actions
- Date of birth stored as string. Must be stored and processed as SQL Data.
- Fix known issues.
- Add tests.
- Add multiple selection of authors on book creation and adding/removing authors to book.
- Wrap service methods bodies with try/catch and send exceptions information to the logger.
- Add admin/user functionality.
- Visually improve web forms.
- IntellijIDEA CE or EE
- JDK 11
- Apache Maven 3.6.3 or higher
- Apache Tomcat 9.0.41 or higher
- PostgreSQL 13.1 or higher
-
Download project from github or clone using commands
git clone https://github.com/Pavel-Kuropatin/GodelTestTask.git cd GodelTestTask
-
Create a database with a name
library
, create user with a nameusername
and passwordpassword
. You can also use different database name and user. To do so, you must specify desired parameters inSpringConfig.java
in this method:public DataSource dataSource() { DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setDriverClassName("org.postgresql.Driver"); dataSource.setUrl("jdbc:postgresql://localhost:5432/library); dataSource.setUsername("username"); dataSource.setPassword("password"); return dataSource; }
-
If you're using IntellijIDEA Community Edition you should go to File -> Settings -> Plugins and install
Smart Tomcat
plugin -
Press
Alt+Shift+F10
then0
to open Run/Debug Configuration then pressAlt+Insert
selectSmart Tomcat
and configure Run/Debug Configuration as follows. Make sure thatContext Path
field is empty. Deployment directory root may be different.
InBefore Launch
tab press+
and addRun Maven Goal
task with empty command line. That allows maven to use default goal specified inpom.xml
-
IntellijIDEA Enterprise Edition has inbuilt Tomcat Server, so you need to select Tomcat Server -> Local as Run/Debug Configuration and configure it same as above. In addition, you should press the
Fix
button and selectLibrary-SpringMVC:war exploded
.Application Context
field must be empty -
If you did everything right, you can see start page at http://localhost:8080/