{"id":26993341,"url":"https://github.com/sanskarajput/library-management-application","last_synced_at":"2026-02-24T01:31:38.092Z","repository":{"id":334456959,"uuid":"816616456","full_name":"sanskarajput/Library-Management-Application","owner":"sanskarajput","description":"A Flask-based Library Management System featuring role-based access control for librarians and readers. Includes book and section management, user authentication, request handling with automatic expiration, ratings \u0026 reviews, search functionality, PDF viewer and analytics dashboard.","archived":false,"fork":false,"pushed_at":"2026-02-10T16:28:34.000Z","size":14900,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-10T20:41:14.173Z","etag":null,"topics":["bootstrap","cors","flask","javascript","library-management-system","python","restful-api","server-side-rendering","sqlalchemy-orm","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanskarajput.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-18T05:09:09.000Z","updated_at":"2026-02-10T16:38:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sanskarajput/Library-Management-Application","commit_stats":null,"previous_names":["sanskarajput/library-management-application"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sanskarajput/Library-Management-Application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanskarajput%2FLibrary-Management-Application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanskarajput%2FLibrary-Management-Application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanskarajput%2FLibrary-Management-Application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanskarajput%2FLibrary-Management-Application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanskarajput","download_url":"https://codeload.github.com/sanskarajput/Library-Management-Application/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanskarajput%2FLibrary-Management-Application/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29766285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T01:28:30.166Z","status":"ssl_error","status_checked_at":"2026-02-24T01:28:27.518Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","cors","flask","javascript","library-management-system","python","restful-api","server-side-rendering","sqlalchemy-orm","sqlite3"],"created_at":"2025-04-03T23:18:23.143Z","updated_at":"2026-02-24T01:31:38.085Z","avatar_url":"https://github.com/sanskarajput.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚 Library Management System\n\nA full-stack web application designed to streamline library operations and enhance the reading experience. Built as a college project, this system demonstrates practical implementation of web development concepts while solving real-world library management challenges.\n\n## 🎯 Project Overview\n\nThis Library Management System is a **server-side rendered web application** developed using Flask, offering a complete solution for managing library resources, user interactions, and administrative tasks. The application follows the traditional Model-View-Controller (MVC) architecture, where all pages are dynamically rendered on the server using Jinja2 templates, providing a seamless and interactive experience.\n\n**Developed as part of academic coursework**, this project showcases the integration of modern web technologies, database management, and user-centric design principles to create a practical library management solution.\n\n### Why This Project?\n\nLibraries are fundamental to education and knowledge sharing, yet managing them efficiently can be challenging. This application was created to:\n\n- Simplify book cataloging and organization for librarians\n- Provide readers with easy access to library resources\n- Automate routine tasks like request handling and access expiration\n- Offer insights through analytics and statistics\n- Demonstrate full-stack development capabilities in an academic setting\n\n## 🌟 Features\n\n### 🔐 Authentication \u0026 User Management\n\n- **User Registration \u0026 Login**: Secure signup and login system for readers\n- **Librarian Authentication**: Separate login portal for librarians with role-based access\n- **Password Security**: Bcrypt hashing for secure password storage\n- **Profile Management**: Upload profile pictures, view account information, and delete accounts\n- **Session Management**: Secure session handling with Flask-Login\n\n### 📖 Book Management\n\n- **CRUD Operations**: Create, read, update, and delete books with metadata (name, author, description, cover images, PDF attachments)\n- **Book Organization**: Assign/remove books from sections and view by section\n- **Book Tracking**: Issue count tracking and date management\n\n### 📑 Section Management\n\n- **CRUD Operations**: Create, edit, and delete sections with descriptions and custom images\n- **Section Features**: View all sections with book counts and add multiple books to sections in bulk\n\n### 📥 Book Request \u0026 Access System\n\n- **Request Management**: Users can request books for various durations (6 hours to 2 weeks), view pending requests, and cancel requests\n- **Access Control**: Librarians review and approve/reject requests with configurable access durations\n- **Automatic Expiration**: Scheduled task runs every 5 seconds to automatically expire and remove outdated book access\n- **Fair Resource Distribution**: Maximum limit of 5 concurrent book access grants per user\n\n### ⭐ Rating \u0026 Review System\n\n- **Rating System**: 5-star ratings with average calculations and top-rated showcases\n- **Comment System**: Users and librarians can leave timestamped comments on books\n\n### 🔍 Search \u0026 Discovery\n\n- **Advanced Search**: Filter by book name, author, description, and section with real-time filtering\n- **Recommendations**: Top-rated books showcase and book popularity tracking\n\n### 📊 Analytics \u0026 Statistics\n\n- **Dashboard Analytics**: Track total books, sections, readers, requests, and active access\n- **Visual Charts**: Interactive pie charts for book distribution and bar charts for top-rated books\n- **User Statistics**: Personal reading history, completed books, and currently accessed books with remaining time\n\n### 📄 PDF Reading\n\n- **In-Browser Viewer**: Full-screen PDF access with text-to-speech functionality and access control\n\n### 🔒 Security \u0026 Access Control\n\n- **Role-Based Access Control (RBAC)**: Librarian-only and user-only routes with automatic role verification\n- **Error Handling**: Custom error pages (403, 404, 500) with user-friendly messages\n- **Data Validation**: Input sanitization, secure file uploads, SQL injection prevention, and XSS protection\n\n## 🛠️ Technology Stack\n\n### Backend\n\n- **Flask**: Web framework\n- **SQLAlchemy**: ORM for database operations\n- **Flask-Migrate**: Database migrations\n- **Flask-Login**: User session management\n- **Flask-Bcrypt**: Password hashing\n- **Flask-RESTful**: REST API development\n- **Flask-CORS**: Cross-origin resource sharing\n- **Flask-APScheduler**: Task scheduling for automatic access expiration\n- **Alembic**: Database migration tool\n\n### Frontend\n\n- **Bootstrap 5**: Responsive CSS framework\n- **JavaScript (ES6+)**: Client-side interactivity\n- **Chart.js**: Data visualization (bar charts)\n- **Google Charts**: Data visualization (pie charts)\n- **Font Awesome**: Icons\n- **Jinja2**: Template engine\n\n### Database\n\n- **SQLite3**: Lightweight relational database\n\n### Additional Libraries\n\n- **Werkzeug**: WSGI utilities and file handling\n- **python-dateutil**: Date/time utilities\n- **pytz**: Timezone support\n\n## 📁 Project Structure\n\n```\nLibrary-Management-Application/\n│\n├── application/              # Main application package\n│   ├── __init__.py\n│   ├── api.py                # RESTful API endpoints\n│   ├── config.py             # Configuration settings\n│   ├── controllers.py        # Route handlers and business logic\n│   ├── database.py           # Database initialization\n│   ├── functions.py          # Helper functions and utilities\n│   ├── login.py              # Authentication and authorization\n│   └── models.py             # SQLAlchemy database models\n│\n├── database/                 # Database files\n│   └── database.sqlite3      # SQLite database\n│\n├── media/                    # Media storage\n│   ├── pdfs/                 # PDF files\n│   └── picture/              # Image files\n│       ├── books/            # Book cover images\n│       ├── profiles/         # User profile pictures\n│       ├── sections/         # Section images\n│       └── ...               # Other images\n│\n├── migrations/               # Database migrations\n│   ├── alembic.ini\n│   ├── env.py\n│   └── versions/             # Migration scripts\n│\n├── static/                   # Static files\n│   ├── script.js             # JavaScript files\n│   └── style.css             # CSS styles\n│\n├── templates/                # Jinja2 templates\n│   ├── base.html             # Base template\n│   ├── index.html            # Landing page\n│   ├── user_home.html        # User dashboard\n│   ├── librarian_home.html   # Librarian dashboard\n│   ├── dashboard.html        # Dynamic dashboard\n│   ├── book.html             # Book card component\n│   ├── sections.html         # Section card component\n│   ├── profile.html          # User profile page\n│   ├── search.html           # Search results\n│   ├── add_book.html         # Add book form\n│   ├── add_section.html      # Add section form\n│   ├── signup.html           # Registration page\n│   ├── user_login.html       # User login\n│   ├── librarian_login.html  # Librarian login\n│   ├── 403.html              # Forbidden error page\n│   ├── 404.html              # Not found error page\n│   └── 500.html              # Server error page\n│\n├── app.py                    # Application entry point\n├── requirements.txt          # Python dependencies\n├── .gitignore                # Git ignore rules\n└── README.md                 # Project documentation\n```\n\n## 🚀 Installation \u0026 Setup\n\n### Prerequisites\n\n- Python 3.8 or higher\n- pip (Python package manager)\n- Git (optional, for cloning)\n\n\n### Step 1: Clone the Repository\n\n```bash\ngit clone \u003crepository-url\u003e\ncd Library-Management-Application\n```\n\n\n### Step 2: Create Virtual Environment (Recommended)\n\n```bash\n# Windows\npython -m venv .venv\n.venv\\Scripts\\activate\n\n# Linux / Mac\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\n\n### Step 3: Install Dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n### Step 4: Database Setup (Optional)\n\n\u003e **Skip this step if you already have an existing database configured.**\n\nThe database is automatically created on first run.\nIf you want to set up a **fresh database** or manage migrations manually, run:\n\n```bash\n# Initialize migration repository (if not already done)\nflask db init\n\n# Create initial migration\nflask db migrate -m \"Initial migration\"\n\n# Apply migrations\nflask db upgrade\n```\n\n### Step 5: Create Librarian Account (Optional)\n\n\u003e **Required only for first-time setup with a new database.**\n\nOn the first run, the application will prompt you in the terminal to create a librarian account:\n\n- Enter a librarian username\n- Enter a password (input hidden)\n\nIf you’re using an **existing database**, this step is **not required**.\n\n### Step 6: Run the Application\n\n```bash\npython app.py\n```\n\nThe application will be available at:\n👉 `http://localhost:5000`\n\n## 📱 Using the Application\n\n### For Librarians\n1. Login with your credentials → Access the admin dashboard\n2. Create sections to organize your library (Fiction, Science, etc.)\n3. Add books with details, cover images, and PDF files\n4. Review pending requests → Approve/reject with access duration\n5. Monitor analytics and manage user accounts\n\n### For Readers\n1. Sign up and create your account\n2. Browse books by section or search by title/author\n3. Request books with your preferred reading duration\n4. Once approved, read PDFs directly in your browser\n5. Rate and comment on books you've read\n\n## 🔒 Security Features\n\n- **Password Protection**: Bcrypt hashing for secure credential storage\n- **Role-Based Access Control**: Separate interfaces and permissions for librarians and readers\n- **Session Management**: Secure user sessions with Flask-Login\n- **Input Validation**: Protection against SQL injection and XSS attacks\n- **File Upload Security**: Validated and sanitized file uploads\n- **Error Handling**: Graceful error pages that don't expose sensitive information\n\n## 🎓 Academic Context\n\nThis project was developed as part of college coursework to demonstrate:\n\n- Full-stack web development proficiency\n- Database design and management\n- User authentication and authorization\n- Server-side rendering with Flask and Jinja2\n- RESTful API development\n- Responsive web design principles\n- Practical application of software engineering concepts\n\nThe project emphasizes clean code, proper documentation, and real-world applicability while maintaining academic rigor.\n\n## 🔄 Server-Side Rendering Approach\n\nUnlike modern single-page applications (SPAs), this project utilizes **traditional server-side rendering** where:\n\n- Pages are fully rendered on the server using Jinja2 templates\n- HTML is sent to the client as complete documents\n- Reduces client-side JavaScript complexity\n- Provides better initial load times and SEO benefits\n- Demonstrates fundamental web development principles\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built with dedication as a learning journey in web development** 📖✨\n\n*Questions or feedback? Feel free to reach out!*\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanskarajput%2Flibrary-management-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanskarajput%2Flibrary-management-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanskarajput%2Flibrary-management-application/lists"}