Skip to content

Coding Styles

Conventions used across the HVC codebase. These are the de-facto rules observed in the projects — follow them when contributing.

.NET (all backend projects)

  • C# / .NET conventions — PascalCase types, camelCase methods & locals, file-scoped classes where useful, records for DTOs.
  • Folders mirror feature boundariesFeatures/<Area>/ with Commands/Handlers/ Mutations/Queries next to each other (hvc-api, hvc-admin-api).
  • Mediator pattern — business logic goes through IMessageBus/MediatR commands (Wolverine in hvc-api & hvc-admin-api).
  • Typed HTTP clients via Refit — one interface per external API (IPexipApi, IMailgunApi, IKeycloakApi...), config section per integration.
  • SerilogLog.Information(...) at startup/shutdown, request logging enabled, Seq sink in every service.
  • Async everywhereasync Task endpoints/services; no sync-over-async.

Svelte (hvc-web, hvc-admin-web)

  • Components — PascalCase filenames (Dashboard.svelte); smaller reusable pieces in atoms/, cmps/, forms/ (web) or components/atoms/, components/myForms/ (admin).
  • Props — explicit export let, defaults in place; $$restProps spread for pass-through.
  • Styling — Tailwind utility classes; scoped <style> blocks only for overrides.
  • Stores — Svelte stores for shared state (stores/shared.ts, stores/data.ts in web).
  • Forms — custom Form + input components wrapping Felte (web) / Felte + yup (admin).

Flutter (hvcmobile, hvc-xr)

  • GetX — controllers per feature (AuthController, ContactsController...), Get.find() for DI; routes via GetMaterialApp.
  • Naming — snake_case files (home_page.dart), PascalCase classes, camelCase methods.
  • Widgets — small focused widgets in lib/widgets/; pages in lib/views/.
  • Local persistence — ObjectBox entities in lib/data/ (regenerate with build_runner build).
  • Constants — endpoints/permission names centralized in lib/shared/constants.dart.

Git & PRs

  • Conventional branch names (feature/, bugfix/, hotfix/).
  • Meaningful commit messages; update documentation when adding features.

Released under the MIT License.