feat: Convert website from static HTML to .NET 9.0 Blazor Web App

Major architectural upgrade from static HTML site to modern Blazor Web App:

- Migrated to .NET 9.0 Blazor Web App framework
- Converted home page with 4 gateway cards (Help Desk, App Store, Cloud, SDK)
- Added new SDK card linking to comprehensive SDK documentation
- Converted SDK documentation page to Blazor component
- Updated template download links to nuget.silverlabs.uk repository
- Implemented multi-stage Docker build with .NET SDK 9.0
- Created Blazor-optimized nginx configuration
- Preserved all original styling and animations
- Added .gitignore for Blazor build artifacts

Technical changes:
- New BlazorApp/ project structure with Components architecture
- MainLayout simplified (no default navigation)
- CSS ported to wwwroot (styles.css + sdk-styles.css)
- Multi-stage Dockerfile: Build with dotnet SDK, serve with nginx
- GitLab CI/CD pipeline compatible (auto-detects new Dockerfile)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-20 19:11:53 +01:00
parent a7fd925187
commit 3aa191cd3d
75 changed files with 60705 additions and 676 deletions

View File

@@ -0,0 +1,19 @@
@page "/counter"
@rendermode InteractiveServer
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}

View File

@@ -0,0 +1,36 @@
@page "/Error"
@using System.Diagnostics
<PageTitle>Error</PageTitle>
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
@code{
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
private string? RequestId { get; set; }
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
protected override void OnInitialized() =>
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
}

View File

@@ -0,0 +1,66 @@
@page "/"
<PageTitle>SilverLabs - Innovation Gateway</PageTitle>
<div class="main-content visible">
<header class="header">
<img src="logo.png" alt="SilverLabs Logo" class="logo">
</header>
<main class="main">
<h1 class="title">Welcome to SilverLabs</h1>
<p class="subtitle">Your Innovation Gateway</p>
<div class="gateway-grid">
<a href="https://helpdesk.silverlabs.uk" class="gateway-card">
<div class="card-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
</div>
<h2 class="card-title">Help Desk</h2>
<p class="card-description">Support & Assistance</p>
</a>
<a href="https://appstore.silverlabs.uk" class="gateway-card">
<div class="card-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="7" height="7"></rect>
<rect x="14" y="3" width="7" height="7"></rect>
<rect x="14" y="14" width="7" height="7"></rect>
<rect x="3" y="14" width="7" height="7"></rect>
</svg>
</div>
<h2 class="card-title">App Store</h2>
<p class="card-description">Applications & Tools</p>
</a>
<a href="https://cloud.silverlabs.uk" class="gateway-card">
<div class="card-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"></path>
</svg>
</div>
<h2 class="card-title">Cloud</h2>
<p class="card-description">Storage & Collaboration</p>
</a>
<a href="/sdk" class="gateway-card">
<div class="card-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="16 18 22 12 16 6"></polyline>
<polyline points="8 6 2 12 8 18"></polyline>
</svg>
</div>
<h2 class="card-title">SDK</h2>
<p class="card-description">Developer Resources</p>
</a>
</div>
</main>
<footer class="footer">
<p>&copy; 2025 SilverLabs. All rights reserved.</p>
</footer>
</div>

View File

@@ -0,0 +1,253 @@
@page "/sdk"
<PageTitle>SilverSHELL SDK - SilverLabs</PageTitle>
<div class="main-content visible">
<header class="header">
<img src="../logo.png" alt="SilverLabs Logo" class="logo">
</header>
<div class="sdk-container">
<div class="sdk-header">
<h1>SilverSHELL SDK</h1>
<p style="font-size: 1.2rem; color: rgba(255, 255, 255, 0.7);">Build modular Blazor WebAssembly applications with ease</p>
</div>
<!-- Quick Start Section -->
<div class="sdk-section">
<h2>🚀 Quick Start</h2>
<p>Get started with SilverSHELL in just a few minutes. Follow these simple steps:</p>
<ol class="steps-list">
<li>
<strong>Download the templates</strong> (see downloads below)
</li>
<li>
<strong>Extract the templates</strong> to a directory of your choice
</li>
<li>
<strong>Install the templates</strong>
<div class="code-block"><code>dotnet new install ./path/to/SilverSHELL.Starter.Template
dotnet new install ./path/to/SilverSHELL.AppModule.Template</code></div>
</li>
<li>
<strong>Create your first project</strong>
<div class="code-block"><code>dotnet new silvershell-starter -n MyApp --pwa true --module-repository true
cd MyApp
dotnet run</code></div>
</li>
<li>
<strong>Access your application</strong> at <code>https://localhost:5001</code>
</li>
</ol>
</div>
<!-- Downloads Section -->
<div class="sdk-section">
<h2>📦 Downloads</h2>
<p>Download the SilverSHELL project templates to get started:</p>
<div class="download-grid">
<div class="download-card">
<h3>Starter Template</h3>
<p>Create a new SilverSHELL application with minimal configuration</p>
<p><strong>Size:</strong> 6.7 KB</p>
<p><strong>Includes:</strong> Blazor WebAssembly setup, module loading, PWA support</p>
<a href="https://nuget.silverlabs.uk/templates/silvershell-starter-template.tar.gz" class="download-btn" download>
Download Starter Template
</a>
</div>
<div class="download-card">
<h3>Module Template</h3>
<p>Create reusable SilverSHELL modules with best practices</p>
<p><strong>Size:</strong> 17 KB</p>
<p><strong>Includes:</strong> Module structure, configuration, CI/CD templates</p>
<a href="https://nuget.silverlabs.uk/templates/silvershell-module-template.tar.gz" class="download-btn" download>
Download Module Template
</a>
</div>
</div>
</div>
<!-- Creating Applications Section -->
<div class="sdk-section">
<h2>🏗️ Creating Applications</h2>
<h3>Using the Starter Template</h3>
<div class="code-block"><code># Create a new application
dotnet new silvershell-starter -n MyAwesomeApp
# With PWA support
dotnet new silvershell-starter -n MyAwesomeApp --pwa true
# With Module Repository integration
dotnet new silvershell-starter -n MyAwesomeApp --module-repository true</code></div>
<h3>Adding Modules</h3>
<p>SilverSHELL supports multiple ways to add modules to your application:</p>
<h3>Option 1: Configuration File</h3>
<p>Edit <code>wwwroot/appsettings.json</code>:</p>
<div class="code-block"><code>{
"AMS": {
"Deployment": {
"PreloadModules": [
"SilverLabs.SilverSHELL.Auth.Login",
"SilverSHELL.Modules.ModuleBrowser"
]
}
}
}</code></div>
<h3>Option 2: Module Browser UI</h3>
<ol>
<li>Navigate to <code>/modules/browse</code> in your application</li>
<li>Search for modules from <strong>library.silverlabs.uk</strong></li>
<li>Click "Install" on any module</li>
<li>Modules are downloaded and installed automatically</li>
</ol>
<h3>Option 3: Manual Installation</h3>
<div class="code-block"><code># Copy module DLLs to the modules directory
cp SomeModule.dll wwwroot/modules/
dotnet run
# Module is automatically discovered and loaded!</code></div>
</div>
<!-- Creating Modules Section -->
<div class="sdk-section">
<h2>🔧 Creating Modules</h2>
<h3>Using the Module Template</h3>
<div class="code-block"><code># Create a basic module
dotnet new silvershell-module -n MyModule
# Create a module with widgets
dotnet new silvershell-module -n MyModule --includeWidgets true
# Create a module with search provider
dotnet new silvershell-module -n MyModule --includeSearchProvider true
# Create a module with everything
dotnet new silvershell-module -n MyModule \
--includeWidgets true \
--includeSearchProvider true \
--includeTests true</code></div>
<h3>Module Structure</h3>
<p>The template creates an organized structure:</p>
<div class="code-block"><code>MyModule/
├── Configuration/
│ ├── ModuleMetadata.cs # Module identity and version
│ ├── EndpointConfiguration.cs # Navigation routes
│ └── WidgetConfiguration.cs # Dashboard widgets
├── Pages/
│ └── Index.razor # Razor pages
├── Components/
│ └── ... # Razor components
├── .gitlab-ci.yml # GitLab CI/CD
├── .github/workflows/
│ └── publish.yml # GitHub Actions
└── MyModuleMain.cs # Module entry point</code></div>
</div>
<!-- Publishing Modules Section -->
<div class="sdk-section">
<h2>🚀 Publishing Modules</h2>
<div class="info-box">
<strong>CI/CD Included!</strong> The module template includes ready-to-use CI/CD pipelines for both GitLab and GitHub.
</div>
<h3>Automated Publishing (Recommended)</h3>
<p>The templates include CI/CD pipelines for automatic publishing:</p>
<ol class="steps-list">
<li>
<strong>Configure CI/CD variables</strong>
<div class="code-block"><code># In GitLab: Settings > CI/CD > Variables
# In GitHub: Settings > Secrets > Actions
# Add variable:
MODULE_REPO_TOKEN: [your token from library.silverlabs.uk]</code></div>
</li>
<li>
<strong>Commit and push your code</strong>
<div class="code-block"><code>git add .
git commit -m "feat: Initial module implementation"
git push</code></div>
</li>
<li>
<strong>Create a release tag</strong>
<div class="code-block"><code>git tag v1.0.0
git push --tags</code></div>
</li>
<li>
<strong>Trigger publish</strong> from your CI/CD pipeline UI
</li>
</ol>
<h3>Manual Publishing</h3>
<div class="code-block"><code># Build and package
dotnet pack --configuration Release -o dist/
# Upload to repository
curl -X POST "https://library.silverlabs.uk/api/modules/publish" \
-F "id=MyModule" \
-F "name=My Awesome Module" \
-F "version=1.0.0" \
-F "description=A great module" \
-F "author=Your Name" \
-F "package=@@dist/MyModule.1.0.0.nupkg"</code></div>
</div>
<!-- Available Modules Section -->
<div class="sdk-section">
<h2>📚 Available Modules</h2>
<p>Browse and install modules from the SilverSHELL module repository:</p>
<div class="info-box">
<strong>Module Repository:</strong> <a href="https://library.silverlabs.uk" target="_blank" style="color: #a78bfa;">library.silverlabs.uk</a>
</div>
<h3>Featured Modules:</h3>
<ul>
<li><strong>Auth.Login</strong> - User authentication and login UI</li>
<li><strong>Auth.Registration</strong> - User registration system</li>
<li><strong>Auth.UserManagement</strong> - User administration</li>
<li><strong>Auth.MyAccount</strong> - User profile management</li>
<li><strong>ModuleBrowser</strong> - Browse and install modules from the UI</li>
</ul>
<h3>Explore All Modules</h3>
<div class="code-block"><code># List all available modules via API
curl https://library.silverlabs.uk/api/modules
# Search for specific modules
curl https://library.silverlabs.uk/api/modules/search?q=auth</code></div>
</div>
<!-- Resources Section -->
<div class="sdk-section">
<h2>📖 Resources</h2>
<ul>
<li><strong>Module Repository API:</strong> <a href="https://library.silverlabs.uk/api/modules" target="_blank" style="color: #a78bfa;">https://library.silverlabs.uk/api/modules</a></li>
<li><strong>Demo Application:</strong> <a href="https://demo.silverlabs.uk" target="_blank" style="color: #a78bfa;">https://demo.silverlabs.uk</a></li>
<li><strong>GitLab Repository:</strong> <a href="https://gitlab.silverlabs.uk/silverlabs/silvershell" target="_blank" style="color: #a78bfa;">GitLab</a></li>
</ul>
</div>
<!-- Support Section -->
<div class="sdk-section">
<h2>💬 Support</h2>
<p>Need help? We're here for you:</p>
<ul>
<li><strong>Help Desk:</strong> <a href="https://helpdesk.silverlabs.uk" target="_blank" style="color: #a78bfa;">helpdesk.silverlabs.uk</a></li>
<li><strong>Issues:</strong> <a href="https://gitlab.silverlabs.uk/silverlabs/silvershell/-/issues" target="_blank" style="color: #a78bfa;">GitLab Issues</a></li>
</ul>
</div>
<a href="/" class="back-link">← Back to SilverLabs Home</a>
</div>
</div>

View File

@@ -0,0 +1,64 @@
@page "/weather"
@attribute [StreamRendering]
<PageTitle>Weather</PageTitle>
<h1>Weather</h1>
<p>This component demonstrates showing data.</p>
@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th aria-label="Temperature in Celsius">Temp. (C)</th>
<th aria-label="Temperature in Farenheit">Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate streaming rendering
await Task.Delay(500);
var startDate = DateOnly.FromDateTime(DateTime.Now);
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = summaries[Random.Shared.Next(summaries.Length)]
}).ToArray();
}
private class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public string? Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}