BlazorGraphQL logo

BlazorGraphQL – My Library & Anti-Library

A classical-styled Blazor Server app that tracks both the books I’ve read (Library) and those that fuel future curiosity (Anti-Library).

Project at a Glance

RoleFull-stack Dev & Designer
Stack.NET 9 Blazor Server · GraphQL (HotChocolate) · EF Core + SQLite · Bootstrap 5
Key FeaturesGraphQL queries & mutations · Responsive nav with hamburger menu · Parchment theme
TimelineMay – June 2025 (nights & weekends)

Screenshots

Home page screenshot
Home – Featured book & Taleb quote
Books grid screenshot
Books grid – category & status badges
About page screenshot
About – tech stack & philosophy

Under the Hood

  • GraphQL over REST – single endpoint, zero over-fetching.
  • EF Core + SQLite – lightweight & auto-migrating DB.
  • Progress tracking – fractional values rendered as clamped percentage bars.
  • Blazor-driven hamburger – collapse/expand with pure C#.
  • Greco-Roman bookend branding – logo + favicon for cohesive identity.

📜 Code Samples

Declares the Book C# POCO with a primary key

Book model snippet

Declares the Book C# POCO with a primary key and required properties (Title, Author, etc.), including default values, to serve as both your EF Core entity and the data shape for GraphQL serialization and deserialization.

AddNewBook() method

AddNewBook snippet

Defines the AddNewBook() method that builds a GraphQL mutation payload from the newBook form model (including clamping and converting the progress value), posts it to the /graphql endpoint, then resets the form and reloads the book list on success.

OnInitializedAsync lifecycle method

FetchBooks.razor snippet

Shows the OnInitializedAsync lifecycle method calling LoadBooks(), which constructs and sends a GraphQL query to fetch the list of books, deserializes the response into your GraphQLResponse/BooksData classes, and populates the books list for rendering in the UI.

GraphQL “mutation” resolver class

BookMutation.cs snippet

Contains the GraphQL “mutation” resolver class, exposing AddBookAsync() to create and save a new Book entity and DeleteBookAsync() to remove a book by ID—each method interacting with EF Core’s AppDbContext to persist changes.

GraphQL query resolver class logic
BookQuery.cs snippet Implements the GraphQL “query” resolver class using HotChocolate, with GetBooks() exposing an IQueryable (complete with [UseProjection], [UseFiltering], [UseSorting]) and SearchBooksAsync() for client-driven text searches on title or author.

Coming Next

  • Authentication for personal libraries
  • Tagging & faceted search
  • Reading-streak analytics & charts
  • Public demo on Azure App Service

Let’s Talk

Have questions about Blazor, GraphQL, or educational apps?
Feel free to reach out—always happy to chat!

📧 Email Me 🔗 LinkedIn