__ __ ___ ____
/ / / |/ / / ___|
/ / / /|_/ / \___ \
/ /___ / / / / ___) |
/_____| /_/ /_/ |____/
>— — — — — — — — — — — — — — — <
LOGIC PRO v1.0
Library Management System - a minimalist desktop application for library management with a dark GUI powered by Raylib.
A full-fledged library management system with a graphical user interface. Written in C++17 using Raylib 5.0. No browsers, no Electron — a native binary that launches instantly. It features two user roles, a full lifecycle for book management, and a fine system for overdue returns.
- CMake 3.16+
- Visual Studio 2022 Build Tools (Windows)
or
gcc/clang(Linux/macOS) - Internet connection for the first build (CMake will download Raylib automatically)
git clone https://github.com/YOUR_USERNAME/library-app.git
cd library-app
mkdir build && cd build
cmake .. -G "Visual Studio 17 2022" -DCMAKE_POLICY_VERSION_MINIMUM=3.5
cmake --build . --config Release
Release\library.exebrew install raylib cmake
git clone https://github.com/YOUR_USERNAME/library-app.git
cd library-app && make
./librarysudo apt update && sudo apt install libraylib-dev cmake build-essential
git clone https://github.com/YOUR_USERNAME/library-app.git
cd library-app && make
./libraryNote: On the first build on Windows, CMake will download Raylib (~5 MB) from GitHub. Subsequent builds work offline.
| Role | Login | Password |
|---|---|---|
| Administrator | admin |
12345 |
| User | registration | your choice |
Catalog Management
├── Add a book (title, author, genre, date)
├── Delete a book (with confirmation)
└── View catalog (with filters)
Archive
└── History of all issued and deleted books
Fine System
├── Assign fine to a user
├── Calculation: 5 Euro × number of overdue days
└── Automatic bill creation
View Books
└── Filter by: author / genre / date / title
Borrow a Book
└── Return period — 7 days
My Bills
└── View accrued fines with the total amount
library/
│
├── CMakeLists.txt # Build (automatically downloads Raylib)
├── Makefile # Alternative for Linux/macOS
│
├── include/
│ ├── types.h # Data structures: Book, User, Bill, AppState
│ ├── ui.h # UI primitives: buttons, input fields, toasts
│ ├── logic.h # Business logic: login, search, fines
│ └── screens.h # Declarations of all screens
│
└── src/
├── main.cpp # Entry point, game loop, screen routing
├── ui.cpp # Implementation of UI components
├── creens.cpp # All application screens
└── logic.cpp # Implementation of business logic
UI Components:
- Input fields with a blinking cursor and password masking (*)
- Hover effects on all buttons
- Toast notifications with smooth fade-out
- Mouse wheel scrolling in lists
- Confirmation button before deleting a book
The application is built as a Finite State Machine (FSM):
MAIN_MENU
├── LOGIN ──────────► USER_MENU ──► SHOW_BOOKS
│ ├──► TAKE_BOOK
│ └──► BILLS
│
└── LOGIN ──────────► ADMIN_MENU ──► ADD_BOOK
├──► DELETE_BOOK
├──► SHOW_BOOKS
├──► ARCHIVE
└──► CALCULATE_FINE
Each screen is a separate function in screens.cpp. Switching screens is done by changing AppState::currentScreen. All state is stored in a single AppState struct, with no global variables.
fine formula is:
int CalculateFine(int days) {
if (days <= 0) return 0;
return 5 + CalculateFine(days - 1);
}
// 1 day = 5 Euro, 5 days = 25 Euro, 10 days = 50 Euro- Fork the repository
- Create a branch:
git checkout -b feature/my-feature - Commit:
git commit -m 'Add my feature' - Push:
git push origin feature/my-feature - Open Pull Request
Made with ☕ and Raylib