Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TaxLab — NZ Income Tax Calculator

Calculates NZ income tax, ACC levy, and KiwiSaver contributions from an annual salary.

TaxLab UI

Running with Docker

Single container — the .NET API serves the React frontend from wwwroot/.

docker-compose up --build

TypeScript type generation

Frontend types are generated from the OpenAPI spec at Docker build time — no manual sync required.

To regenerate locally after an API change (requires Docker to be running):

cd web
npm run generate:types

This hits http://localhost:3000/swagger/v1/swagger.json and writes src/types/api.generated.ts. Commit the updated file so the contract change is visible in the PR diff.

Tests

dotnet test api/

Architecture

API (api/) — ASP.NET Core (.NET 10), controller + service + repository layers.

  • TaxController — validates input, delegates to service
  • TaxCalculationService — pure calculation logic, injected via ITaxCalculationService
  • Repository pattern for configuration data (ITaxBandRepository, IAccSettingsRepository, IKiwiSaverRateRepository) — currently in-memory, swappable for database persistence
  • xUnit tests covering all tax bands, ACC, KiwiSaver, and net pay calculations
  • Serves the React SPA from wwwroot/ in Docker via UseStaticFiles() + MapFallbackToFile

Frontend (web/) — React 19 + TypeScript + Vite.

  • CSS Modules with CSS custom properties for design tokens
  • TanStack Query for API calls with caching
  • React Compiler enabled for automatic memoisation
  • Strict type-aware ESLint rules (strictTypeChecked + eslint-plugin-react-x)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages