https://github.com/jashjani02/library-management-system
A Flask-based Library Management System that supports CRUD operations on Books and Users, along with Borrow & Return functionality, accessible via REST API and a simple web interface.
https://github.com/jashjani02/library-management-system
bash bash-script curl flask-application html-css python python3 tailwindcss
Last synced: about 2 months ago
JSON representation
A Flask-based Library Management System that supports CRUD operations on Books and Users, along with Borrow & Return functionality, accessible via REST API and a simple web interface.
- Host: GitHub
- URL: https://github.com/jashjani02/library-management-system
- Owner: JashJani02
- Created: 2025-09-21T22:04:52.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-25T08:17:54.000Z (9 months ago)
- Last Synced: 2025-09-25T09:21:57.852Z (9 months ago)
- Topics: bash, bash-script, curl, flask-application, html-css, python, python3, tailwindcss
- Language: Python
- Homepage:
- Size: 265 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Library Management System
A full-stack Library Management System built with Flask and TailwindCSS for styling.
This project demonstrates server–client separation with both API endpoints (for programmatic access) and a web-based UI (for users and librarians).
## Tech-Stack
- Python (Flask)
- HTML
- CSS (Tailwind)
- curl (for API testing)
## Project Structure
```mermaid
graph TD
subgraph Library Management
app.py
subgraph templates/
base.html
home.html
subgraph admin/
dashboard.html
books_admin.html
users_admin.html
end
subgraph user/
user_dashboard.html
books_user.html
end
end
subgraph models/
_init_.py
book.py
user.py
library.py
user_manager.py
end
subgraph services/
__init__.py
book_api.py
book_service.py
user_service.py
end
subgraph routes/
init.py
admin_routes.py
user_routes.py
subgraph api/
__init__.py
books.py
users.py
end
end
subgraph tests/
test_api.sh
end
end
```
### Image of the Project Structure
## Features
-
Book Management
- Add, view, search, and delete books
- Track availability (borrowed vs available)
-
User Management
- Add, view, and delete users
- Track borrowed books per user
-
Borrow & Return System
- Users can borrow available books
- Return borrowed books and free them up for others
-
API-Endpoints
- REST-style JSON APIs for books and users
- Tested via
curl and test_api.sh script
-
Admin Interface
- Dashboard with total books and users
- Manage books and users through forms
-
User Interface
- User dashboard with profile info
- Browse available books
- View borrowed books
## Workflow
- Server initialization
-
app.pysets up Flask and configures global singletons:
-
Library manages all the books
-
UserManager manages all the users
- Models Layer (models/)
- Book - represents a single book (title, author, ISBN, etc.)
- Library – manages a collection of books (add, delete, borrow, return)
- User – represents a library user (profile + borrowed books)
- UserManager – manages all users
- Routing Layer(routes/)
- API Routes
/api/... - JSON endpoints for programmatic access
-
/api/books - CRUD Operations on books
-
/api/users - CRUD Operations on users & borrow/return actions
- Admin Routes
(/admin/...) – librarian dashboard & book/user management
- User Routes
(/user/...) – user dashboard, profile info, browse/borrow books
- Services Layer(services/)
- Placeholder for integrating external APIs (e.g., Google Books, OpenLibrary)
- Can extend functionality without touching core models
- Frontend(templates/ + static/)
- Admin UI – dashboards for librarians to manage books and users
- User UI – dashboards for users to browse and borrow books
- Testing(tests/)
-
test_api.sh runs a sequence of curl requests
- Add users/books
- Borrow/return flow
- Check admin and user pages
- Confirms both API and HTML endpoints are functional
## Future Improvements
- Add user authentication & roles (librarian vs user)
- Improve UI with Tailwind components (modals, tables, forms)
- Extend services with external APIs (Google Books, OpenLibrary)
## TL;DR
A Flask-based Library Management System that supports CRUD operations on Books and Users, along with Borrow & Return functionality, accessible via REST API and a simple web interface.