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.
- 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.
- .NET 9 Windows Forms
- C#
- MySQL
- MySql.Data
- ML.NET and ML.NET Recommender
- MSTest, Moq, and coverlet for tests
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/
- Windows
- .NET 9 SDK
- MySQL Server running locally or reachable from the application
- Visual Studio 2022 or JetBrains Rider is recommended for WinForms development
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.
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.
Restore and build the solution:
dotnet restore
dotnet build LibraryManagementSystem.slnRun the WinForms application:
dotnet run --project LibraryManagementSystem/LibraryManagementSystem.csprojYou can also open LibraryManagementSystem.sln in an IDE and start the LibraryManagementSystem project.
Use the provided batch file:
.\RunTests.batOr run the test project directly:
dotnet test LibraryManagementSystemTests/LibraryManagementSystemTests.csprojSome integration tests may require a working MySQL setup that matches the application connection settings.
- 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-windowsand 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.