Skip to content

guycorbaz/rbibli

rbibli - Personal Library Management System

A modern, full-featured personal library management system built entirely in Rust using Slint for the user interface. Designed for small-scale use (friends and family) with a focus on simplicity, data integrity, and flexible deployment options.

✨ Features

Currently Implemented (Phase 3 - ~88% Complete)

  • πŸ“š Title Management - Full CRUD operations with ISBN lookup via Google Books API
  • πŸ“– Volume Management - Track multiple physical copies per title with unique barcodes
  • ✍️ Author Management - Complete biographical information and title associations
  • 🏒 Publisher Management - Company details and catalogs
  • 🎭 Genre Management - Categorize your collection
  • πŸ“š Series Management - Organize titles into series (e.g., Asterix, Harry Potter)
  • πŸ“ Location Management - Hierarchical storage organization (House > Room > Shelf)
  • πŸ‘₯ Borrower Management - Track who you lend books to
  • πŸ‘ͺ Borrower Groups - Organize borrowers with custom loan policies
  • πŸ“… Loan Management - Barcode-based lending with automatic due dates
  • πŸ“Š Statistics Dashboard - Visual analytics for your library:
    • Library overview (titles, volumes, authors, genres, active/overdue loans)
    • Volumes per genre with bar charts
    • Volumes per location
    • Loan status breakdown
  • πŸ” Dewey Decimal Classification - Manual code entry and categorization
  • 🌐 Multi-language Support - Internationalization infrastructure ready

Architecture Highlights

  • Title/Volume Separation - Titles represent abstract book metadata, volumes are physical copies
  • Barcode System - Code 128 format for volume tracking (VOL-XXXXXX)
  • Hierarchical Locations - Organize storage with parent-child relationships
  • Trust-Based Lending - Simple loan management without complex restrictions
  • Cross-Platform UI - Native desktop now, WASM for web deployment later

πŸ› οΈ Technology Stack

Frontend

  • Slint 1.14.1 - Declarative UI framework for native and web
  • Rust - Type-safe, memory-safe systems programming language
  • Reqwest - HTTP client for API communication
  • WASM Optimization - Configured for minimal binary size (~55MB -> optimized)

Backend

  • Actix-web 4.11.0 - High-performance web framework
  • Tokio 1.47.1 - Async runtime
  • SQLx - Compile-time verified SQL queries
  • MariaDB - Production-grade relational database

Development Approach

  • Native-first - Develop as desktop app for faster iteration
  • WASM-ready - Same codebase will compile to WebAssembly for browser deployment
  • Client-Server - REST API backend with native/web frontend options

πŸš€ Getting Started

Prerequisites

Docker

You can run rbibli using Docker. Official images are available on Docker Hub: https://hub.docker.com/r/gcorbaz/rbibli

Example docker-compose.yml:

services:
  rbibli:
    image: gcorbaz/rbibli:latest
    ports:
      - "8080:8080"
    environment:
      # Database Connection
      # Note: Use APP__ prefix (double underscore) for configuration
      - APP__DATABASE__URL=mysql://user:password@db:3306/rbibli
      # Optional: Individual fields can also be used
      # - APP__DATABASE__HOST=db
      # - APP__DATABASE__USERNAME=user
      # - APP__DATABASE__PASSWORD=password

Configuration: The application is configured entirely via environment variables.

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/rbibli.git
    cd rbibli
  2. Set up the database

    a. Configuration Create a .env file in the project root:

    DATABASE_URL=mysql://rbibli:your_password@127.0.0.1:3306/rbibli
    HOST=127.0.0.1
    PORT=8000
  3. Run database migrations

    cd backend
    sqlx database create
    sqlx migrate run
  4. Start the application

    Option A: Docker (Recommended)

    docker compose up --build

    The application will be available at http://localhost:8080.

    Option B: Manual (Development) Start the backend:

    cd backend
    cargo run --release

    Start the frontend (in a new terminal):

    cd frontend
    trunk serve --release

    The frontend will be available at http://localhost:8080. Note: trunk serve is configured to proxy API requests to the backend at http://127.0.0.1:8000.

πŸ“– Usage

Main Features

  1. Manage Your Collection

    • Add titles with ISBN lookup for automatic metadata
    • Create multiple volumes (physical copies) per title
    • Organize volumes in hierarchical storage locations
  2. Track Loans

    • Scan barcodes to check out books
    • Automatic due date calculation based on borrower groups
    • Visual indicators for overdue items
  3. View Statistics

    • See which genres dominate your collection
    • Track where volumes are located
    • Monitor active and overdue loans

Navigation

  • Titles - Browse and manage your book collection
  • Locations - Organize physical storage spaces
  • Authors - Manage author information
  • Publishers - Track publishing companies
  • Genres - Categorize your books
  • Series - Organize titles into series collections
  • Loans - Check out, return, and manage loans
  • Statistics - View library analytics
  • About - Application information

πŸ“ Project Structure

rbibli/
β”œβ”€β”€ frontend/           # Slint UI application
β”‚   β”œβ”€β”€ src/           # Rust source code
β”‚   β”‚   β”œβ”€β”€ main.rs    # Entry point
β”‚   β”‚   β”œβ”€β”€ models.rs  # Data structures
β”‚   β”‚   └── api_client.rs  # HTTP client
β”‚   └── ui/            # Slint UI files
β”‚       β”œβ”€β”€ app-window.slint
β”‚       β”œβ”€β”€ pages/     # Page components
β”‚       └── side_bar.slint
β”œβ”€β”€ backend/           # REST API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs    # Server entry point
β”‚   β”‚   β”œβ”€β”€ handlers/  # API endpoints
β”‚   β”‚   └── models/    # Database models
β”‚   └── migrations/    # SQLx database migrations
└── documentation/     # Detailed documentation
    β”œβ”€β”€ requirements.md
    β”œβ”€β”€ architecture.md
    β”œβ”€β”€ api.md
    └── ...

πŸ“š Documentation

Comprehensive documentation is available in the documentation/ folder:

🎯 Development Status

Current Phase: Late Phase 3 (88% Complete)

βœ… Completed

  • Database integration with 15 migrations
  • Full CRUD for titles, authors, publishers, genres, series, locations
  • Volume management with barcode support
  • Complete loan management system
  • Statistics dashboard with visualizations
  • ISBN lookup integration
  • Dewey Decimal Classification (Manual input)
  • Series management with title associations
  • Cover image upload API

πŸ”„ In Progress

  • Title-Author relationship management
  • WASM compilation support (Async UI refactoring complete)

⏳ Planned (Phase 4)

  • Barcode generation (Code 128)
  • Import/export functionality (CSV, JSON)
  • Duplicate detection algorithms
  • Cover image upload UI
  • Progressive Web App (PWA) features

πŸ”‘ Key Concepts

Title vs Volume

The system makes a crucial distinction:

  • Title - Abstract book metadata (ISBN, authors, genre, summary)
  • Volume - Physical copy with unique barcode, condition, location

This allows:

  • Wishlist functionality (titles with 0 volumes)
  • Multiple copies tracking
  • Individual volume notes and locations

Barcode System

  • Volume Barcodes - VOL-000001 (Code 128) for physical copies
  • ISBN Barcodes - Standard EAN-13 for title identification

Loan Management

  • Title-based requests, volume-specific fulfillment
  • Automatic due date calculation based on title type
  • Simple, trust-based system (no fines or suspensions)

🀝 Contributing

This is currently a personal project. Feel free to fork and adapt for your own use!

πŸ“„ License

Licensed under the MIT License - see LICENSE for details.

πŸ™ Acknowledgments

  • Slint - Cross-platform UI framework
  • Actix-web - Web framework
  • SQLx - SQL toolkit
  • Google Books API - ISBN metadata lookup

πŸ“¬ Contact

For questions or suggestions, please open an issue on GitHub.


Built with ❀️ using Rust and Slint

About

Personal book management tool written in rust

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages