Skip to content

codingburgas/LogicPro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


       __        __  ___   ____  
      / /       /  |/  /  / ___| 
     / /       / /|_/ /   \___ \ 
    / /___    / /  / /     ___) |
   /_____|   /_/  /_/     |____/ 
                                 
   >— — — — — — — — — — — — — — — <
             LOGIC PRO v1.0

Library Management System - a minimalist desktop application for library management with a dark GUI powered by Raylib.


C++ Raylib CMake Windows License


What is this

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.

Quick Start

Requirements

Windows

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.exe

macOS

brew install raylib cmake
git clone https://github.com/YOUR_USERNAME/library-app.git
cd library-app && make
./library

Linux (Ubuntu/Debian)

sudo apt update && sudo apt install libraylib-dev cmake build-essential
git clone https://github.com/YOUR_USERNAME/library-app.git
cd library-app && make
./library

Note: On the first build on Windows, CMake will download Raylib (~5 MB) from GitHub. Subsequent builds work offline.


Default Credentials

Role Login Password
Administrator admin 12345
User registration your choice

Features

Administrator Mode

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

User Mode

View Books
  └── Filter by: author / genre / date / title

Borrow a Book
  └── Return period — 7 days

My Bills
  └── View accrued fines with the total amount

Project Structure

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

Design

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

Architecture

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

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

Contributing

  1. Fork the repository
  2. Create a branch: git checkout -b feature/my-feature
  3. Commit: git commit -m 'Add my feature'
  4. Push: git push origin feature/my-feature
  5. Open Pull Request

License

MIT License — do whatever you want, mention the author.

Made with ☕ and Raylib

About

Library Management System - a minimalist desktop application for library management with a dark GUI powered by Raylib.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 97.5%
  • C 1.4%
  • Makefile 1.1%