A full-featured, modern web application for managing a library's collection and members, complete with an integrated AI assistant powered by the Gemini API.
This project is a comprehensive, user-friendly platform built with Python Flask on the backend and a dynamic, responsive interface on the frontend. It provides a seamless and intuitive experience for both library members and administrators, featuring a sleek dark/light mode UI, robust user management with secure authentication, and intelligent search capabilities. The application is designed to be both lightweight and powerful, making it an ideal solution for managing a small to medium-sized library.
- 👤 Full User Authentication: A complete and secure registration and login system for members, featuring password hashing to ensure user data is always protected.
- 👮 Role-Based Access Control: The application distinguishes between regular users and administrators, providing a tailored interface and a separate set of powerful permissions for each role.
- 📚 Complete Book Management (Admin): Administrators have full control over the library's catalog. Through an intuitive interface, admins can add, edit, and delete books, including rich details like external cover image URLs, genres, and detailed descriptions.
- 👥 Member Management (Admin): The admin dashboard includes a comprehensive view of all registered members, giving administrators the authority to manage the user base and remove user accounts as needed.
- 🔍 Powerful Search & Filtering: Users can effortlessly search the entire catalog by book title or author. Additionally, they can filter the collection by genre, making it easy to discover new books.
- 📖 Book Detail Pages: Every book has its own dedicated page that displays its cover image, a full description, publication year, genre, and its current borrowing status, providing a rich browsing experience.
- 🙋♂️ User Profiles: Each user gets a public profile page that showcases their chosen bio and a complete, detailed history of all the books they have borrowed, both past and present.
- 🤖 Live AI Assistant: An integrated chatbot, directly connected to the Gemini API, can answer any user question in real-time, providing a smart and interactive way to get help or explore topics.
- 💾 Persistent Chat History: The AI assistant remembers your entire conversation using browser storage. You can leave the page and return later to find your chat history exactly as you left it.
- 🎨 Dual-Theme UI: A beautiful and modern interface with a convenient toggle for both dark and light themes. The user's preference is automatically saved in their browser for a consistent experience on return visits.
- ⚙️ Comprehensive Settings: Users have full control over their account. They can update their profile information (username, email, bio), change their password through a secure form, and permanently delete their own account.
- Backend: Python with the Flask framework, chosen for its lightweight nature and flexibility, making it perfect for building fast and scalable web applications.
- Database: SQLite, a self-contained, serverless database engine that is simple to set up and manage, with all data stored in a single
.dbfile. All database interactions are handled through the powerful SQLAlchemy ORM. - Frontend: Standard and reliable HTML, CSS, and Vanilla JavaScript are used to create a responsive and interactive user experience without the need for heavy frontend frameworks.
- Authentication: Flask-Login is used to manage user sessions, handle logins and logouts, and protect routes that require authentication.
- AI Integration: Live API calls are made to Google's Gemini API using the
requestslibrary, providing state-of-the-art AI capabilities directly within the application.
To get a local copy up and running, follow these simple steps.
Make sure you have Python 3 installed on your system. You can check this by running python --version. It's also highly recommended to use a virtual environment to manage project dependencies.
-
Clone the repository:
git clone [https://github.com/nomaan5541/library_full_project_AI_](https://github.com/nomaan5541/library_full_project_AI_) cd your-library_full_project_AI_ -
(Recommended) Create and activate a virtual environment:
# For Windows python -m venv venv .\venv\Scripts\activate # For macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install the required Python packages:
pip install Flask Flask-SQLAlchemy Flask-Login Werkzeug requests
-
Run the application:
python app.py
The first time you run the script, it will automatically create the
library.dbfile and populate it with a default admin user and some sample books. -
Open in your browser: Navigate to
http://127.0.0.1:5000to see the application live. The default admin credentials areadmin/admin123.
| Login Page | All Books Page |
|---|---|
 |
|
)  |
|
| ) | |
| AI Assistant | Book Details |
 |
|
)  |
|
| ) |
This project was designed and developed by VIRUS.



