This is a simple digital book database app.
The idea behind the bookshelf app was to have two main bookshelves. One where you store already owned books and another with books that you want to read in the future but not own yet (wishlist).
The project was made in the first year of my apprenticeship and serves to showcase work samples.
A second project, build with the Spring Boot Framework is based on this project, which exposes the bookshelf functionalities to an REST API
-
Users can:
- Add a new book to the owned-books or wishlist bookshelf
- Move a book from the wishlist- to the owned-books bookshelf
- Return a list of all books
- Check if a book is in a bookshelf (owned-books or wishlist)
- Search both bookshelves by author or/and title
- Update the reading status of a book
- Delete a book
-
The goal was to get familiar with:
- JDBC
- Connecting to a databases in Java
- Database connection pools
- Writing tests with JUnit
- Install MySQL
- Install the maven dependency manager
- Clone this repository
- Run
mvn install
to install the dependencies from the pom file - Create a database (e.g.: named
books
) - Read in the mysqldump with the following command:
mysqldump -u <your username> -p <your database name> < books_localhost-dump.sql
- The mysqldump contains the table schemas
- Create an
.env
file and fill it with your database credentials using these environment keys:
DATABASE_NAME=""
DATABASE_USER=""
DATABASE_PASSWORD=""
- In case your username or password values have special characters, put them in quotes
- Optionally test if the database connection works by running this inside of the test file:
@Test
void database_connection_test_should_be_true() throws SQLException {
assertThat(bookshelfDBService.showConnectionStatus()).isTrue();
}
- Java (POJO)
- MySQL
- HikariCP (for connection pools)
- JUnit 5
- Maven