Loading repository data…
Loading repository data…
xrossweisse / repository
A comprehensive library management application developed using C++ and SQLite, designed to provide an efficient, lightweight solution for managing library collections and inventory. This program can serve as a reference for computer science students working on course assignments.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
libraryManagementSystem is a local, terminal-based library management system built on an SQLite database, which also offers visual management capabilities via a web interface. The system is developed using the C++20 standard, built with CMake, and supports the three major operating systems: Windows, Linux, and macOS.
The system implements role-based access control with two user types:
| Role | Functions |
|---|---|
| Administrator | Book management (CRUD), user management, borrowing record queries |
| Student | Book search, borrow/return/renew books, personal account management |
| Feature | Description |
|---|---|
| Cross-Platform | Native support for Windows, Linux, macOS |
| Embedded SQLite | SQLite amalgamation fetched via CMake FetchContent |
| Secure Passwords | SHA-256 encrypted password storage |
| Security Token | Support for password recovery security tokens |
| Overdue Alerts | Automatic detection and notification of overdue books |
| Adaptive UI | Tables automatically adjust to terminal width |
| Multi-Language Support | Switch between English and Chinese interface languages |
| Web Interface | A Modern Vue 3 WebUI |
| RESTful API | Node.js Express API server for web integration |
| Logging System | Comprehensive logging with query capabilities |
| Enhanced Admin Panel | Full book, user, and borrowing management capabilities |
| User Management | Complete user registration, authentication, and profile management |
| Responsive Design | Optimized for desktop and mobile devices |
| Dependency | Version |
|---|
| CMake | >= 3.11 |
| C++ Compiler | C++20 support |
Compiler options by platform:
Check CMake installation:
cmake --version
Note: CMake will download the SQLite amalgamation during the configure step.
# Navigate to project directory
cd /path/to/libraryManagementSystem
# Create build directory and compile
cmake -B build && cmake --build build
# Run the program
cd build
./lib
# Navigate to project directory
cd /d /path/to/libraryManagementSystem
# Create build directory and compile
cmake -B build -G "MinGW Makefiles" && cmake --build build
# Run the program
cd build
lib.exe
# Create Visual Studio solution
cmake -B build -G "Visual Studio 17 2022"
# Build (or open build directory in IDE)
cmake --build build --config Release
# Run the program
build\Release\lib.exe
| IDE | Steps |
|---|---|
| CLion | Open project → Auto-detect CMake → Click Run |
| Visual Studio | Open folder → Select lib.exe as startup → Run |
Note: For legacy IDEs like VC++ 6.0, consider using CMake or modern IDEs
Compile Windows executables on macOS/Linux:
# Install dependencies
brew install cmake mingw-w64
# Create build directory
mkdir build && cd build
# Configure cross-compilation
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Windows-x86.cmake
# Build
cmake --build .
# Install dependencies
sudo apt-get update
sudo apt-get install -y cmake g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64
# Create build directory
mkdir build && cd build
# Configure cross-compilation
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Windows-x86.cmake
# Build
cmake --build .
┌─────────────────────────────────────────────────────────────┐
│ Program Start │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Initialize Database (library.db) │
│ - Create table structures │
│ - Check for administrator account │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Main Menu │
│ 1. Login 2. Register 3. Forgot Password 0. Exit │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────┐
│ User Login │
└─────────────────────────────────────────────────────────────────────┘
│
┌───────────────┴───────────────┐
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ Admin (ADMIN) │ │ Student (STUDENT)│
└──────────────────┘ └──────────────────┘
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ Admin Menu │ │ Student Menu │
│ 1. Book Mgmt │ │ 1. Search Books │
│ - Add/Edit/ │ │ 2. Borrow Book │
│ Delete/Find │ │ 3. Return Book │
│ 2. User Mgmt │ │ 4. Renew Book │
│ - Add User │ │ 5. My Borrowings │
│ - Change Pass │ │ 6. Account Mgmt │
│ 3. Borrow Mgmt │ │ - View Info │
│ - Query Student│ │ - Edit Info │
│ - All Records │ │ - Change Pass │
└──────────────────┘ │ - Set Token │
└──────────────────┘
| Function | Description |
|---|---|
| Add Book | Add new book with ISBN, title, author, publisher, category, quantity |
| Edit Book | Modify book information by ISBN |
| Delete Book | Remove book (requires no active borrowings) |
| Search Books | Search by keyword (title/author/ISBN) |
| List All Books | Display all books, sortable by title/author/ISBN |
| Function | Description |
|---|---|
| Borrow Book | Enter ISBN and borrowing days (1-90 days) |
| Return Book | Return borrowed book by record ID |
| Renew Book | Extend borrowing period |
| View Borrowings | View personal borrowing records |
| Function | Description |
|---|---|
| Change Password | Admin can change any user's password; students can only change their own |
| Security Token | Set password recovery token for verification |
| Forgot Password | Reset password using username and security token |
--- Welcome to Library Management System ---
1. Login
2. Student Registration
3. Forgot Password
4. Choose Language / 选择语言
0. Exit
--------------------------------------------
Please enter your choice:
--- Choose Language ---
1. English
2. 中文
0. Return
-----------------------------
Please enter your choice:
--- Admin Menu (admin) ---
1. Book Management - Add/Edit/Delete/Search
2. User Management - Add User/Change Password
3. Borrowing Management - Query Student/All Records
0. Logout
-----------------------------
Please enter your choice:
--- Student Menu (Zhang San) ---
1. Search Books
2. Borrow Book
3. Return Book
4. Renew Book
5. View My Borrowings
6. Account Management (View Info/Change Password/Set Token)
0. Logout
---------------------------------
Please enter your choice:
+----------------------+------------------------+----------------+--------+--------+
| ISBN | Title | Author | Avail | Total |
+----------------------+------------------------+----------------+--------+--------+
| 978-7-111-40701-0 | Computer Systems | Randal E. Bryant| 3 | 5 |
| 978-7-302-33227-9 | C++ Primer Plus | Stephen Prata | 2 | 3 |
+----------------------+------------------------+----------------+--------+--------+
+--------+----------------------+------------------------+--------------+--------------+
| Rec ID | ISBN | Title | Borrow Date | Due Date |
+--------+----------------------+------------------------+--------------+--------------+
| 1 | 978-7-111-40701-0 | Computer Systems | 2025-03-01 | 2025-03-31 |
+--------+----------------------+------------------------+--------------+--------------+
libraryManagementSystem/
├── CMakeLists.txt # CMake build configuration
├── cmake/
│ └── Windows-x86.cmake # Windows cross-compilation toolchain
├── header/
│ ├── database.h # Database manager class declaration
│ ├── logger.h # Logger class for system logging
│ ├── sha256.h # SHA-256 encryption header
│ ├── utils.h # Utility functions (clear screen, terminal width, etc.)
│ └── localization.h # Localization and language switching functionality
├── src/
│ ├── main.cpp # Program entry point and UI logic
│ ├── database.cpp # Database operations implementation
│ ├── logger.cpp # Logger implementation
│ ├── logging_functions.cpp # Log query functions
│ └── sha256.cpp # SHA-256 encryption implementation
├── api-server/ # Node.js Express API server
│ ├── server.js # API server implementation
│ ├── package.json # Node.js dependencies
│ └── README.md # API server documentation
├── webui/ # Vue 3 WebUI (updated to white theme)
│ ├── src/
│ │ ├── api/ # API service layer
│ │ ├── views/ # Vue components and pages
│ │ ├── router/ # Vue Router configuration
│ │ ├── store/ # Pinia state management
│ │ └── plugins/ # Vue plugins (i18n, etc.)
│ ├── package.json # Frontend dependencies
│ └── vite.config.ts # Vite configuration
├── build/ # Build output directory
└── docs/
├── README_zh-CN.m