johnmcraig / blazor-book-manager

Manage books and authors with Blazor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blazor Book Manager

visitors stars last commit pull requests

A way to manage books as a web application using Blazor WASM

Scope

A full-stack web application to manage books and their authors with clean architecture using C#/.Net Core, Blazor, Dapper & SQL, HTML, and CSS.

Architecture

This application uses hexagonal/onion style architecture for separation of core functionality and modularity to use or try out different technologies as it grows in scope.

The key projects are contained within the Core, Infrastructure, and Api projects with the client within the UI directory.

Technologies

The application was built using:

  • ASP.Net Core 3.1
  • Blazor WebAssembly (Client)
  • SQL + Dapper for database transactions
  • Bootstrap 4

Additional Built-in Tools

The API project contains the following:

  • Swagger - Api/resource documentation testing from the Swashbuckler package for the client.

  • NLog - for logging request from the Api and any additional errors that are saved as text documents for review.

Database Setup

For database setup, it is recommended to use Sqlite for development and is currently an installed package with the application. Navigate to the Infrastructure project and find the ApiDbContext.cs class in the ..\Data directory and find the method that configures which database to use:

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
    optionsBuilder.UseSqlite(_config.GetConnectionString("sqlite"));
}

Change the above optionsBuilder method to which ever database package you prefer, such as MySql with: .UseMySql(). Configure the connection to that database in the appsettings.Development.json file in the Api project, then pass it in the GetConnectionString extension.

PostgreSQL is also already setup for database configuration, change the optionsBuilder method to use .UseNpgsql() and setup the connection string in the application.Development.json file.

Future Features

The Book Store does not yet contain login/logout, registration, and authentication, but will be needed once the project grows in scope to actually sell books online.

Paging is currently in the pipeline and should be implemented within the year (maybe...).

About

Manage books and authors with Blazor


Languages

Language:C# 66.2%Language:HTML 28.3%Language:CSS 3.2%Language:JavaScript 2.3%