Skip to content

kmucavele/bookshelf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Small Digital Bookshelf Project

Description

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

Functionalities

  • 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

Usage

Prerequisites

  • Install MySQL
  • Install the maven dependency manager

Install

  1. Clone this repository
  2. Run mvn install to install the dependencies from the pom file
  3. Create a database (e.g.: named books)
  4. 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
  1. 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
  1. 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();
    }

Build With

  • Java (POJO)
  • MySQL
  • HikariCP (for connection pools)
  • JUnit 5
  • Maven

About

A simple bookshelf app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages