A simple, powerful library management system that makes managing books, users, and loans a breeze!
RevSin is a modern library management system that helps librarians and library staff efficiently manage:
- π Books: Add, search, and organize your book collection
- π₯ Users: Manage library members and staff accounts
- π Loans: Track who borrowed what and when it's due
- π° Fines: Handle overdue books and fine payments
Perfect for: School libraries, public libraries, community centers, or any organization that lends books to people.
- π¨ Beautiful Interface: Colorful, easy-to-use command-line tools
- π Fast & Reliable: Built with modern technology for speed
- π Secure: Proper user authentication and permissions
- π± API Ready: Integrate with websites or mobile apps
- π‘ Beginner Friendly: Clear documentation and helpful error messages
python --version
# Should show Python 3.12 or higherDon't have Python? β Download it here
# Download RevSin
git clone <repository-url>
cd revsin
# Install everything you need (this might take a minute)
pip install uv # Fast package manager
uv sync # Install RevSin and dependencies# Copy the example settings
cp env.example .env
# Edit .env with your database info (see "Easy Setup" below)# Set up the database
rslms system init-db
# Create your first librarian account
rslms users create
# Start the system
python run.pyπ You're done! Visit http://localhost:8000/docs to see your library system!
No database installation needed! Use free cloud services:
- Database: Sign up at NeonDB (free tier available)
- Cache: Sign up at Upstash Redis (free tier available)
- Copy the connection strings to your
.envfile
Example .env for cloud setup:
DATABASE_URL=postgresql://your-neon-db-connection-string
REDIS_URL=redis://your-upstash-redis-string
SECRET_KEY=make-this-a-random-string-123
ENVIRONMENT=developmentIf you prefer running everything locally:
- Install PostgreSQL and Redis on your computer
- Create a database named "revsin"
- Update your
.envfile with local connections
RevSin comes with beautiful, colorful command-line tools:
# Check if everything is working
rslms system health
# Add a book to your library
rslms books add
# See all your users
rslms users list
# Check loan statistics
rslms loans statsBuild websites or mobile apps using our API:
- Browse books:
GET /api/v1/books/ - Create loans:
POST /api/v1/loans/ - Manage users:
GET /api/v1/users/
π Full API Documentation: http://localhost:8000/docs
| Feature | What it does | Who can use it |
|---|---|---|
| User Management | Add librarians, members, admins | Admins |
| Book Catalog | Search, add, update books | Librarians, Admins |
| Loan Tracking | Check out/in books, renewals | Everyone |
| Fine Management | Calculate and track overdue fines | Librarians, Admins |
| Reports & Stats | See popular books, overdue items | Librarians, Admins |
- Can do: Everything! Manage users, books, system settings
- Perfect for: Library directors, IT administrators
- Can do: Manage books and loans, help patrons
- Perfect for: Front desk staff, circulation desk workers
- Can do: Search books, view their loans, pay fines
- Perfect for: Library patrons, students, community members
"I get an error when starting!"
# Check system health - this will tell you what's wrong
python cli.py system health
# Or run the doctor for detailed diagnostics
python cli.py system doctor"How do I add my first books?"
# Interactive book addition (asks you questions)
python cli.py books add
# Or add multiple books from a file
python cli.py books import my-books.csv"Can I reset everything and start over?"
# β οΈ WARNING: This deletes all data!
python cli.py system reset-db- π Documentation: Full documentation here
- π Found a bug?: Open an issue
- π¬ Questions?: Start a discussion
π₯ Production Deployment
For libraries serving many users:
# Production server with multiple workers
python run_production.py
# Or manually with Gunicorn
uv run gunicorn src.revsin.main:app -w 4 -k uvicorn.workers.UvicornWorkerProduction Checklist:
- β Use strong passwords and secret keys
- β Enable HTTPS
- β Set up database backups
- β Configure monitoring
βοΈ Configuration Options
All settings are controlled through your .env file:
| Setting | What it does | Example |
|---|---|---|
DATABASE_URL |
Where your books/users are stored | postgresql://user:pass@host:port/db |
REDIS_URL |
Cache for faster performance | redis://host:port |
SECRET_KEY |
Security key (keep this secret!) | your-random-secret-123 |
ENVIRONMENT |
development or production | development |
DEBUG |
Show detailed error messages | true |
π Development & Contributing
Want to improve RevSin or add features?
# Set up development environment
uv sync -G dev -G docs -G test
# Run tests
uv run pytest
# Format code
uv run black src/
uv run isort src/
# Check for issues
uv run flake8 src/
uv run mypy src/Contributing:
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
π API Reference
POST /api/v1/auth/registerβ Create new accountPOST /api/v1/auth/loginβ Login and get access tokenGET /api/v1/auth/meβ Get current user info
GET /api/v1/books/β List all booksPOST /api/v1/books/β Add new book (librarian+)GET /api/v1/books/{id}β Get book detailsGET /api/v1/books/search?q=pythonβ Search books
GET /api/v1/users/β List users (admin only)GET /api/v1/users/{id}β Get user detailsPUT /api/v1/users/{id}β Update user info
GET /api/v1/loans/β List loans (librarian+)POST /api/v1/loans/β Create new loanPUT /api/v1/loans/{id}/returnβ Return bookGET /api/v1/loans/overdueβ Get overdue loans
Interactive API Docs: http://localhost:8000/docs
π± CLI Commands Reference
rslms system health # Check if everything is working
rslms system init-db # Set up database tables
rslms system clear-cache # Clear cached data
rslms system info # Show system informationrslms users create # Add new user (interactive)
rslms users list # Show all users
rslms users search "john" # Find users
rslms users stats # User statisticsrslms books add # Add book (interactive)
rslms books list # Show all books
rslms books search "python" # Search books
rslms books available # Show available booksrslms loans create # Create new loan
rslms loans list # Show all loans
rslms loans overdue # Show overdue loans
rslms loans stats # Loan statisticsπ‘ Tip: Add --help to any command for more options!
Tech Stack (for the curious)
Backend Technologies:
- Python 3.12+: Modern Python for reliability
- FastAPI: Fast web framework for APIs
- PostgreSQL: Robust database for your data
- Redis: Fast caching for better performance
- SQLAlchemy: Database toolkit
- JWT: Secure user authentication
Development Tools:
- pytest: Automated testing
- Black/isort: Code formatting
- Sphinx: Documentation generation
- Docker: Containerization support
MIT License - feel free to use RevSin in your library!
Built with β€οΈ for librarians and book lovers everywhere.
Special thanks to:
- The FastAPI community
- Open source contributors
- Librarians who provided feedback