Skip to content

Commit

Permalink
Replace Server Interactivity with WebAssembly (#1)
Browse files Browse the repository at this point in the history
Blazor InteractiveServer render mode proved to be unpractical for mobile users especially. Rearchitected the project to use InteractiveWebAssembly mode for the Game page. The client-side GameContext uses a SignalR connection to the backend.

This also removes MassTransit as a messaging backend. Let's worry about scaling beyond a single worker process later.
  • Loading branch information
martijn authored Jun 20, 2024
1 parent 84440af commit 3fab708
Show file tree
Hide file tree
Showing 70 changed files with 1,192 additions and 544 deletions.
20 changes: 0 additions & 20 deletions Components/App.razor

This file was deleted.

79 changes: 0 additions & 79 deletions Components/Pages/Game.razor

This file was deleted.

6 changes: 0 additions & 6 deletions Components/Routes.razor

This file was deleted.

17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Adjust DOTNET_OS_VERSION as desired
ARG DOTNET_SDK_VERSION=8.0
ARG DOTNET_SDK_VERSION=9.0-preview

FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_SDK_VERSION}-alpine AS build
RUN dotnet workload install wasm-tools
WORKDIR /src

# tailwind install
Expand All @@ -16,19 +17,25 @@ RUN set -ex; \
chmod +x tailwindcss; \
ls -al tailwindcss ;

RUN apk add python3

# restore
COPY *.csproj .
RUN dotnet restore -r linux-musl-amd64 -p:PublishReadyToRun=true
COPY *.sln .
COPY PointingParty/PointingParty.csproj PointingParty/PointingParty.csproj
COPY PointingParty.Client/PointingParty.Client.csproj PointingParty.Client/PointingParty.Client.csproj
COPY PointingParty.Client.Tests/PointingParty.Client.Tests.csproj PointingParty.Client.Tests/PointingParty.Client.Tests.csproj
COPY PointingParty.Domain/PointingParty.Domain.csproj PointingParty.Domain/PointingParty.Domain.csproj
RUN dotnet restore

# copy everything
COPY . ./

# tailwind build
RUN set -ex; \
./tailwindcss -i wwwroot/app.css -o wwwroot/app.min.css --minify && rm wwwroot/app.css
./tailwindcss -i PointingParty/wwwroot/app.css -o PointingParty/wwwroot/app.min.css --minify && rm PointingParty/wwwroot/app.css

# build
RUN dotnet publish --no-restore -c Release -r linux-musl-amd64 -p:PublishReadyToRun=true -o /app
RUN dotnet publish --no-restore -c Release -o /app PointingParty

# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_SDK_VERSION}-alpine
Expand Down
3 changes: 0 additions & 3 deletions Domain/Events/GameReset.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Domain/Events/IGameEvent.cs

This file was deleted.

3 changes: 0 additions & 3 deletions Domain/Events/VotesShown.cs

This file was deleted.

44 changes: 0 additions & 44 deletions Infrastructure/DebugConsumer.cs

This file was deleted.

46 changes: 0 additions & 46 deletions Infrastructure/EventHub.cs

This file was deleted.

85 changes: 0 additions & 85 deletions Infrastructure/GameContext.cs

This file was deleted.

Loading

0 comments on commit 3fab708

Please sign in to comment.