A full-stack cloud-deployed Library Management System built as a DBMS Lab Project for Brainware University
๐ Application: https://goldlion123rp.github.io/Library_DBMS/
๐ Backend API: https://library-dbms-1tp2.onrender.com
๐ Source Code: https://github.com/goldlion123rp/Library_DBMS
Note: First load may take 30-60 seconds as the free backend server wakes up. Subsequent requests are fast.
- Username:
rahul.pal - Password:
rahul123 - Permissions: Complete system access, staff management, all CRUD operations
- Username:
ajay.das - Password:
ajay123 - Permissions: Book & member management, loan operations, reports
- Username:
santunu.mog - Password:
santunu123 - Permissions: View access, basic loan operations
- โ User Authentication - Secure login with role-based access control (RBAC)
- โ Book Management - Complete CRUD operations with search and filtering
- โ Member Management - Track members, memberships, and borrowing history
- โ Loan Tracking - Issue and return books with automatic due date calculation (14-day period)
- โ Fine Management - Automatic fine calculation (โน5/day for overdue books)
- โ Reports & Analytics - Real-time statistics and performance insights
- โ Staff Management - Admin-only staff and role management
- โ Fully Responsive Design - Seamless experience on desktop, tablet, and mobile
- โ Mobile Hamburger Menu - Touch-friendly navigation with slide-in sidebar
- โ Real-time Search - Instant search and filtering across all modules
- โ Clean Modern UI - Intuitive interface with color-coded elements
- โ Interactive Dashboard - Real-time statistics and quick insights
- โ Smooth Animations - Polished user interactions and transitions
- โ
Role-Based Access Control (RBAC)
- Admin: Full system access + staff management
- Librarian: Book/member management + loan operations
- Assistant: View access + basic operations
- โ Token-based Authentication - Secure session management
- โ Secure API Endpoints - Protected routes with authorization
- โ Input Validation - Client and server-side validation
- โ CORS Protection - Configured cross-origin policies
- โ Login Audit Logging - Tracks all login attempts with IP, user agent, and status
- โ Hamburger Menu - Animated slide-in navigation
- โ Touch Optimized - Large touch targets and swipe gestures
- โ Responsive Tables - Horizontal scroll for data tables
- โ Adaptive Layouts - Optimized for all screen sizes
- โ No Content Overlap - Perfect mobile viewing experience
- HTML5 - Semantic markup and accessibility
- CSS3 - Custom styling with CSS variables and media queries
- Vanilla JavaScript (ES6+) - Modern JavaScript features
- Responsive Design - Mobile-first approach with breakpoints
- Hosted on: GitHub Pages (Free CDN hosting)
- Python 3.9+ - Core programming language
- Flask 3.0.0 - Lightweight web framework
- Flask-CORS 4.0.0 - Cross-origin resource sharing
- PyMySQL 1.1.0 - MySQL database connector
- Gunicorn 21.2.0 - Production WSGI server
- Hosted on: Render.com (Free tier with auto-deploy)
- MySQL 8.4 - Relational database management system
- 11 Normalized Tables - 3NF schema design
- Indexed Queries - Optimized performance
- Foreign Keys - Referential integrity
- Hosted on: Clever Cloud (Free tier - 256MB storage)
- Roles - User role definitions (Admin, Librarian, Assistant)
- Users - System users with role assignments
- Staff - Library staff information and credentials
- AuthenticationSystem - Login authentication data
- Author - Book authors with biography
- BookDetails - Book metadata (ISBN, title, author, category, price)
- Books - Physical inventory (location, quantity)
- Members - Library members and membership details
- Loans - Borrowing transactions and status tracking
- Fines - Overdue fine calculations and payment status
- BorrowHistory - Historical data for analytics
- LoginAuditLog - Security logging for login attempts
- Foreign key constraints for referential integrity
- Indexed columns (book_id, member_id, isbn, membership_no)
- Normalized to Third Normal Form (3NF)
- CASCADE and RESTRICT rules for data consistency
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ USER DEVICES โ
โ (Desktop | Tablet | Mobile) โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTPS
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GitHub Pages โ
โ (Static Frontend) โ
โ โ HTML/CSS/JavaScript โ
โ โ CDN Delivery โ
โ โ SSL Certificate โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ REST API (HTTPS)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Render.com โ
โ (Backend API) โ
โ โ Flask Application โ
โ โ Gunicorn Server โ
โ โ Auto Deploy from Git โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ MySQL Connection
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Clever Cloud โ
โ (MySQL Database) โ
โ โ Managed MySQL 8.4 โ
โ โ Automatic Backups โ
โ โ 256MB Free Tier โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Python 3.9 or higher
- MySQL 8.0 or higher
- Git
- Modern web browser
git clone [https://github.com/goldlion123rp/Library_DBMS.git](https://github.com/goldlion123rp/Library_DBMS.git)
cd Library_DBMS# Navigate to backend folder
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows PowerShell:
venv\Scripts\Activate.ps1
# Windows CMD:
venv\Scripts\activate.bat
# Mac/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt# Using MySQL Command Line
mysql -u root -p
# Create database
CREATE DATABASE LibraryDB;
exit;
# Import schema
mysql -u root -p LibraryDB < ../database/schema.sql
# Or use phpMyAdmin:
# 1. Open http://localhost/phpmyadmin
# 2. Create database "LibraryDB"
# 3. Import database/schema.sqlCreate backend/.env file:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_NAME=LibraryDB
DB_PORT=3306
SECRET_KEY=your-secret-key-here
DEBUG=True
CORS_ORIGINS=*# Make sure venv is activated
python app.pyBackend will run on http://localhost:5000
Test backend:
# Visit in browser
http://localhost:5000
# Should show JSON response# Open new terminal
# Navigate to project root
cd Library_DBMS
# Start HTTP server
python -m http.server 8000Frontend will run on http://localhost:8000
- Frontend: http://localhost:8000
- Backend API: http://localhost:5000
- Login: Use demo credentials above
For complete deployment guide, see DEPLOYMENT.md
- Create free MySQL add-on at https://clever-cloud.com
- Get database credentials
- Import
database/schema_cloud.sqlvia phpMyAdmin - Note connection details for backend
- Sign up at https://render.com
- Connect GitHub repository
- Create Web Service:
- Root Directory:
backend - Build Command:
pip install -r requirements.txt - Start Command:
gunicorn app:app
- Root Directory:
- Add environment variables (DB credentials)
- Deploy and get backend URL
- Push code to GitHub
- Go to repository Settings โ Pages
- Source:
mainbranch,/ (root)folder - Update
js/config.jswith backend URL - Site will be live at
https://username.github.io/repo-name/
- Statistics Cards: Total books, members, active loans, overdue books
- Books by Category: Visual breakdown with progress bars
- Recent Loan Activity: Real-time transaction feed
- Financial Summary: Unpaid fines and counts
- Quick Actions: Navigate to key modules
- Add Books: ISBN, title, author, category, location, quantity, price
- Edit Books: Update all book details and inventory
- Delete Books: With validation (prevent deletion of loaned books)
- Search & Filter: By title, author, ISBN, or category
- Category Management: Automatic category detection
- Availability Status: Real-time quantity tracking
- Register Members: Membership number, name, contact, join date
- Edit Members: Update member information
- View History: Complete borrowing history per member
- Status Tracking: Active/Inactive membership status
- Search Members: By name, email, or membership number
- Issue Books: Select book and member, auto-calculate due date
- Return Books: Mark as returned, automatic fine calculation
- Track Status: Issued, Returned, Overdue with visual indicators
- Due Date Alerts: Highlight overdue items
- Filter Options: By status (issued/returned/overdue)
- Validation: Prevent issuing to members with overdue books
- Auto-calculation: โน5 per day for late returns
- View All Fines: Paid and unpaid with details
- Mark as Paid: Update payment status
- Total Summary: Unpaid fines amount and count
- Filter by Status: Paid/Unpaid filtering
- Top 10 Most Borrowed Books: Ranked by popularity
- Top 10 Most Active Members: Based on borrowing frequency
- Late Return Trends: Average late days per member
- Monthly Statistics: Issues vs returns over time
- Visual Insights: Charts and trend analysis
- Add Staff: Create new staff accounts with roles
- Edit Staff: Update details and change roles
- Delete Staff: With validation (prevent deletion of active issuers)
- Role Assignment: Admin, Librarian, Assistant
- Credential Management: Username and password setup
- Login Audit Logs: New admin-only page to monitor all successful and failed login attempts.
- Detailed Logging: Captures username, timestamp, IP address, user agent, and failure reason.
- Security Dashboard: Displays stats like today's logins and failed attempts.
- Role Protection: The new page is strictly for Admin users.
- โ User login (all three roles)
- โ Dashboard statistics display
- โ Book CRUD operations
- โ Member CRUD operations
- โ Issue and return books
- โ Fine calculation accuracy
- โ Search and filter functionality
- โ Reports data accuracy
- โ Staff management (Admin)
- โ Responsive design on mobile
- โ Hamburger menu functionality
Test endpoints using browser or Postman:
# Health check
GET /
# Authentication
POST /api/auth/login
GET /api/auth/verify
# Books
GET /api/books
GET /api/books/{id}
POST /api/books
PUT /api/books/{id}
DELETE /api/books/{id}
# Members
GET /api/members
POST /api/members
PUT /api/members/{id}
DELETE /api/members/{id}
# Loans
GET /api/loans
POST /api/loans/issue
PUT /api/loans/{id}/return
# Fines
GET /api/fines
PUT /api/fines/{id}/pay
GET /api/fines/total
# Reports
GET /api/reports/dashboard
GET /api/reports/most-borrowed
GET /api/reports/active-members
GET /api/reports/monthly-stats
# Staff (Admin only)
GET /api/staff
POST /api/staff
PUT /api/staff/{id}
DELETE /api/staff/{id}- Production:
https://library-dbms-1tp2.onrender.com/api - Local:
http://localhost:5000/api
All protected endpoints require authentication header:
Authorization: Bearer {token}
GET /api/auth/login-logs- Get all login logsGET /api/auth/login-stats- Get login statistics
{
"success": true,
"data": { ... },
"message": "Operation successful"
}{
"success": false,
"error": "Error message description"
}Project Lead & Developer:
- Rahul Pal - @goldlion123rp
Team Contributors:
- Subhadip Jana
- Ajay Kumar Das
- Pritam Maity
- Santunu Mog
Institution: Brainware University
Department: Computer Science & Engineering
Course: DBMS Lab (PCC-CSG591)
Semester: 5
Academic Year: 2024-2025
Library_DBMS/
โโโ backend/
โ โโโ routes/
โ โ โโโ __init__.py
โ โ โโโ auth.py # Authentication endpoints
โ โ โโโ books.py # Book management
โ โ โโโ members.py # Member management
โ โ โโโ loans.py # Loan operations
โ โ โโโ fines.py # Fine management
โ โ โโโ reports.py # Analytics & reports
โ โ โโโ staff.py # Staff management
โ โโโ utils/
โ โ โโโ __init__.py
โ โ โโโ helpers.py # Helper functions
โ โโโ app.py # Main Flask application
โ โโโ config.py # Configuration settings
โ โโโ database.py # Database connections
โ โโโ requirements.txt # Python dependencies
โโโ database/
โ โโโ schema.sql # Local database schema
โ โโโ schema_cloud.sql # Cloud deployment schema
โโโ css/
โ โโโ style.css # Complete styling with responsive design
โโโ js/
โ โโโ config.js # API configuration
โ โโโ auth.js # Authentication logic
โ โโโ mobile.js # Mobile hamburger menu โญ NEW
โ โโโ dashboard.js # Dashboard functionality
โ โโโ books.js # Book operations
โ โโโ members.js # Member operations
โ โโโ loans.js # Loan operations
โ โโโ fines.js # Fine operations
โ โโโ reports.js # Reports & analytics
โ โโโ staff.js # Staff management
โโโ index.html # Login page
โโโ dashboard.html # Dashboard
โโโ books.html # Books module
โโโ members.html # Members module
โโโ loans.html # Loans module
โโโ login-logs.html # Login audit log page โญ NEW
โโโ fines.html # Fines module
โโโ reports.html # Reports module
โโโ staff.html # Staff module
โโโ favicon.svg # Favicon
โโโ .gitignore # Git ignore rules
โโโ README.md # This file
โโโ DEPLOYMENT.md # Deployment guide
โโโ LICENSE # MIT License
Backend (Render.com):
- โฑ๏ธ Spins down after 15 minutes of inactivity
- โฑ๏ธ First request takes 30-60 seconds to wake up
- โฑ๏ธ Subsequent requests are fast (normal speed)
- ๐ก Solution: Use UptimeRobot to ping every 5 minutes
Database (Clever Cloud):
- ๐พ 256MB storage limit (~10,000+ records)
- ๐พ Sufficient for small to medium libraries
GitHub Pages:
- ๐ Static files only (no backend processing)
- ๐ 100GB bandwidth/month
- โ Chrome 90+
- โ Firefox 88+
- โ Safari 14+
- โ Edge 90+
- โ IE11 not supported
- โ Fully responsive on all devices
- โ Touch-optimized controls
- โ Hamburger navigation menu
โ ๏ธ Tables scroll horizontally on small screens due to large data content.
- Email notifications for due dates and overdue books
- QR code generation for books and membership cards
- Book reservation system
- Advanced analytics with interactive charts (Chart.js)
- Export reports to PDF/Excel
- Barcode scanner integration
- Multi-language support (i18n)
- Dark mode theme toggle
- Progressive Web App (PWA) support
- Real-time notifications with WebSocket
- Implement JWT refresh tokens
- Add unit tests (pytest)
- API rate limiting
- Database query optimization
- Implement caching (Redis)
- Add API versioning
- Implement logging system
- Add data backup automation
- React Native mobile application
- Offline mode support
- Push notifications
- Biometric authentication
- Book recommendation system
- Demand prediction
- Automatic categorization
- Chatbot support
This is an academic project, but suggestions and feedback are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 for Python code
- Use meaningful variable names
- Comment complex logic
- Write descriptive commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Flask (BSD License)
- Flask-CORS (MIT License)
- PyMySQL (MIT License)
- Gunicorn (MIT License)
- Brainware University - For the opportunity and academic support
- Department of Computer Science & Engineering - For project guidance
- Render.com - Free backend hosting platform
- GitHub Pages - Free frontend hosting and CDN
- Clever Cloud - Free MySQL database hosting
- Stack Overflow Community - For troubleshooting assistance
- MDN Web Docs - For web development references
Developer: Rahul Pal
Email: goldlion123.rp@gmail.com
GitHub: @goldlion123rp
Project Link: https://github.com/goldlion123rp/Library_DBMS
Found a bug? Open an issue
Have questions? Check Discussions
If you found this project helpful:
- โญ Star this repository
- ๐ด Fork for your own use
- ๐ข Share with others
- ๐ฌ Provide feedback via issues
- ๐ค Contribute improvements
- โ Full-stack cloud deployment
- โ RESTful API architecture
- โ Normalized database design (3NF)
- โ Role-based access control
- โ Responsive mobile-first design
- โ Production-ready application
- โ Complete documentation
- โ Open-source contribution
Brainware University | Department of CSE | 2024-2025
๐ Live Demo โข ๐ Documentation โข ๐ Report Bug โข โจ Request Feature
โญ If this project helped you, please give it a star! โญ