- In all interactions, plans, and commit messages, be extremely concise and sacrifice grammar for the sake of concision.
- Never say "Great question!" or "You're absolutely right!" or similar when replying to questions.
- For detailed project overview, see:
.context/procure_hub_project_overview.md - For list of possible app use cases, see:
.context/all_use_cases.md
- Store plans in the
.plansfolder in the root of the repo.
- This is a full stack app using .Net (C#) for backend API and with two frontends:
-
- Blazor Server app. This is primary frontend now. IMPORTANT: Make any UI changes in this project unless told otherwise.
- For further details:
ProcureHub.BlazorApp/AGENTS.md
-
- React (with TanStack Router) for frontend SPA. Legacy frontend. Do not update unless explicity told.
- For further details:
ProcureHub.WebApp/AGENTS.md
-
- The API uses ASP.Net Core Minimal APIs, EF Core with Postgres DB, and modern C# code using .Net Core version 10
- The API generates an OpenAPI spec which is converted to a strongly typed
openapi-react-queryclient for the web project- Update the client after any API change that updates the OpenAPI spec. Use command given below.
- For guidance on core domain types like Models, Migrations, and VSA request handlers, see:
ProcureHub/AGENTS.md - For guidance on how to map endpoints, see:
ProcureHub.WebApi/Features/AGENTS.md
- Use "Allman" style braces
- Always insert braces after an
ifstatement - In a multi-line conditional statement, put the
||or&&operators at the start of subsequent line(s)
- On both backend and frontend, implement features using a Vertical Slice Architecture (VSA). Use
/Features/{FeatureName}folders to group all code for a feature together. - Use command-focused endpoints in API design: Use slim update endpoints for basic profile edits (user name, department name). Use dedicated command endpoints for actions (enable/disable user, assign department, assign roles).
/ProcureHub: The core .Net domain project. Keep dependencies to a minimum./Features: VSA feature folders/Models: EF Core entity models andIEntityTypeConfigurationtypes (keep both in the same file)./Migrations: EF Core migrations. (See command below for how to update)
/ProcureHub.WebApi: The ASP.Net Core Minimal API projectProgram.cs- Configures and runs API hostApiEndpoints.cs- root class for configuring API endpoints (calls out to specific extensions defined in feature folders)/Features: VSA feature folders. Provides extension methods onWebApplicationto configure feature-specific endpoints
/ProcureHub.WebApi.Tests: API tests project using Xunit v3./Features: add feature-specific tests here
/ProcureHub.WebApp: Project structure and feature layout rules are defined inProcureHub.WebApp/docs/project-structure.md
- See guidance here:
ProcureHub.BlazorApp/AGENTS.md - For Playwright E2E tests:
ProcureHub.BlazorApp.E2ETests/AGENTS.md - Blazor unit tests are in
ProcureHub.BlazorApp.Tests
- Use Arrange-Act-Assert approach
- For state-changing operations: assert initial state → perform action → assert new state
- Example: assign user to department - fetch user, assert dept is null, assign dept via API, refetch user, assert dept is set
- Cross-cutting endpoint concerns like authentication or request validation should use
[Theory]tests with aGetAll{FeatureName}Endpointsmethod to automatically test all endpoints.- Use a class fixture with these kind of tests to not reset DB between each test
- Good example: the
UserTestsWithSharedDbclass
- You must add or update API tests when adding or updating any API endpoint
- Use the
ProcureHub.WebApi.Tests/Features/UserTests.csfile as a guide for how to implement tests - Always add a new entry in the appropriate
GetAll{FeatureName}Endpointsmethod to enforce testing of cross cutting concerns
- Use the
- Aim for 100% code coverage, but be pragmatic. If a code path is not easy to test, call it out in response or add a TODO
- To start the web app (e.g. for Chrome MCP tool):
- You must be in the
ProcureHub.WebAppdirectory first - Run the dev server non-interactively:
API_URL=http://localhost:5140 npm run dev -- --port 3003 < /dev/null - Do NOT send keyboard input to the process
- The process will not exit on its own
- Log in with the user credentials in the
ProcureHub.WebApi/appsettings.jsonfile
- You must be in the
- Update EF Core migrations:
dotnet ef migrations add ExampleMigration -p ../ProcureHub- NOTE: Run all migration commands in the
ProcureHub.WebApidir, and add the-pflag for project reference as shown above
- NOTE: Run all migration commands in the
- Update the strongly typed
openapi-react-queryclient after a change to OpenAPI spec: In the/ProcureHub.WebAppfolder, runnpm run generate:api-schema
- Never use the
jetbrains_execute_terminal_commandMCP tool — always use regular bash tool