Skip to content

Commit 92d7e77

Browse files
Merge pull request #174 from erikdarlingdata/feature/web-blazor-wasm
Add web-based plan analysis via Blazor WASM (#2)
2 parents fbb182b + 4e263d4 commit 92d7e77

File tree

128 files changed

+1686
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1686
-0
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,23 @@ jobs:
1818
with:
1919
dotnet-version: 8.0.x
2020

21+
- name: Install WASM workload
22+
run: dotnet workload install wasm-tools
23+
2124
- name: Restore dependencies
2225
run: |
2326
dotnet restore src/PlanViewer.Core/PlanViewer.Core.csproj
2427
dotnet restore src/PlanViewer.App/PlanViewer.App.csproj
2528
dotnet restore src/PlanViewer.Cli/PlanViewer.Cli.csproj
29+
dotnet restore src/PlanViewer.Web/PlanViewer.Web.csproj
2630
dotnet restore tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj
2731
2832
- name: Build all projects
2933
run: |
3034
dotnet build src/PlanViewer.Core/PlanViewer.Core.csproj -c Release --no-restore
3135
dotnet build src/PlanViewer.App/PlanViewer.App.csproj -c Release --no-restore
3236
dotnet build src/PlanViewer.Cli/PlanViewer.Cli.csproj -c Release --no-restore
37+
dotnet build src/PlanViewer.Web/PlanViewer.Web.csproj -c Release --no-restore
3338
dotnet build tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj -c Release --no-restore
3439
3540
- name: Run tests

.github/workflows/deploy-web.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy Web App
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'src/PlanViewer.Core/**'
8+
- 'src/PlanViewer.Web/**'
9+
- '.github/workflows/deploy-web.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: true
20+
21+
jobs:
22+
deploy:
23+
runs-on: ubuntu-latest
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Setup .NET 8.0
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: 8.0.x
35+
36+
- name: Install WASM workload
37+
run: dotnet workload install wasm-tools
38+
39+
- name: Publish Blazor WASM
40+
run: dotnet publish src/PlanViewer.Web/PlanViewer.Web.csproj -c Release -o publish
41+
42+
- name: Add .nojekyll
43+
run: touch publish/wwwroot/.nojekyll
44+
45+
- name: Add CNAME
46+
run: echo 'plans.erikdarling.com' > publish/wwwroot/CNAME
47+
48+
- name: Add 404 fallback
49+
run: cp publish/wwwroot/index.html publish/wwwroot/404.html
50+
51+
- name: Upload Pages artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: publish/wwwroot
55+
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

PlanViewer.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlanViewer.App", "src\PlanV
1111
EndProject
1212
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlanViewer.Cli", "src\PlanViewer.Cli\PlanViewer.Cli.csproj", "{1504CE29-3CBF-4F0B-A46E-54644946B8ED}"
1313
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlanViewer.Web", "src\PlanViewer.Web\PlanViewer.Web.csproj", "{B2D3F7A1-8C4E-4F5A-9D6B-1E2F3A4B5C6D}"
15+
EndProject
1416
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{A06217BE-DBE2-47D0-BD59-93F2108D447C}"
1517
EndProject
1618
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlanViewer.Core.Tests", "tests\PlanViewer.Core.Tests\PlanViewer.Core.Tests.csproj", "{399A69AD-0CD1-4E9B-9988-E94882B827E6}"
@@ -40,11 +42,16 @@ Global
4042
{399A69AD-0CD1-4E9B-9988-E94882B827E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
4143
{399A69AD-0CD1-4E9B-9988-E94882B827E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
4244
{399A69AD-0CD1-4E9B-9988-E94882B827E6}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{B2D3F7A1-8C4E-4F5A-9D6B-1E2F3A4B5C6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{B2D3F7A1-8C4E-4F5A-9D6B-1E2F3A4B5C6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{B2D3F7A1-8C4E-4F5A-9D6B-1E2F3A4B5C6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{B2D3F7A1-8C4E-4F5A-9D6B-1E2F3A4B5C6D}.Release|Any CPU.Build.0 = Release|Any CPU
4349
EndGlobalSection
4450
GlobalSection(NestedProjects) = preSolution
4551
{8904045D-E083-4010-A320-104B7466C044} = {21F75D2E-F228-49B3-825F-43F621760061}
4652
{F1018F88-B289-40CE-852A-56478DFBA91E} = {21F75D2E-F228-49B3-825F-43F621760061}
4753
{1504CE29-3CBF-4F0B-A46E-54644946B8ED} = {21F75D2E-F228-49B3-825F-43F621760061}
54+
{B2D3F7A1-8C4E-4F5A-9D6B-1E2F3A4B5C6D} = {21F75D2E-F228-49B3-825F-43F621760061}
4855
{399A69AD-0CD1-4E9B-9988-E94882B827E6} = {A06217BE-DBE2-47D0-BD59-93F2108D447C}
4956
EndGlobalSection
5057
EndGlobal

src/PlanViewer.Web/App.razor

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
4+
</Found>
5+
<NotFound>
6+
<LayoutView Layout="@typeof(Layout.MainLayout)">
7+
<p>Page not found.</p>
8+
</LayoutView>
9+
</NotFound>
10+
</Router>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@inherits LayoutComponentBase
2+
3+
<header>
4+
<div class="header-content">
5+
<img src="darling-data-logo.png" alt="Erik Darling Data" class="header-logo" />
6+
<span class="header-divider"></span>
7+
<span class="header-title">Performance Studio</span>
8+
</div>
9+
</header>
10+
11+
<main>
12+
<ErrorBoundary>
13+
<ChildContent>
14+
@Body
15+
</ChildContent>
16+
<ErrorContent>
17+
<p class="error-message">Something went wrong. Please refresh the page and try again.</p>
18+
</ErrorContent>
19+
</ErrorBoundary>
20+
</main>
21+
22+
<footer>
23+
<a href="https://www.erikdarling.com" target="_blank" rel="noopener">erikdarling.com</a>
24+
<span class="footer-sep">&middot;</span>
25+
<a href="https://github.com/erikdarlingdata/PerformanceStudio" target="_blank" rel="noopener">GitHub</a>
26+
</footer>

0 commit comments

Comments
 (0)