@page "/" @using LibraryManagement.Shared.Models @using BlazorWebAssembly.Services @using Microsoft.AspNetCore.Components.Authorization @inject LibraryApiClient ApiClient @inject NavigationManager Navigation @inject AuthenticationStateProvider AuthStateProvider

Welcome back, @context.User.Identity?.Name

Here is what's happening with your library account today.

Total Books
@_totalBooks
Active Loans
@_activeLoans
Overdue
@_overdueLoans
Active Members
@_totalMembers

Loyalty Balance

@(_loyaltyAccount?.CurrentBalance.ToString("N0") ?? "0")

POINTS
Tier: @(_loyaltyAccount?.Tier ?? "Member")

Current Loans

@_activeLoans

@if (_overdueLoans > 0) { @_overdueLoans Overdue } else { Healthy }

Membership

@(_currentSub?.MembershipType ?? "Free")

@( _currentSub != null ? "Active Status" : "No Active Plan" )

Manage Plan

Recent Arrivals

@if (_recentBooks.Any()) { } else {
Loading recent arrivals...
}
New: Audiobooks Collection Now Live

Where Every Page
Finds a Purpose.

Join the next generation of readers in a digital-first library experience. Access thousands of titles, earn loyalty rewards, and track your progress seamlessly.

12k+

Verified Books

5.2k

Active Readers

98%

Satisfaction

24/7

Digital Access

Core Ecosystem

Everything you need to
master your reading journey.

Borrow Thousands

Access our vast physical and digital catalog with a single click. No more waiting in lines.

Track Reading

Visualize your reading habits with detailed analytics and personal dashboards.

Stay Notified

Never miss a due date with Firebase-powered instant renewal notifications.

Earn Loyalty

Collect points for every interaction and redeem them for premium membership tiers.

Wall of Praise

Loved by
modern readers.

Don't just take our word for it. Join thousands of satisfied members who have transformed their reading habits.

@for(int i=1; i<=4; i++) {
U@i
}
5,000+ Active Members Global Community
@for(int i=0; i<5; i++) { }

"The loyalty system is a game changer. I've earned three months of free premium just by returning my books on time!"

SC
Sarah Chen

Gold Member

"Finally a library system that feels like it belongs in 2026. The interface is stunning and the notifications are so helpful."

JM
James Miller

Active Reader

Ready to start your
next chapter?

Join thousands of readers today and get your first month of Premium for free.

@code { private int _totalBooks = 0; private int _activeLoans = 0; private int _overdueLoans = 0; private int _totalMembers = 0; private IEnumerable _recentBooks = Enumerable.Empty(); private LoyaltyAccountDto? _loyaltyAccount; private SubscriptionDto? _currentSub; private bool _isLoading = true; protected override async Task OnInitializedAsync() { try { var authState = await AuthStateProvider.GetAuthenticationStateAsync(); var user = authState.User; if (user.Identity?.IsAuthenticated == true) { var books = await ApiClient.GetBooksAsync(); _totalBooks = books.Count(); _recentBooks = books.Take(6); if (user.IsInRole("Member")) { try { var borrowings = await ApiClient.GetMyBorrowingsAsync(); _activeLoans = borrowings.Count(b => b.Status == "Borrowed"); _overdueLoans = borrowings.Count(b => b.Status == "Overdue" || (b.Status == "Borrowed" && b.DueDate < DateTime.UtcNow)); _loyaltyAccount = await ApiClient.GetMyLoyaltyAccountAsync(); _currentSub = await ApiClient.GetMySubscriptionAsync(); } catch {} } if (user.IsInRole("Librarian")) { try { var allBorrowings = await ApiClient.GetAllBorrowingsAsync(); _activeLoans = allBorrowings.Count(b => b.Status == "Borrowed"); _overdueLoans = allBorrowings.Count(b => b.Status == "Overdue" || (b.Status == "Borrowed" && b.DueDate < DateTime.UtcNow)); var members = await ApiClient.GetUsersAsync(); _totalMembers = members.Count(); } catch {} } } } catch { } finally { _isLoading = false; } } }