Update docs for brewery maps/location work: frontend feature-slice layout, spatial proximity query, and new location-query tests

This commit is contained in:
Aaron Po
2026-08-27 00:53:05 -04:00
parent 3457646558
commit 1254797fe1
3 changed files with 34 additions and 9 deletions

View File

@@ -60,7 +60,8 @@ Archived/reference areas:
## Tech stack ## Tech stack
- **Backend**: .NET 10, ASP.NET Core, SQL Server 2022, DbUp - **Backend**: .NET 10, ASP.NET Core, SQL Server 2022, DbUp
- **Frontend**: React 19, React Router 7, Vite 7, Tailwind CSS 4, DaisyUI 5 - **Frontend**: React 19, React Router 7, Vite 7, Tailwind CSS 4, DaisyUI 5,
Leaflet/React Leaflet (brewery maps)
- **UI Documentation**: Storybook 10, Vitest browser mode, Playwright - **UI Documentation**: Storybook 10, Vitest browser mode, Playwright
- **Testing**: xUnit, Reqnroll (BDD), FluentAssertions, Moq - **Testing**: xUnit, Reqnroll (BDD), FluentAssertions, Moq
- **Infrastructure**: Docker, Docker Compose - **Infrastructure**: Docker, Docker Compose

View File

@@ -309,7 +309,12 @@ it, without an ORM's change-tracking or mapping magic
through Dapper, with no manual `IDbCommand` parameter binding. The one through Dapper, with no manual `IDbCommand` parameter binding. The one
wrinkle is the `GEOGRAPHY` column on `BreweryPostLocation`, which Dapper wrinkle is the `GEOGRAPHY` column on `BreweryPostLocation`, which Dapper
can't deserialize as a UDT: reads select `CONVERT(varbinary(max), can't deserialize as a UDT: reads select `CONVERT(varbinary(max),
Coordinates)` so the value comes back as a plain `byte[]` Dapper can bind Coordinates)` so the value comes back as a plain `byte[]` Dapper can bind.
Proximity search (`GET /api/brewery/locations/nearby`) filters and orders
rows server-side with `Coordinates.STDistance(@Origin) <= @RangeInMetres`,
avoiding a client-side distance calculation over every row. No spatial
index backs the query yet; `schema.sql` sketches one, commented out, for
when the table grows large enough to need it
- Referential checks that a stored procedure used to perform (e.g. "does this - Referential checks that a stored procedure used to perform (e.g. "does this
`CityId` exist?") are now explicit `SELECT 1 ...` existence checks in the `CityId` exist?") are now explicit `SELECT 1 ...` existence checks in the
repository method, run inside the same transaction as the write repository method, run inside the same transaction as the write
@@ -335,11 +340,24 @@ enabled.
```text ```text
web/frontend/ web/frontend/
├── app/ ├── app/
│ ├── components/ Shared UI such as Navbar, FormField, SubmitButton, ToastProvider │ ├── components/ Shared UI: Navbar, FormField, SubmitButton, ToastProvider,
│ ├── lib/ Auth helpers, schemas, and theme metadata │ │ RouteErrorState, ClientOnly (defers client-only children,
│ ├── routes/ Route modules for home, login, register, dashboard, confirm, theme │ │ for example Leaflet maps, past hydration)
│ ├── root.tsx App shell and global providers │ ├── features/ One folder per feature slice, each owning its own
│ └── app.css Theme tokens and global styling │ │ routes/, components/, hooks/, schemas, and server-side
│ │ loader helpers:
│ │ - account profile/dashboard management
│ │ - auth login, register, confirm, logout
│ │ - breweries index/directory/detail routes, Leaflet
│ │ map components, nearby-search resource
│ │ route, distance/address utils
│ │ - catalog beers, beer styles
│ │ - home landing page
│ │ - theme theme switcher/guide
│ ├── hooks/ Shared hooks not tied to one feature, for example useMediaQuery
│ ├── routes.ts Route table (React Router 7 config-based routing)
│ ├── root.tsx App shell and global providers
│ └── app.css Theme tokens and global styling
├── .storybook/ Storybook config and preview setup ├── .storybook/ Storybook config and preview setup
├── stories/ Storybook stories for shared UI and themes ├── stories/ Storybook stories for shared UI and themes
├── tests/playwright/ Storybook Playwright coverage ├── tests/playwright/ Storybook Playwright coverage
@@ -348,9 +366,13 @@ web/frontend/
### Frontend responsibilities ### Frontend responsibilities
- Render the auth demo and theme guide routes - Render brewery discovery routes (`/breweries` index, `/breweries/directory`,
`/breweries/:id`) with Leaflet-powered maps and geolocation-based "nearby"
search
- Render the auth demo, account dashboard, and theme guide routes
- Manage cookie-backed website session state - Manage cookie-backed website session state
- Call the .NET API for login, registration, token refresh, and confirmation - Call the .NET API for login, registration, token refresh, confirmation, and
brewery/location data
- Provide shared UI building blocks for forms, navigation, themes, and toasts - Provide shared UI building blocks for forms, navigation, themes, and toasts
- Supply Storybook documentation and browser-based component verification - Supply Storybook documentation and browser-based component verification

View File

@@ -164,6 +164,8 @@ The default (`headless: true`) is set in `web/frontend/vite.config.ts`.
**Features.Breweries.Tests**: **Features.Breweries.Tests**:
- Brewery create/update/delete commands and get-by-id/get-all queries - Brewery create/update/delete commands and get-by-id/get-all queries
- Brewery location queries: all locations, and locations within a given range
of a coordinate
**Features.UserManagement.Tests**: **Features.UserManagement.Tests**: