Skip to content

Latest commit

 

History

History
120 lines (77 loc) · 4.45 KB

README.md

File metadata and controls

120 lines (77 loc) · 4.45 KB

Library App 📚

This is a web application for managing a library, including inventory management (listing available books and the number of copies of each book), handling loans, and managing library staff and members.

Tech Stack 🛠

- Java
- JakartaEE
- JPA
- MySQL
- Bootstrap

Note

Glassfish server is required to run this project

Database schema

Database schema is dynamically generated based on the Java Persistence API (JPA) annotations in entities. Any change whithin the database schema can be managed by editing persistence.xml file (/resources/META-INF/persistence.xml).

<persistence-unit name="db_name">

    <class>com.biblioteca.model.entidades.Libro</class>
    <class>com.biblioteca.model.entidades.Autor</class>
    <class>com.biblioteca.model.entidades.Genero</class>
    <class>com.biblioteca.model.entidades.Usuario</class>
    <class>com.biblioteca.model.entidades.Prestamo</class>
    <properties>
        <property name="jakarta.persistence.jdbc.driver" value="org.mariadb.jdbc.Driver"/>
        <property name="jakarta.persistence.jdbc.url" value="jdbc:mariadb://localhost:3306/db_name"/>
        <property name="jakarta.persistence.jdbc.user" value="user"/>
        <property name="jakarta.persistence.jdbc.password" value="password"/>
        <property name="jakarta.persistence.schema-generation.database.action" value="create"/>
        <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.MySQLPlatform"/>
    </properties>
</persistence-unit>

db-schema

Roles

Admin

Admin users can perform CRUD operations on all entities (books, authors, genres, and users).

admin

Employee management

employee-management

Employee edit page

Only an admin can make an employee an admin too, and vice versa.

edit-employee

Books management

books-management

Book edit page

Admins can change authors and genres, as well as upload another book cover.

edit-book

Author management

A modal window is displayed to see the books that belong to each author

authors-management

Genre management

A modal window is displayed to see the books categorized with that genre

genres-management

Loans management

Admin users have all information about loans at a glance. They can also see the members who have overdue return dates and send them an email to warn. They can also search by both books and members.

loans-management

Employee

Employees are responsible for making loans. They can select members and assign them a book (if they are not banned) Members get banned if they return the book late, and they will not be displayed in the list.

loan

When a loan is made a nice card with all the information appears loan-card

Member

Members can check in their profiles the books they have borrowed and whether they returned them on time or not (got banned)

user-books

REST API

This app also provides a REST API with two endpoints:

Method URL Action
GET /api/libros retrieve all books
GET /api/libros/id retrieve a book by id