Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .claude/backlog/001-create-backlog-in-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ As a product owner, I want the backlog represented in GitHub so that work can be

## Notes / dependencies

- Use `docs/scripts/create-github-issues.ps1` to batch-create issues from backlog files via `gh` CLI.
- Use `scripts/create-github-issues.ps1` to batch-create issues from backlog files via `gh` CLI.
1 change: 0 additions & 1 deletion .claude/skills/cck-testing/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ description: >
tests/
AHKFlowApp.API.Tests/ # Integration tests — WebApplicationFactory + Testcontainers
AHKFlowApp.Application.Tests/ # Validator unit tests + handler unit tests
AHKFlowApp.Domain.Tests/ # Domain entity logic unit tests
AHKFlowApp.Infrastructure.Test/ # EF Core + migration tests with Testcontainers
AHKFlowApp.UI.Blazor.Tests/ # Blazor component tests (bUnit)
```
Expand Down
1 change: 0 additions & 1 deletion .claude/skills/cck-verify/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ If tests fail: stop and fix before continuing. See the **build-fix** skill.
```bash
dotnet test tests/AHKFlowApp.API.Tests --configuration Release --verbosity normal
dotnet test tests/AHKFlowApp.Application.Tests --configuration Release --verbosity normal
dotnet test tests/AHKFlowApp.Domain.Tests --configuration Release --verbosity normal
```

### Run a Single Test by Name
Expand Down
9 changes: 4 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Blazor WebAssembly PWA frontend + ASP.NET Core Web API backend. Early stage —
## Tech Stack

- **.NET 10.0** — all projects target `net10.0`; Microsoft.* packages use 10.x versions
- **EF Core** + SQL Server (LocalDB/Docker Compose/Azure SQL) with `EnableRetryOnFailure()`
- **EF Core** + SQL Server (Windows LocalDB/x64 Docker Compose/Azure SQL) with `EnableRetryOnFailure()`
- **Blazor WebAssembly** PWA with MudBlazor 9.x and Azure AD (MSAL) authentication
- **MediatR** (Jimmy Bogard) for CQRS — commands, queries, pipeline behaviors
- **Ardalis.Result** for typed operation outcomes (handlers only)
Expand All @@ -33,7 +33,6 @@ src/Frontend/
tests/
AHKFlowApp.API.Tests/ # API integration tests (WebApplicationFactory)
AHKFlowApp.Application.Tests/ # Validator + service unit tests
AHKFlowApp.Domain.Tests/ # Domain logic unit tests
AHKFlowApp.Infrastructure.Tests/ # Repository integration tests
AHKFlowApp.UI.Blazor.Tests/ # Blazor component tests (bUnit)
```
Expand All @@ -54,12 +53,12 @@ dotnet test tests/AHKFlowApp.API.Tests --configuration Release --verbosity norma
dotnet test tests/AHKFlowApp.API.Tests --filter "FullyQualifiedName~HealthControllerTests"

# Run API locally (recommended: Docker SQL on port 1433)
dotnet run --project src/Backend/AHKFlowApp.API --launch-profile "https + Docker SQL (Recommended)"
dotnet run --project src/Backend/AHKFlowApp.API --launch-profile "Docker SQL (Recommended)"

# Run Blazor frontend (separate terminal)
dotnet run --project src/Frontend/AHKFlowApp.UI.Blazor

# Full stack via Docker Compose (SQL Server + API)
# Full stack via Docker Compose (API + SQL Server on x64/amd64 hosts)
docker compose up --build

# EF Core migrations
Expand Down Expand Up @@ -214,7 +213,7 @@ GitHub Actions workflows in `.github/workflows/`:

**Environments:**
- **DEV:** Local development environment (`ASPNETCORE_ENVIRONMENT=Development`)
- LocalDB or Docker SQL Server
- Windows LocalDB or x64 Docker SQL Server
- No Azure resources required
- Run locally with `dotnet run`
- **TEST:** Azure pre-production environment (`ASPNETCORE_ENVIRONMENT=Test`)
Expand Down
1 change: 0 additions & 1 deletion AHKFlowApp.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<Folder Name="/tests/">
<Project Path="tests/AHKFlowApp.API.Tests/AHKFlowApp.API.Tests.csproj" />
<Project Path="tests/AHKFlowApp.Application.Tests/AHKFlowApp.Application.Tests.csproj" />
<Project Path="tests/AHKFlowApp.Domain.Tests/AHKFlowApp.Domain.Tests.csproj" />
<Project Path="tests/AHKFlowApp.E2E.Tests/AHKFlowApp.E2E.Tests.csproj" />
<Project Path="tests/AHKFlowApp.Infrastructure.Tests/AHKFlowApp.Infrastructure.Tests.csproj" />
<Project Path="tests/AHKFlowApp.TestUtilities/AHKFlowApp.TestUtilities.csproj" />
Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
### Prerequisites

- [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0)
- SQL Server LocalDB (included with Visual Studio) or Docker
- One local database path:
- Windows + SQL Server LocalDB, or
- Docker on an x64/amd64 host for the bundled SQL Server compose stack
- Optional for Azure provisioning only: Windows PowerShell 5.1, Azure CLI, GitHub CLI

> The bundled Docker stack is **not supported on Raspberry Pi / ARM64** because `docker-compose.yml` uses SQL Server 2022.

### Running Locally

**Option 1 — LocalDB:**
**Option 1 — Windows + LocalDB**

```bash
# Apply migrations (after backlog item 007)
Expand All @@ -18,13 +23,20 @@ dotnet ef database update \
--startup-project src/Backend/AHKFlowApp.API

# Start API (http://localhost:5600, OpenAPI at /swagger/v1/swagger.json)
dotnet run --project src/Backend/AHKFlowApp.API --launch-profile "Docker SQL (Recommended)"
dotnet run --project src/Backend/AHKFlowApp.API --launch-profile "LocalDB SQL"

# Start frontend in a separate terminal (http://localhost:5601)
dotnet run --project src/Frontend/AHKFlowApp.UI.Blazor
```

**Option 2 — Docker Compose (recommended):**
**Option 2 — Windows/x64 Docker SQL + local frontend**

```bash
dotnet run --project src/Backend/AHKFlowApp.API --launch-profile "Docker SQL (Recommended)"
dotnet run --project src/Frontend/AHKFlowApp.UI.Blazor
```

**Option 3 — Docker Compose (API + SQL only, x64/amd64):**

See `docs/development/docker-setup.md`.

Expand All @@ -42,7 +54,7 @@ The application supports three distinct environments:

| Environment | Description | ASPNETCORE_ENVIRONMENT | Deployment |
|-------------|-------------|------------------------|------------|
| **DEV** | Local development | `Development` | Local machine (LocalDB or Docker SQL) |
| **DEV** | Local development | `Development` | Local machine (Windows LocalDB or x64 Docker SQL) |
| **TEST** | Pre-production testing | `Test` | Azure (auto-deploy from `main` branch) |
| **PROD** | Production | `Production` | Azure (manual deployment via workflow) |

Expand Down
3 changes: 1 addition & 2 deletions docs/deployment/entra-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ Handled automatically by the full provisioning script:

Phase 3 sets up or updates the per-env app registration via `setup-entra-app.ps1` before Bicep runs. Later in the deployment, the script re-runs that setup only to refresh redirect URIs and write all three `AZURE_AD_*_{TEST|PROD}` GitHub Variables once the final app endpoints are known. The deploy workflows substitute these into `appsettings.{Test|Production}.json` at build time and inject them into App Service configuration on every deploy.

After `deploy.ps1` finishes, retrigger the API and frontend deploy workflows (they don't auto-run on `scripts/**` changes):
After `deploy.ps1` finishes, the script already dispatches `deploy-frontend.yml` for the selected environment. The API workflow still runs on the next push to `main`, or you can trigger it manually if you need to redeploy the current image:

```powershell
gh workflow run deploy-api.yml --ref main -f environment=test
gh workflow run deploy-frontend.yml --ref main -f environment=test
```

### Manual fallback
Expand Down
20 changes: 12 additions & 8 deletions docs/deployment/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This guide walks you through provisioning your own AHKFlowApp instance on Azure.

**Prerequisites:** An Azure subscription. The deploy script will guide you through any additional tooling.
**Prerequisites:** Azure subscription, Windows PowerShell 5.1 or newer, .NET 10 SDK, Azure CLI, and GitHub CLI. `sqlcmd` is optional.

## Quick Start (Recommended)

Expand All @@ -16,17 +16,19 @@ cd AHKFlowApp

The script will:

1. Check that required tools are installed (Azure CLI, GitHub CLI)
1. Check that required tools are installed (.NET 10 SDK, Azure CLI, GitHub CLI)
2. Prompt for your environment name (`test` or `prod`), Azure region, and GitHub repository
3. Create an Azure resource group and provision all resources via Bicep
4. Set up Entra ID (SQL access, OIDC for GitHub Actions)
4. Set up Entra ID (app registration, SQL access, OIDC for GitHub Actions)
5. Create the SQL database user for the application
6. Configure GitHub secrets and variables so CI/CD works automatically
7. Save your configuration to `scripts/.env.{environment}` for future use
7. Trigger the frontend deploy workflow on GitHub
8. Save your configuration to `scripts/.env.{environment}` for future use
Comment on lines +25 to +26
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step ordering here doesn’t match what scripts/deploy.ps1 does: the script saves scripts/.env.{environment} first and only then triggers deploy-frontend.yml. Please either reorder these bullets or adjust the script so the documentation matches the actual workflow.

Suggested change
7. Trigger the frontend deploy workflow on GitHub
8. Save your configuration to `scripts/.env.{environment}` for future use
7. Save your configuration to `scripts/.env.{environment}` for future use
8. Trigger the frontend deploy workflow on GitHub

Copilot uses AI. Check for mistakes.

When done, push to `main` — GitHub Actions will deploy the API container and Blazor frontend automatically.
When done, the script queues the frontend deployment automatically.

> **Auth app registration not included in `deploy.ps1`.** After provisioning, run the Entra app registration setup separately — see [Entra ID Setup](#entra-id-app-registration-setup) below.
- **TEST:** the API deploys when `deploy-api.yml` is triggered by a qualifying push to `main` (`src/Backend/**`, `tests/**`, `Directory.*.props`, `global.json`, or `.github/workflows/deploy-api.yml`).
- **PROD:** the API deploy is manual — run `deploy-api.yml` with `environment=prod`.

## What Gets Provisioned

Expand All @@ -49,6 +51,8 @@ Estimated cost for the `test` environment: **~$15–25/month** (B1 App Service P

The deploy script checks for these and will tell you how to install them if missing:

- **Windows PowerShell 5.1+** — included on supported Windows versions
- **.NET 10 SDK** — [install](https://dotnet.microsoft.com/download/dotnet/10.0)
- **Azure CLI** — [install](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
- **GitHub CLI** (`gh`) — [install](https://cli.github.com)
- **sqlcmd** (optional) — [install](https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-utility). If absent, the script prints a SQL snippet to run in the Azure Portal instead.
Expand Down Expand Up @@ -100,14 +104,14 @@ If you need to re-provision from GitHub Actions (e.g., after a Bicep change):

## Entra ID App Registration Setup

The `deploy.ps1` script provisions infrastructure but does **not** create the Entra ID app registration used for user authentication. Run this once per environment after provisioning:
`deploy.ps1` already creates or updates the Entra ID app registration for `test` and `prod`. Use `setup-entra-app.ps1` only as a manual fallback when you need to refresh redirect URIs or repair app-registration state without re-running the full provisioning flow:

```powershell
.\scripts\setup-entra-app.ps1 -Environment test
.\scripts\setup-entra-app.ps1 -Environment prod
```

The script outputs the `ClientId`, `TenantId`, and `DefaultScope` values. Set them as GitHub Variables so the deploy workflows can inject them:
The script outputs the `ClientId`, `TenantId`, and `DefaultScope` values. If you run it manually, update the matching GitHub Variables so the deploy workflows can inject them:

```bash
gh variable set AZURE_AD_TENANT_ID_TEST --body "<TenantId>"
Expand Down
4 changes: 4 additions & 0 deletions docs/development/docker-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Access API at: http://localhost:5600/swagger

SQL Server is available on: `localhost:1433`

> The bundled compose stack runs **API + SQL Server only**. Run the Blazor frontend separately with `dotnet run --project src/Frontend/AHKFlowApp.UI.Blazor`.
>
> The bundled compose stack is **x64/amd64 only**. It is not supported on Raspberry Pi / ARM64 because it uses `mcr.microsoft.com/mssql/server:2022-latest`.

## Visual Studio Launch Profiles

Launch profiles are defined in `src/Backend/AHKFlowApp.API/Properties/launchSettings.json`.
Expand Down
2 changes: 1 addition & 1 deletion docs/development/github-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ GitHub Projects v2 has limited built-in automation. Manage workflow manually:

### Batch Script

See [`docs/scripts/create-github-issues.ps1`](../scripts/create-github-issues.ps1) — reads backlog files from `.claude/backlog/`, detects type/epic/interface labels, and creates GitHub Issues via `gh` CLI. Supports dry-run (default) and `-Execute` flag.
See [`scripts/create-github-issues.ps1`](../../scripts/create-github-issues.ps1) — reads backlog files from `.claude/backlog/`, detects type/epic/interface labels, and creates GitHub Issues via `gh` CLI. Supports dry-run (default) and `-Execute` flag.

### Run

Expand Down
Loading