Bluewoo HRMS

Development Standards

Coding principles, conventions, and guidelines

Development Standards

Core Philosophy

Build enterprise architecture from day one, deliver features incrementally.

  • Complex patterns (RBAC, multi-tenancy, dual DB) prevent costly refactors
  • Simple features built on top of solid architecture
  • Each feature follows established patterns

Guiding Principles

PrincipleMeaning
Boring > CleverUse proven tech, not clever solutions
Simple > OptimalGood enough beats over-optimized
Independent > DRYDuplicate code over service coupling
Now > FutureBuild for current needs, not hypotheticals
Direct > AbstractedMinimal layers (only for security)
Explicit > ImplicitNo magic, clear code paths
One WayOne pattern per problem
Stable VersionsLTS only, no beta/experimental

Documentation Index

  • ADR Guide - How to create Architecture Decision Records

Code Style

RuleConvention
Indentation2 spaces
QuotesSingle quotes
SemicolonsNo semicolons
CommasTrailing commas
FormattingPrettier
LintingESLint

Naming Conventions

TypeConventionExample
Classes, InterfacesPascalCaseEmployeeService
Variables, FunctionscamelCasegetEmployee
ConstantsUPPER_CASEMAX_RETRIES
Fileskebab-caseemployee-service.ts

TypeScript Rules

  • Strict mode enabled (strict: true)
  • No any types - use proper types or unknown
  • Explicit return types on all functions
  • Interfaces for object shapes
  • Type guards instead of type assertions

Project Structure

hrms/
├── apps/
│   ├── api/        # NestJS API
│   └── web/        # Next.js App
├── packages/
│   ├── database/   # Shared Prisma
│   └── hrms-ai/    # Express AI Service
└── docs/           # Documentation

Complexity Budget

AreaLimit
ServicesMax 3 (HRMS, AI, analytics)
Caching1 layer (Redis), 5-min TTL default
Auth tables7 tables for multi-tenant RBAC
API endpointsMax 10 per resource
Abstraction layersMax 4 (Controller → Service → Repository → Prisma)

Code Review Checklist

  • TypeScript strict mode passes
  • No any types
  • Follows naming conventions
  • Tests included for new features
  • tenantId filtering in all queries
  • No secrets committed
  • Follows existing patterns

Decision Framework

When making technical decisions, ask:

  1. Is it boring (proven tech)? → Go ahead
  2. Is it simple enough? → Go ahead
  3. Does it add coupling? → Duplicate instead
  4. Do we need it now? → If not, skip it
  5. Is it explicit? → No magic allowed
  6. Does it match existing patterns? → Use existing pattern
  7. Is it stable (LTS/released)? → Go ahead

When in doubt: Choose the simpler option.

Git Workflow

Branch Naming

feature/ABC-123-short-description
bugfix/ABC-123-short-description
hotfix/ABC-123-critical-fix
refactor/ABC-123-cleanup
docs/ABC-123-documentation

Commit Messages

Use Conventional Commits:

<type>(<scope>): <subject>

<body>

<footer>

Types:

  • feat: - New feature
  • fix: - Bug fix
  • docs: - Documentation changes
  • refactor: - Code refactoring (no behavior change)
  • test: - Adding/updating tests
  • chore: - Build, CI, dependencies

Examples:

git commit -m "feat(employees): add bulk import API endpoint"
git commit -m "fix(time-off): calculate balance correctly for partial days"
git commit -m "docs(api): add authentication endpoint examples"

Pull Request Process

  1. Create branch from main

    git checkout -b feature/ABC-123-description
  2. Make changes following coding standards

  3. Write tests for new functionality

  4. Push and create PR

    git push -u origin feature/ABC-123-description
  5. PR Requirements:

    • Descriptive title (follows commit message format)
    • Description with context and screenshots (if UI)
    • Link to issue/ticket
    • All CI checks pass
    • At least 1 approval from code owner
  6. Squash merge to main

    • Keeps history clean
    • PR title becomes commit message

Protected Branches

BranchRules
mainRequire PR, 1 approval, CI pass
stagingRequire PR, CI pass

Release Process

  1. Tag main with semantic version: git tag v1.2.3
  2. Push tags: git push --tags
  3. CI deploys to production on tag push

Specific conventions to be refined during development