Skip to content

Conventions

The one-screen cheat-sheet. These are the patterns every slice follows — keep to them and your code reads like the rest of the codebase (which is also what lets an AI assistant extend it cleanly).

Naming

WhereConvention
C# types/membersPascalCase; private fields _camelCase; records for DTOs
TS vars/functionscamelCase; components/types PascalCase
File nameskebab-case, except React components (PascalCase.tsx)
Folderslowercase kebab-case
Permissionsfeature.action (lowercase, dot-separated); wildcards feature.*
i18n keysfeature.subkey.subsubkey, mirroring folder structure
SettingsFeature.SettingName (PascalCase with dots)

Backend

  • A feature is six files under Features/{Domain}/; it auto-registers — never edit Program.cs.
  • Errors are RFC 7807 ProblemDetails. Throw a DomainException subclass (NotFoundException, ConflictException, …) — never a raw Exception.
  • Map with static methods, not AutoMapper. Use DbContext directly, not a repository.
  • Cross-cutting work is the IEndpointFilter pipeline (validation/audit/performance/transaction), not per-handler code.

Frontend

  • Screens are files under src/pages/; the path tree is the URL tree. _-prefixed = ignored by the router.
  • Fetch data with TanStack Query, never useEffect.
  • Never put auth tokens in localStorage/sessionStorage.
  • Use logical CSS properties (ms-/me-/ps-/pe-) so RTL works — never ml-/mr-/pl-/pr- for layout.

The quality bar

A feature isn't done until all six are true: designed loading, empty, and error states; verified mobile layout; dark-mode parity; and keyboard navigation. Fewer features at higher quality, not the reverse.

Comments

Explain why, not what — a non-obvious constraint, a workaround, a subtle invariant. The diff already says what.

NetForge Community is MIT-licensed. Pro is a commercial edition.