Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RevSin - A complete library management solution with interactive CLI, REST API, user management, and automated loan tracking. Built for libraries of all sizes.

Notifications You must be signed in to change notification settings

Sri-Krishna-V/rslms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š RevSin Library Management System

A simple, powerful library management system that makes managing books, users, and loans a breeze!

Python 3.12+ FastAPI License: MIT


πŸ€” What is RevSin?

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.

✨ Why Choose RevSin?

  • 🎨 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

πŸš€ Quick Start (5 Minutes!)

Step 1: Check if you have Python

python --version
# Should show Python 3.12 or higher

Don't have Python? β†’ Download it here

Step 2: Get RevSin

# 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

Step 3: Set up your library

# Copy the example settings
cp env.example .env

# Edit .env with your database info (see "Easy Setup" below)

Step 4: Start your library!

# 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!


πŸ›  Easy Setup Options

Option A: For Beginners (Cloud Setup - Recommended)

No database installation needed! Use free cloud services:

  1. Database: Sign up at NeonDB (free tier available)
  2. Cache: Sign up at Upstash Redis (free tier available)
  3. Copy the connection strings to your .env file

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=development

Option B: For Advanced Users (Local Setup)

If you prefer running everything locally:

  1. Install PostgreSQL and Redis on your computer
  2. Create a database named "revsin"
  3. Update your .env file with local connections

🎨 What Can You Do?

Command Line Tools (CLI)

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 stats

Web API

Build 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

Features Overview

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

πŸ‘₯ User Types

πŸ‘‘ Admin

  • Can do: Everything! Manage users, books, system settings
  • Perfect for: Library directors, IT administrators

πŸ“‹ Librarian

  • Can do: Manage books and loans, help patrons
  • Perfect for: Front desk staff, circulation desk workers

πŸ“– Member

  • Can do: Search books, view their loans, pay fines
  • Perfect for: Library patrons, students, community members

πŸ†˜ Need Help?

Common Questions

"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

Getting Support


πŸ”§ Advanced Features

πŸ–₯ Production Deployment

Running in Production

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.UvicornWorker

Production Checklist:

  • βœ… Use strong passwords and secret keys
  • βœ… Enable HTTPS
  • βœ… Set up database backups
  • βœ… Configure monitoring
βš™οΈ Configuration Options

Environment Variables

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

For Developers

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:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Submit a pull request
πŸ“Š API Reference

REST API Endpoints

Authentication

  • POST /api/v1/auth/register β€” Create new account
  • POST /api/v1/auth/login β€” Login and get access token
  • GET /api/v1/auth/me β€” Get current user info

Books

  • GET /api/v1/books/ β€” List all books
  • POST /api/v1/books/ β€” Add new book (librarian+)
  • GET /api/v1/books/{id} β€” Get book details
  • GET /api/v1/books/search?q=python β€” Search books

Users

  • GET /api/v1/users/ β€” List users (admin only)
  • GET /api/v1/users/{id} β€” Get user details
  • PUT /api/v1/users/{id} β€” Update user info

Loans

  • GET /api/v1/loans/ β€” List loans (librarian+)
  • POST /api/v1/loans/ β€” Create new loan
  • PUT /api/v1/loans/{id}/return β€” Return book
  • GET /api/v1/loans/overdue β€” Get overdue loans

Interactive API Docs: http://localhost:8000/docs

πŸ“± CLI Commands Reference

System Commands

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 information

User Management

rslms users create          # Add new user (interactive)
rslms users list            # Show all users
rslms users search "john"   # Find users
rslms users stats           # User statistics

Book Management

rslms books add             # Add book (interactive)
rslms books list            # Show all books
rslms books search "python" # Search books
rslms books available       # Show available books

Loan Management

rslms 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!


πŸ— Technical Details

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

πŸ“„ License

MIT License - feel free to use RevSin in your library!


πŸ™ Acknowledgments

Built with ❀️ for librarians and book lovers everywhere.

Special thanks to:

  • The FastAPI community
  • Open source contributors
  • Librarians who provided feedback

Ready to revolutionize your library management?
Get Started Now! β€’ Read the Docs β€’ Get Help

About

RevSin - A complete library management solution with interactive CLI, REST API, user management, and automated loan tracking. Built for libraries of all sizes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages