Warning
JavaBooks is in active development.This > APIs may change without notice. Use at > your own risk.
JavaBooks is a Java library for managing books in console apps, web applications, and games like Minecraft.
It provides add/list/search methods and can be integrated into Java projects, including Spring Boot web apps and game mods.
JavaBooks/β¨ββ¨ββ src/com/javabooks/β¨β ββ model/Book.javaβ¨β ββ service/Library.javaβ¨β ββ Main.javaβ¨ββ¨ββ misc/β¨β ββ screenshot_console.pngβ¨β ββ screenshot_web.pngβ¨ββ¨ββ examples/β¨β ββ ExampleConsole.javaβ¨β ββ ExampleWeb.javaβ¨ββ¨ββ .github/workflows/build.ymlβ¨ββ Dockerfileβ¨ββ docker-compose.ymlβ¨ββ LICENSEβ¨ββ CONTRIBUTING.mdβ¨ββ CODE_OF_CONDUCT.mdβ¨ββ README.md
- Add books to library
- List all books
- Search books by author or title
- Ready for integration in web apps and games
- Console demo included for testing
- GitHub Pages Demo: JavaBooks Web Demo
- Spring Boot Web Demo: JavaBooks API
Caution
Live demos may not contain all features.
Clone the repository:
git clone https://github.com/Kercx/JavaBooksInclude the library in your project. Maven:
com.javabooks javabooks 1.0.0Gradle:
implementation 'com.javabooks:javabooks:1.0.0'π Usage Examples Console Example
import com.javabooks.model.Book;
import com.javabooks.service.Library;
public class ExampleConsole {
public static void main(String[] args) {
Library library = new Library();
library.addBook(new Book("Java Programming", "John Doe", 2022));
library.addBook(new Book("Minecraft Modding", "Jane Smith", 2023));
library.listBooks();
library.searchByAuthor("Jane Smith");
}
}Web Example (Spring Boot)
@RestController
@RequestMapping("/books")
public class ExampleWeb {
private Library library = new Library();
@GetMapping
public List to<Book> getAllBooks() {
return library.getBooks();
}
@PostMapping
public String addBook(@RequestBody Book book) {
library.addBook(book);
return "Book added successfully!";
}
}Warning
Web example requires Spring Boot dependencies and setup.
Method Endpoint Description GET /books Get all books POST /books Add book GET /books/search Search
docker build -t javabooks .
docker run -p 8080:8080 javabooksThanks to all organizations and individuals supporting JavaBooks.
Thanks to everyone using JavaBooks and contributing to the project.
Below are amazing GitHub users and contributors!