Skip to content

About

A Windows Forms library management system built with .NET 9, MySQL, and ML.NET — featuring role-based auth, lending workflows, reports, audit logs, and personalized book recommendations.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Library Management System

A Windows Forms library management application built with .NET 9, MySQL, and ML.NET. The system supports role-based login, book and member management, lending workflows, reporting, audit logs, and personalized book recommendations.

Features

  • Role-based authentication for Admin, Librarian, and Member users.
  • Book catalog management with authors, genres, ISBN, availability, copy counts, publisher, location, and search.
  • Member management with contact details, membership dates, active status, and outstanding fines.
  • Lending workflow for borrowing, returning, overdue tracking, due dates, and fine visibility.
  • Reports for inventory, lending history, fines, and popular books, with CSV export.
  • Authentication audit logs for login, logout, failed login, password changes, registration, and expired sessions.
  • Personalized recommendations using ML.NET matrix factorization, with a content-based fallback when training data is insufficient.
  • First-run database creation and sample data seeding.

Tech Stack

  • .NET 9 Windows Forms
  • C#
  • MySQL
  • MySql.Data
  • ML.NET and ML.NET Recommender
  • MSTest, Moq, and coverlet for tests

Project Structure

LibraryManagementSystem/
  Auth/        Authentication and session handling
  Data/        MySQL connection, schema initialization, and repositories
  Forms/       Windows Forms screens
  Models/      Domain models, roles, and permissions
  Services/    Recommendation service
  Utils/       Dashboard, theme, sidebar, and notification helpers

LibraryManagementSystemTests/
  IntegrationTests/
  ModelTests/
  RepositoryTests/
  ServiceTests/

Requirements

  • Windows
  • .NET 9 SDK
  • MySQL Server running locally or reachable from the application
  • Visual Studio 2022 or JetBrains Rider is recommended for WinForms development

Database Setup

The application creates the library_management database and required tables on startup if they do not exist. It also seeds roles, sample books, members, lending history, and default login accounts.

Before running, update the MySQL connection strings in:

LibraryManagementSystem/Data/DatabaseConnection.cs

The current code expects a MySQL server and a user that can create databases, tables, indexes, and seed data.

Default Accounts

These accounts are inserted when the database is initialized and no admin user exists:

Role Username Password
Admin admin admin123
Librarian librarian librarian123
Member member member123

Sample seeded members use password123.

Running the Application

Restore and build the solution:

dotnet restore
dotnet build LibraryManagementSystem.sln

Run the WinForms application:

dotnet run --project LibraryManagementSystem/LibraryManagementSystem.csproj

You can also open LibraryManagementSystem.sln in an IDE and start the LibraryManagementSystem project.

Running Tests

Use the provided batch file:

.\RunTests.bat

Or run the test project directly:

dotnet test LibraryManagementSystemTests/LibraryManagementSystemTests.csproj

Some integration tests may require a working MySQL setup that matches the application connection settings.

Notes

  • The database credentials are currently configured in source code. Move them to configuration or environment variables before deploying or sharing production credentials.
  • The application targets net9.0-windows and requires Windows Forms support.
  • User Management and System Settings are present in the navigation for admins, but the main form currently shows "Coming Soon" messages for those entries.

About

A Windows Forms library management system built with .NET 9, MySQL, and ML.NET — featuring role-based auth, lending workflows, reports, audit logs, and personalized book recommendations.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages