GithubHelp home page GithubHelp logo

davidajohn / bookwormslendinglibrary Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 3.0 1.85 MB

Blazor Server client UI with a .NET Web API backend for an imaginary online library.

Home Page: https://bookwormslibrary.azurewebsites.net

C# 65.13% HTML 32.26% CSS 2.61%
blazor dotnet webapi blazor-server library books webapi-2 dotnet-core dotnet-core-webapi bunit

bookwormslendinglibrary's People

Contributors

davidajohn avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bookwormslendinglibrary's Issues

Search box only works first time

If a user types into the search box in the navbar at the top of the page and submits it, the results are shown the first time, but if the input is changed and the user re-submits with another button click, the search results are not updated, despite the URL changing.

This appears to be a choice that the Blazor framework is making not to re-render the page. Is there a way to change this?

Bootstrap 5 upgrade

By default, Blazor projects include Bootstrap 4 - which is ironic, given how many dotnet developers seem to be pathologically opposed to using JavaScript.

Once Bootstrap 5 is out of beta, it may be worth updating it in the UI project.

It would mean removing any jQuery references and replacing them with native JavaScript. That probably only affects the carousel on the home page.

There's also a new set of native icons available.

Changes to layout and design

I would really like to make this not look like a 'Blazor' app if possible.

Every Blazor site seems to looks the same - with the red/blue graduated fade on the left-hand nav menu. Probably because most Blazor apps are being built by developers who are trying to demonstrate a technical aspect of the framework, rather than spending time making it look nice. There's no rule saying you can't remove that menu though, right?

I'm going to try using the layout from the built-in identity pages (not visible in this application) that are generated if you enable authentication on a Blazor app when you create it. Just need to add some colour and remove the jQuery references.

There are certain to be complications with this.

Replace Moq with NSubstitute in unit tests

Apart from the recent controversy with Moq, I prefer using NSubstitute anyway, so I'm going to remove Moq and re-write the unit tests in the API project to work with NSubstitute (and FluentAssertions).

Add unit/integration tests to the API

The API is quite complex at this point, although there aren't a huge number of entities and controllers.

There is definitely a need to add unit and integration tests.

[Bug] JS Interop error when admin and account pages are refreshed

The Account/Index page and the Admin/Index page both display JS Interop errors if the user hits refresh in their browser, although the data is displayed correctly on page load.

It seems to be an issue with pre-rendering.

I'm tempted to just say "don't hit refresh on a single page app", but let's see if something can be done, because it looks pretty ugly.

Add an inventory system?

Although this application was originally intended to be pretty straightforward and was never meant to be used in a real life production environment, it would be interesting to try to extending its capabilities, and perhaps get it a little closer to being a usable application.

The most obvious missing part is an inventory system that would allow library admins to keep track of multiple copies of a book, to keep track of its age and condition and maybe even have a barcode/QR code that could be generated and theoretically stuck on to the inside cover.

This is something I'm giving some serious thought to now, and hopefully will be working on in early 2023.

New admin function: De-activate/re-active books, authors or categories

At the moment, although admins can edit books and authors (and add new ones), there should also be a way to hide specific books, categories or authors from the search pages.

Of course, it should also be possible to subsequently re-activate them as well. for a category or specific book this should be reasonably simple, but de-activating an author would also involve de-activating their books as well (and vice versa).

.NET 8 Update

So .NET 8 has now arrived and it offers some possibilities for restructuring existing Blazor applications that were created using either a Server or WebAssembly approach.

It's obviously possible to just update the libraries to their .NET 8 versions without restructuring, but it's worth considering any possible benefits or drawbacks of using things like the new render modes.

Here's the Microsoft guide to updating a Server app to .NET 8:

Update a Blazor Server app

Update UI styling/colours

I don't have any firm ideas on this at the moment, but I would like to update the design. particularly the colour scheme - which is rather bland.

As much as I love Tailwind, I'll probably stick with Bootstrap instead for the time being, just to keep things simpler.

Update to .NET 6

Both projects in the application are currently still using .NET 5.

Let's update them to .NET 6 instead.

Add unit tests to the UI

As well as needing tests in the API, there is a Blazor testing library called bUnit that could be used to add unit tests to the UI project.

You can find bUnit here.

API caching

At the moment, there is no caching in the API.

It's not strictly necessary here, but would obviously be a useful feature for a site that became more popular.

Latest Additions & Most Popular navbar links problem

If a user is already on the main books page, the navbar links to 'Latest Additions' and 'Most Popular' do not update the page, although the browser's URL changes.

This is because the Blazor router doesn't recognise that the page needs to be re-rendered if querystrings are used.

To get around this, the books page would need to be changed to look for parameters divided by forward slashes instead. An OnParametersSetAsync method can then be added to respond to the changing values.

Adding a message queue/broker

As part of adding an inventory system to the application (eventually!) I'd like to have a message queue available, so that lending requests and admin changes to the inventory can be processed in a more de-coupled manner.

That would allow us to potentially set up additional things like email notifications to users when their lending request is authorised, or if the status of a book or author changes.

There are a few different options for doing this. I would prefer to use a separate third-party cloud service to do it, rather than necessitating the use of a docker container for RabbitMQ (or similar) during development.

So the options I'm considering are: AWS SQS/SNS, Azure Service Bus, or CloudAMQP.

Ideally, the initially cost would be zero (or close to it), with the ability to easily ramp up capacity if needed. All three options are effectively free up to 1 million requests a month - Service Bus costs £0.03 on the Basic tier - if you're using a simple queue without topics or a publisher/subscriber model.

The costs can differ though if you want to use topics and subscriptions. This application would probably need to use a pub/sub model. It depends on whether the features being added generate sufficient complexity to warrant using a library like MassTransit (which tends to assume use of topics and pub-sub).

Although just setting up separate queues and using the native SDKs for AWS or Azure could be good enough as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.