A modern, full-stack Library Management System with FastAPI backend and Vue.js frontend, featuring a clean, responsive UI and real-time notifications.
- RESTful API with FastAPI
- JWT authentication with role-based access control
- SQLAlchemy ORM with SQLite database
- Real-time notifications via Server-Sent Events (SSE)
- Book catalogue management with complete details
- Borrow and return tracking with late fees
- Reservation system with automatic notifications
- Optimized database queries with joins
- Modern, responsive UI built with Vue 3
- Professional toast notification system
- Enhanced book catalogue with visual availability indicators
- Comprehensive book information display in all views
- Real-time notifications dropdown
- Role-based access control
- Advanced search with debouncing
- Book browsing and search
- Borrow management with full book details
- Reservation system
- User management (admin/librarian)
- Mobile-optimized responsive design
- Python 3.8+
- Node.js 16+
- npm or yarn
-
Install Backend Dependencies
pip install -r requirements.txt
-
Install Frontend Dependencies
cd frontend npm install cd ..
-
Start Backend Server
# From project root uvicorn backend.app.main:app --reload --port 8000Backend will run at:
http://localhost:8000API docs available at:http://localhost:8000/docs -
Start Frontend Dev Server (in a new terminal)
cd frontend npm run devFrontend will run at:
http://localhost:3000
This system features a completely redesigned user interface with:
- Enhanced Book Catalogue: Visual availability indicators, progress bars, and improved card design
- Toast Notifications: Modern, non-intrusive success/error feedback
- Complete Book Details: All views now show book titles, authors, and ISBNs (not just IDs)
- Responsive Design: Fully optimized for mobile, tablet, and desktop
- Better Navigation Flow: Auto-redirect authenticated users to relevant pages
- Professional Polish: Smooth animations, hover effects, and improved typography
See UI_IMPROVEMENTS.md and UI_QUICK_REFERENCE.md for detailed documentation.
lms/
βββ backend/
β βββ app/
β β βββ api/ # API routes
β β βββ core/ # Configuration & security
β β βββ crud/ # Database operations
β β βββ db/ # Database models & session
β β βββ schemas/ # Pydantic schemas
β β βββ services/ # Business logic
β βββ main.py # FastAPI application
βββ frontend/
β βββ src/
β β βββ components/ # Vue components
β β βββ views/ # Page views
β β βββ services/ # API client
β β βββ stores/ # State management
β β βββ router/ # Vue Router
β βββ index.html
β βββ package.json
βββ requirements.txt # Python dependencies
βββ README.md
POST /api/auth/register- Register new userPOST /api/auth/login- Login and get JWT token
GET /api/books/- List all books (with optional search)POST /api/books/- Add book (librarian only)PUT /api/books/{id}- Update book (librarian only)DELETE /api/books/{isbn}- Delete book (librarian only)
POST /api/borrows/- Borrow a bookPOST /api/borrows/return/{id}- Return a bookGET /api/borrows/me- Get user's borrows
POST /api/reservations/- Create reservationGET /api/reservations/- List reservationsDELETE /api/reservations/{id}- Cancel reservation
GET /api/users/- List all usersPOST /api/users/- Create user
GET /api/notifications/- Get notificationsGET /api/notifications/stream- SSE streamPOST /api/notifications/mark-read- Mark as read
- Student - Can browse, borrow, return, and reserve books
- Librarian - Can manage books, view all reservations, and create users
- Admin - Full system access
- Backend Port:
8000 - Frontend Port:
3000 - Database: SQLite (
lms.db) - JWT Secret: Configured in
backend/app/core/config.py
# Run with auto-reload
uvicorn backend.app.main:app --reload --port 8000
# Run tests
pytestcd frontend
# Development server with HMR
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview- Set environment variables:
SECRET_KEY- JWT secret keyDATABASE_URL- Production database URL
- Use production ASGI server:
gunicorn backend.app.main:app -w 4 -k uvicorn.workers.UvicornWorker
- Build the frontend:
cd frontend npm run build - Serve the
dist/folder with nginx or similar
- Add, edit, and delete books
- Track total and available copies
- ISBN-based identification
- Search by title, author, or ISBN
- 14-day borrow period
- Automatic due date calculation
- Late fee calculation (β¦100 per day)
- Borrow history tracking
- Reserve unavailable books
- Automatic notifications when available
- Queue management
- Cancel reservations
- Real-time via Server-Sent Events
- Borrow confirmations
- Return confirmations
- Reservation availability alerts
- Overdue warnings
- Database errors: Delete
lms.dband restart - Port already in use: Change port in uvicorn command
- Import errors: Ensure all dependencies are installed
- CORS errors: Check backend CORS configuration
- API connection failed: Ensure backend is running on port 8000
- SSE not working: Check token validity and backend SSE endpoint
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License