Skip to main content

Engineering Standards

Baseline engineering standards for the TrickBook project. These apply to all repositories (TrickList, Backend, docs) and must be in place before any new feature work.

Current State

StandardTrickList (Mobile)BackendDocs
Linting & FormattingNoneNoneNone
Testing0 tests / 98+ files0 tests / 24 route filesN/A
Pre-commit HooksNoneNoneNone
CI/CD PipelineManual EAS onlyManual deployGitHub Actions
Error BoundaryNoneNo global handlerN/A
Error TrackingNoneNoneN/A
Structured Loggingconsole.log (54 calls)console.log (410+ calls)N/A
API Response ValidationZod in 2 files onlyJoi in 8/24 routesN/A
.env.exampleMissingMissingN/A
TypeScript StrictBasic strict: trueNo TypeScriptN/A
DockerN/AMissingN/A
Health CheckN/AMissingN/A

Implementation Order

These standards should be implemented in this exact order. Each builds on the previous.

Phase 1: Code Quality Foundation (Day 1)

  1. Biome (Lint + Format) - Single tool for both repos
  2. Pre-commit Hooks - Prevent bad code from entering the repo

Phase 2: Safety Net (Day 1-2)

  1. Error Handling - Error boundaries (mobile) + global handler (backend)
  2. Error Tracking (Sentry) - Know when production breaks

Phase 3: Testing (Day 2-3)

  1. Testing Strategy - Start with critical paths, expand outward

Phase 4: Automation (Day 3)

  1. CI/CD Pipeline - Automated quality gates on every PR
  2. Structured Logging - Replace console.log everywhere

Phase 5: Cleanup (Day 4)

  1. Code Quality - Remove dead deps, consolidate libraries, validate API responses

Standards Per Repository

TrickList (Mobile)

TrickList/
├── biome.json # Lint + format config
├── .husky/
│ └── pre-commit # Runs: biome check --staged
├── src/
│ ├── components/
│ │ ├── Button.tsx
│ │ └── Button.test.tsx # Colocated tests
│ ├── lib/
│ │ ├── api/
│ │ │ ├── client.ts
│ │ │ └── client.test.ts
│ │ └── stores/
│ │ ├── authStore.ts
│ │ └── authStore.test.ts
│ └── app/
│ └── _layout.tsx # ErrorBoundary wraps root
├── .env.example # Template for required vars
└── package.json # Scripts: lint, test, typecheck, validate

Backend

Backend/
├── biome.json
├── .husky/
│ └── pre-commit
├── Dockerfile
├── docker-compose.yml
├── middleware/
│ ├── errorHandler.js # Global error handler
│ └── rateLimiter.js
├── __tests__/ # Or colocated
│ ├── auth.test.js
│ └── users.test.js
├── .env.example
└── package.json # Scripts: lint, test, validate

Package.json Scripts (Both Repos)

Every repo must have these scripts:

{
"scripts": {
"lint": "biome check .",
"lint:fix": "biome check --write .",
"format": "biome format --write .",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"typecheck": "tsc --noEmit",
"validate": "biome check . && tsc --noEmit && jest"
}
}

The validate script runs everything. CI runs validate. Pre-commit runs biome check --staged.