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).
- Python (Flask)
- HTML
- CSS (Tailwind)
- curl (for API testing)
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
-
- 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
curlandtest_api.shscript
-
- 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
- Server initialization
app.pysets up Flask and configures global singletons:Librarymanages all the booksUserManagermanages 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
- API Routes
- 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.shruns a sequence of curl requests- Add users/books
- Borrow/return flow
- Check admin and user pages
- Confirms both API and HTML endpoints are functional
- Add user authentication & roles (librarian vs user)
- Improve UI with Tailwind components (modals, tables, forms)
- Extend services with external APIs (Google Books, OpenLibrary)
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.
