Giter Club home page Giter Club logo

aburraq / librarymanagementsystem-springframework Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 76 KB

Yesterday, realizing my GitHub lacked a Spring project, I swiftly crafted one. In just a day, this Spring MVC application took shape, showcasing my coding efficiency and commitment. Explore and enjoy the fruits of a day's dedicated work!

Java 100.00%
java pagination sorting crud-operations library-management-system-java lombok-maven postgressql restfull-api spring-data-jpa springboot springmvc webdevelopement spring-container

librarymanagementsystem-springframework's Introduction

Library Management System

About the Project

This project implements a Library Management System using Spring MVC. It includes controllers for managing teachers and books, providing various endpoints for CRUD operations and additional functionalities. All of the endpoints are tested with Postman and project is ready to use after DB configuration.

Key Features

RESTful API Endpoints: Utilizing the @RestController annotation, our project exposes clean and RESTful endpoints for various operations, facilitating easy integration with other systems.

CRUD Operations: The project supports Create, Read, Update, and Delete (CRUD) operations for both teachers and books, ensuring comprehensive management of library resources.

Validation Support: We've incorporated the spring-boot-starter-validation dependency to enable robust validation of incoming requests, ensuring data integrity and security.

Pagination and Sorting: With the integration of Spring Data JPA, the application provides endpoints for paginated and sorted retrieval of data, enhancing user experience and system performance.

Database Interaction: The project interacts with a PostgreSQL database, offering a reliable and scalable storage solution for library-related data.

Dependency Management: Maven is used for project management and dependency resolution, simplifying the build and deployment processes.

Teacher Controller

The TeacherController manages teacher-related operations:

  • Save Teacher: POST /teachers
  • Get All Teachers: GET /teachers
  • Find Teacher by ID (PathVariable): GET /teachers/{id}
  • Find Teacher by ID (RequestParam): GET /teachers/query?id={id}
  • Delete Teacher by ID: DELETE /teachers/{id}
  • Update Teacher by ID: PUT /teachers/{teacherId}
  • Get Teacher by DTO (RequestParam): GET /teachers/query/dto?id={id}
  • Get Teachers with Pagination: GET /teachers/page?page={page}&size={size}&sort={sort}&direction={direction}
  • Add Teacher for a Book: POST /teachers/{bookId}/teachers

Book Controller

The BookController manages book-related operations:

  • Save Book: POST /books
  • Get All Books: GET /books
  • Get Book by ID: GET /books/{id}
  • Get Book by ID (RequestParam): GET /books/query?id={id}
  • Get Books by Title: GET /books/title?title={title}
  • Delete Book by ID: DELETE /books/{id}
  • Update Book by ID: PUT /books/{bookId}
  • Get Book with DTO (RequestParam): GET /books/query/dto?id={id}
  • Add Book for a Teacher: POST /books/{teacherId}/books
  • Get Books with Pagination: GET /books/page?p={page}&size={size}&sort={sort}&direction={direction}

Usage

  1. Clone the repository.
  2. Configure your database settings in the application.properties file.
  3. Run the application using your preferred method (e.g., IDE or mvn spring-boot:run).
  4. Access the provided endpoints for managing teachers and books.
  5. Feel free to extend this project based on your specific requirements. The modular structure of Spring MVC allows easy customization and addition of features.

Feel free to extend and customize this system based on your specific requirements.

Dependencies

This project is built using Maven and utilizes the following dependencies:

<dependencies>
    <!-- Spring Boot Actuator for production-ready features -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <!-- Spring Boot Starter for Data JPA -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <!-- Spring Boot Starter for Validation -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>

    <!-- Spring Boot Starter for Web -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <!-- Spring Boot DevTools for enhanced development experience -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>

    <!-- PostgreSQL JDBC Driver -->
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>

    <!-- Lombok for reducing boilerplate code -->
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>

    <!-- Spring Boot Starter Test for testing support -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

librarymanagementsystem-springframework's People

Contributors

aburraq avatar

Watchers

 avatar

Forkers

gibekkk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.