2.7 KiB
2.7 KiB
Repository Guidelines
Project Structure & Module Organization
src/BCards.Webis the main MVC app (Controllers, Services, Repositories, Razor Views,wwwrootassets).src/BCards.IntegrationTestsspins up the site with fixtures for API-level checks.tests/BCards.Testshosts xUnit + Moq unit coverage with overrides inappsettings.Testing.json.tests.e2ecarries Playwright specs and config; utility scripts live underscripts/, withclean-build.shmirroring CI cleanup.
Build, Test & Development Commands
dotnet restore && dotnet build BCards.slnprimes dependencies and compiles.dotnet run --project src/BCards.Weblaunches the site (HTTPS on 5001 by default).dotnet testexecutes unit + integration suites; add--collect:"XPlat Code Coverage"to emit coverlet results.- In
tests.e2e, runnpm installonce andnpx playwright testper change; append--headedwhen debugging flows. ./clean-build.shremoves stalebin/objoutput before CI or release builds.
Coding Style & Naming Conventions
- Use 4-space indents, file-scoped namespaces, PascalCase for types, camelCase for locals, and
_camelCasefor DI fields. - Keep Razor views presentation-only; push logic into Services, ViewModels, or TagHelpers.
- Store localization strings in
Resources/, shared UI inViews/Shared, and bundle-ready assets inwwwroot. - Run
dotnet formatbefore pushing; .NET 8 analyzers treat warnings as errors in the pipeline.
Testing Guidelines
- Mirror namespaces when creating unit files (
FooServiceTestsforFooService) and favour FluentAssertions for expressiveness. - Integration scenarios reside in
src/BCards.IntegrationTests/Tests; use shared fixtures to mock MongoDB/Stripe without polluting global state. - End-to-end cases focus on signup, checkout, and profile rendering; keep snapshots in
tests.e2e/debug_*. - Target ≥80% coverage across
Services/andRepositories/; call out gaps explicitly in the PR body.
Commit & Pull Request Guidelines
- Follow the observed
type: resumoformat (feat: artigos & tutoriais,fix: checkout); keep scopes short, Portuguese when public-facing. - Squash WIP branches before review; one functional change per commit.
- Every PR needs a summary, verification list (
dotnet test, Playwright when touched), related issue link, and UI artifacts when visuals change. - Tag a module expert for review and flip the
Ready for QAlabel only after E2E automation passes.
Security & Configuration Notes
- Keep secrets out of version control; base new configs on
appsettings.Production.example.jsonand document required keys. - When callback URLs move, update both the environment files (
Dockerfile,docker-compose*.yml) and external provider dashboards together.