A simple, self-hosted web application for managing your personal book collection with lending tracking.
- 📚 Add and manage books in your personal library
- 🔍 Search books by title, author, or ISBN
- 📖 Automatic metadata lookup via ISBN (OpenLibrary)
- 📍 Track book locations (which shelf, room, etc.)
- 🔄 Lending management (who borrowed what, when)
- 📱 Responsive web interface
- 🐳 Docker ready for easy deployment
- 🔌 REST API for future integrations
-
Clone or download the project files
-
Create the directory structure:
book-inventory/ ├── main.py ├── requirements.txt ├── Dockerfile ├── docker-compose.yml ├── templates/ └── static/ -
Run with Docker Compose:
docker-compose up -d
-
Access the application at http://localhost:8000
- Install Python 3.11+
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python main.py
TZ: Timezone (default: UTC)
The SQLite database is stored in the data/ directory. Make sure to backup this directory regularly.
- Click "Add Book" in the navigation
- Enter book details (Title and Author are required)
- Optionally enter ISBN for automatic metadata lookup
- Specify location and condition
- Add any notes
- Edit a book
- Fill in "Loaned To" field with person's name
- Set loan date and optional due date
- View all loaned books in the "Loaned Books" section
For integration with other tools (like computer vision systems):
POST /api/books- Add a new bookGET /api/books- Get all books (with optional search)
Example API usage:
curl -X POST "http://localhost:8000/api/books" \
-H "Content-Type: application/json" \
-d '{"title": "The Hobbit", "author": "J.R.R. Tolkien", "isbn": "9780547928227"}'If you're using Caddy, Traefik, or nginx:
- Deploy the container on your desired port
- Add a reverse proxy configuration
- Example Caddy config:
books.yourdomain.com { reverse_proxy localhost:8000 }
- The application doesn't include authentication by default
- Consider putting it behind a reverse proxy with authentication
- Regular backups of the
data/directory are recommended
book-inventory/
├── main.py # FastAPI application
├── requirements.txt # Python dependencies
├── Dockerfile # Container definition
├── docker-compose.yml # Multi-container setup
├── templates/ # HTML templates
│ ├── base.html
│ ├── index.html
│ ├── add_book.html
│ ├── book_detail.html
│ ├── edit_book.html
│ └── loaned.html
└── static/ # CSS and JavaScript
├── style.css
└── script.js
The SQLite database includes these fields:
id- Primary keytitle- Book title (required)author- Author name (required)isbn- ISBN-10 or ISBN-13publisher- Publisher nameyear- Publication yeargenre- Book genre/categorylocation- Physical location (shelf, room, etc.)condition- Book conditionloaned_to- Person who borrowed the bookloaned_date- Date book was loaneddue_date- Expected return datenotes- Additional notescover_url- URL to book cover imageadded_date- When book was added to system
This project is open source and available under the MIT License.
Feel free to submit issues, feature requests, or pull requests to improve the system.