Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* text=auto

*.cs text eol=lf
*.csproj text eol=lf
*.json text eol=lf
*.md text eol=lf
*.razor text eol=lf
*.yml text eol=lf
Dockerfile text eol=lf

*.jpg binary
*.jpeg binary
*.png binary
*.mp4 binary
*.pdf binary
25 changes: 22 additions & 3 deletions .github/workflows/smartbotweb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:
env:
PUBLISH_PATH: published
CONFIGURATION: Release
DOTNET_CORE_VERSION: 8.0.x
DOTNET_CORE_VERSION: 10.0.300
PROJECT_PATH: src/server/SmartBotBlazorApp/SmartBotBlazorApp.csproj
SOLUTION_PATH: src/server/SmartBotBlazorApp.sln
jobs:
Expand All @@ -28,15 +28,34 @@ jobs:
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Restore
run: dotnet restore "${{ env.SOLUTION_PATH }}"
run: dotnet restore "${{ env.SOLUTION_PATH }}" --locked-mode
- name: Verify formatting
run: dotnet format "${{ env.SOLUTION_PATH }}" --verify-no-changes --no-restore
- name: Audit NuGet packages
shell: bash
run: |
dotnet list "${{ env.SOLUTION_PATH }}" package --vulnerable --include-transitive --format json > vulnerable-packages.json
test "$(jq '[.projects[]?.frameworks[]? | ((.topLevelPackages // []) + (.transitivePackages // []))[]] | length' vulnerable-packages.json)" -eq 0
- name: Build
run: dotnet build "${{ env.SOLUTION_PATH }}" --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Test
run: dotnet test "${{ env.SOLUTION_PATH }}" --configuration ${{ env.CONFIGURATION }} --no-build
run: dotnet test "${{ env.SOLUTION_PATH }}" --configuration ${{ env.CONFIGURATION }} --no-build --collect:"XPlat Code Coverage" --results-directory TestResults
- name: Publish
run: dotnet publish "${{ env.PROJECT_PATH }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.PUBLISH_PATH }}"
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: webapp
path: ${{ env.PUBLISH_PATH }}
if-no-files-found: error
- name: Publish quality reports
if: always()
uses: actions/upload-artifact@v4
with:
name: quality-reports
path: |
TestResults
vulnerable-packages.json
if-no-files-found: warn
- name: Build container image
run: docker build --file src/server/SmartBotBlazorApp/Dockerfile --tag smartbotapi:ci .
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
</Project>
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ SmartBotAPI/

### Web Server

**Prerequisites:** [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0), SQL Server LocalDB on Windows (installed with Visual Studio) or any reachable SQL Server instance.
**Prerequisites:** [.NET SDK 10.0](https://dotnet.microsoft.com/download/dotnet/10.0) (the application targets .NET 8), SQL Server LocalDB on Windows (installed with Visual Studio) or any reachable SQL Server instance.

```powershell
cd src/server/SmartBotBlazorApp
Expand All @@ -171,7 +171,7 @@ The app applies EF Core migrations automatically on startup and listens on:
- `https://localhost:7297`
- `http://localhost:5221`

On first launch, create a dashboard account at `https://localhost:7297/Account/Register`, then sign in.
The `https` launch profile uses the Development environment, where account registration and the local self-confirmation link are enabled. Create a dashboard account at `https://localhost:7297/Account/Register`, then sign in. Both options are disabled by default outside Development; configure `AccountAccess` explicitly and use a real email sender for a public deployment.

To run the automated tests from the repository root:

Expand All @@ -191,6 +191,8 @@ docker run -p 8080:8080 \
smartbotblazorapp
```

The container serves plain HTTP on port 8080 unless you explicitly mount and configure an HTTPS certificate. Registration remains disabled in the default production configuration.

### Robot Firmware

**Prerequisites:** Arduino IDE 2.x with the ESP32 board package; an ESP32-C3 DevKitM-1 wired per the schematic in [`docs/schemat.pdf`](docs/schemat.pdf).
Expand Down Expand Up @@ -226,7 +228,7 @@ The [firmware and hardware reference](docs/firmware.md) links to the manufacture

## Deployment

Pushing to `main` or opening a pull request against it triggers the GitHub Actions workflow (`.github/workflows/smartbotweb.yml`), which builds and tests the solution and publishes a deployable web-app artifact. It does not deploy to an external environment automatically.
Pushing to `main` or opening a pull request against it triggers the GitHub Actions workflow (`.github/workflows/smartbotweb.yml`), which performs a locked restore, verifies formatting, audits NuGet packages, builds and tests with coverage, builds the container image, and publishes a deployable web-app artifact. It does not deploy to an external environment automatically.

For the project presentation, the application was deployed to the **smartbotweb** Azure App Service and the firmware targeted `smartbotweb.azurewebsites.net:443`. That service is no longer hosted; the current firmware configuration uses an explicit placeholder that must be replaced with the address of the current server before use.

Expand Down
8 changes: 5 additions & 3 deletions README.pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ SmartBotAPI/

### Serwer webowy

**Wymagania:** [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0), SQL Server LocalDB w systemie Windows (instalowany z Visual Studio) lub dowolna dostępna instancja SQL Server.
**Wymagania:** [.NET SDK 10.0](https://dotnet.microsoft.com/download/dotnet/10.0) (aplikacja jest kierowana na .NET 8), SQL Server LocalDB w systemie Windows (instalowany z Visual Studio) lub dowolna dostępna instancja SQL Server.

```powershell
cd src/server/SmartBotBlazorApp
Expand All @@ -172,7 +172,7 @@ Aplikacja automatycznie stosuje migracje EF Core przy starcie i nasłuchuje na:
- `https://localhost:7297`
- `http://localhost:5221`

Przy pierwszym uruchomieniu utwórz konto panelu pod adresem `https://localhost:7297/Account/Register`, a następnie się zaloguj.
Profil uruchomieniowy `https` korzysta ze środowiska Development, w którym rejestracja i lokalny link samodzielnego potwierdzenia konta są włączone. Utwórz konto panelu pod adresem `https://localhost:7297/Account/Register`, a następnie się zaloguj. Poza Development obie opcje są domyślnie wyłączone; przy publicznym wdrożeniu skonfiguruj jawnie sekcję `AccountAccess` i prawdziwą wysyłkę e-mail.

Aby uruchomić testy automatyczne z katalogu głównego repozytorium:

Expand All @@ -192,6 +192,8 @@ docker run -p 8080:8080 \
smartbotblazorapp
```

Kontener udostępnia zwykły HTTP na porcie 8080, o ile certyfikat HTTPS nie zostanie jawnie zamontowany i skonfigurowany. W domyślnej konfiguracji produkcyjnej rejestracja pozostaje wyłączona.

### Firmware robota

**Wymagania:** Arduino IDE 2.x z pakietem płytek ESP32; ESP32-C3 DevKitM-1 połączone wg schematu w [`docs/schemat.pdf`](docs/schemat.pdf).
Expand Down Expand Up @@ -227,7 +229,7 @@ Po połączeniu robot pojawia się na stronie **Live View Image** zalogowanego p

## Wdrożenie

Push do `main` lub otwarcie pull requesta do tej gałęzi uruchamia workflow GitHub Actions (`.github/workflows/smartbotweb.yml`), który buduje i testuje rozwiązanie oraz publikuje artefakt aplikacji webowej gotowy do wdrożenia. Workflow nie wdraża automatycznie do środowiska zewnętrznego.
Push do `main` lub otwarcie pull requesta do tej gałęzi uruchamia workflow GitHub Actions (`.github/workflows/smartbotweb.yml`), który wykonuje odtwarzalny restore, sprawdza formatowanie i podatności pakietów, buduje i testuje rozwiązanie z pomiarem pokrycia, buduje obraz kontenera oraz publikuje artefakt aplikacji webowej. Workflow nie wdraża automatycznie do środowiska zewnętrznego.

Na potrzeby prezentacji projektu aplikacja była wdrożona na Azure App Service **smartbotweb**, a firmware łączył się z `smartbotweb.azurewebsites.net:443`. Usługa nie jest już hostowana; aktualna konfiguracja firmware zawiera jawny placeholder, który przed użyciem trzeba zastąpić adresem bieżącego serwera.

Expand Down
38 changes: 16 additions & 22 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,28 @@ Changes: the track was trimmed and mixed with the SmartBot driving-test montage.

NuGet packages retain their upstream license files and metadata. The direct
dependencies declared by the server, client, and test projects, together with
the transitive dependency carrying nonstandard Microsoft terms, are:
the transitive dependencies carrying nonstandard Microsoft terms are:

| Package or package group | Version | License |
|---|---:|---|
| Azure.Identity | 1.13.1 | [MIT](https://licenses.nuget.org/MIT) |
| Microsoft.AspNetCore.Components.WebAssembly, .Authentication, .Server; Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore; Microsoft.AspNetCore.Identity.EntityFrameworkCore; Microsoft.AspNetCore.SignalR.Client | 8.0.10 | [MIT](https://licenses.nuget.org/MIT) |
| Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Tools | 9.0.0 | [MIT](https://licenses.nuget.org/MIT) |
| MudBlazor | 7.15.0 | [MIT](https://licenses.nuget.org/MIT) |
| Newtonsoft.Json | 13.0.3 | [MIT](https://licenses.nuget.org/MIT) |
| System.Formats.Asn1 | 9.0.0 | [MIT](https://licenses.nuget.org/MIT) |
| Microsoft.AspNetCore.Components.WebAssembly, .Authentication, .Server; Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore; Microsoft.AspNetCore.Identity.EntityFrameworkCore; Microsoft.AspNetCore.SignalR.Client | 8.0.29 | [MIT](https://licenses.nuget.org/MIT) |
| Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Tools | 9.0.18 | [MIT](https://licenses.nuget.org/MIT) |
| Microsoft.Data.SqlClient | 6.1.6 | [MIT](https://licenses.nuget.org/MIT) |
| MudBlazor | 7.16.0 | [MIT](https://licenses.nuget.org/MIT) |
| Newtonsoft.Json | 13.0.4 | [MIT](https://licenses.nuget.org/MIT) |
| SixLabors.ImageSharp | 3.1.12 | Apache-2.0 grant for qualifying open-source use under the [Six Labors Split License 1.0](https://sixlabors.com/posts/license-changes/) |
| Microsoft.Data.SqlClient.SNI.runtime (transitive runtime component) | 5.1.1 | [Microsoft Software License Terms](https://www.nuget.org/packages/Microsoft.Data.SqlClient.SNI.runtime/5.1.1) |
| Microsoft.VisualStudio.Azure.Containers.Tools.Targets (build tooling) | 1.21.0 | [Microsoft Software License Terms](https://www.nuget.org/packages/Microsoft.VisualStudio.Azure.Containers.Tools.Targets/1.21.0) |
| coverlet.collector, Microsoft.NET.Test.Sdk | 10.0.1, 18.7.0 | [MIT](https://licenses.nuget.org/MIT) |
| xunit, xunit.runner.visualstudio | 2.9.3, 3.1.5 | [Apache-2.0](https://licenses.nuget.org/Apache-2.0) |
| Microsoft.Data.SqlClient.SNI.runtime (transitive runtime component) | 6.0.2 | [Microsoft Software License Terms](https://www.nuget.org/packages/Microsoft.Data.SqlClient.SNI.runtime/6.0.2) |
| Microsoft.Identity.Client.NativeInterop (transitive runtime component) | 0.20.6 | [Microsoft Software License Terms](https://www.nuget.org/packages/Microsoft.Identity.Client.NativeInterop/0.20.6) |
| coverlet.collector, Microsoft.NET.Test.Sdk | 10.0.1, 18.8.1 | [MIT](https://licenses.nuget.org/MIT) |
| xunit.v3, xunit.runner.visualstudio | 3.2.2, 3.1.5 | [Apache-2.0](https://licenses.nuget.org/Apache-2.0) |

The restore verified on July 15, 2026 resolves 144 unique package/version pairs
The restore verified on July 15, 2026 resolves 140 unique package/version pairs
across the server, client, and test projects. Their NuGet metadata consists of
125 MIT license expressions, 7 Apache-2.0 expressions, 9 legacy upstream
license URLs, and 3 embedded license files. The three embedded licenses are the
SNI runtime, ImageSharp, and the Visual Studio container build tooling listed
above; the legacy URLs belong to Microsoft/.NET Core packages and
`xunit.abstractions`. This accounts for the complete restored graph at that
date. Exact transitive versions can change after a future restore, so each
127 MIT license expressions, 10 Apache-2.0 expressions, no legacy upstream
license URLs, and 3 embedded license files. The embedded licenses are the SNI
runtime, Microsoft Identity native interop, and ImageSharp listed above.
Together, these entries account for the complete restored graph at that date.
Exact transitive versions can change after a future restore, so each
package's `.nuspec` metadata and included license file remain authoritative.

## Firmware libraries installed separately
Expand All @@ -84,10 +82,6 @@ Manager; their source code is not vendored in this repository.

## Externally loaded assets and trademarks

The web application loads Font Awesome Free 6.0.0-beta3 from cdnjs. Font
Awesome Free uses CC BY 4.0 for icons, SIL OFL 1.1 for fonts, and MIT for code;
see the [Font Awesome Free License](https://fontawesome.com/license/free).

`src/server/SmartBotBlazorApp/wwwroot/GitHub_Logo.png` is used only to link
to the SmartBotAPI repository. GitHub and the GitHub logo are trademarks of
GitHub, Inc.; use is subject to the [GitHub Logo Policy](https://docs.github.com/en/site-policy/other-site-policies/github-logo-policy).
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sequenceDiagram
## Transport

- **Protocol:** SignalR JSON hub protocol over WebSocket. The browser uses the official SignalR client; the ESP32 speaks the protocol directly — it performs the JSON handshake (`{"protocol":"json","version":1}`), then exchanges invocation messages (type `1`), each terminated by the SignalR record separator `0x1E`.
- **Security:** dashboards authenticate with the ASP.NET Core Identity cookie. The robot supplies `SECRET_API_KEY` as the SignalR `access_token` query value; the server compares it in constant time with `RobotApiKey` (minimum 32 characters). Production transport uses TLS (`wss://`).
- **Security:** dashboards authenticate with the ASP.NET Core Identity cookie. Interactive Server pages exchange their authenticated session for a five-minute, data-protected operator token; the WebAssembly diagnostics page uses the cookie directly. The robot supplies `SECRET_API_KEY` as the SignalR `access_token` query value, which is compared in constant time with `RobotApiKey` (minimum 32 characters). Hub methods enforce operator-versus-robot roles, and production transport uses TLS (`wss://`).
- **Hub endpoint:** `/signalhub` (mapped in `Program.cs`).
- **Reconnection:** the firmware retries the WebSocket every 5 s (`WS_RECONNECT_INTERVAL`); response compression is enabled server-side for `application/octet-stream`.

Expand Down Expand Up @@ -132,4 +132,4 @@ The web application uses Blazor's hybrid rendering:
- **Interactive Server** pages (`SmartBotBlazorApp/Components/Pages/`) — live visualization and robot-control pages that hold a SignalR connection server-side.
- **Interactive WebAssembly** pages (`SmartBotBlazorApp.Client/Pages/`) — the `/chat` text-diagnostics page connects to the hub directly from WASM.

ASP.NET Core Identity provides the account system (registration, login, 2FA, management pages under `/Account/*`). Receiver and diagnostics pages require authorization.
ASP.NET Core Identity provides the account system (registration, login, 2FA, management pages under `/Account/*`). Receiver and diagnostics pages require authorization. Registration and the no-email confirmation link are available in Development but disabled by default in other environments.
8 changes: 5 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This guide walks through setting up the full SmartBotAPI stack: the web server,

**Server:**

- [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0)
- [.NET SDK 10.0](https://dotnet.microsoft.com/download/dotnet/10.0) (the projects target .NET 8)
- SQL Server — LocalDB (installed with Visual Studio) is enough for development; any SQL Server instance works in production
- Optional: Docker Desktop, Visual Studio 2022

Expand All @@ -32,10 +32,12 @@ On first start the app creates the database and applies all EF Core migrations a
|---|---|
| `https` | `https://localhost:7297` (+ `http://localhost:5221`) |
| `http` | `http://localhost:5221` |
| Docker | `http://localhost:8080`, `https://localhost:8081` |
| Docker | `http://localhost:8080` |

Open the site in a browser — the **Home** page and the navigation menu list all dashboard pages.

The local launch profile uses `Development`, so registration and the no-email self-confirmation link are enabled. In other environments both are disabled by default. `AccountAccess__AllowRegistration` and `AccountAccess__ShowSelfConfirmationLink` can override them; do not expose the self-confirmation link on a public deployment.

### Custom database

Set the environment variable before starting; it overrides `appsettings.json`:
Expand All @@ -57,7 +59,7 @@ docker run -p 8080:8080 \
smartbotblazorapp
```

> The container cannot reach LocalDB — always provide a real SQL Server connection string when running in Docker.
> The container cannot reach LocalDB — always provide a real SQL Server connection string when running in Docker. It serves HTTP on port 8080 unless you mount and configure an HTTPS certificate. Registration is disabled by default in Production.

## 2. Flash the Robot Firmware

Expand Down
Loading
Loading