This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Start all services
docker compose up -d
# Check service health
scripts/check_services.sh
# Build and restart services
docker compose down && docker compose build && docker compose up -d
# Stop services
docker compose down
# Clean up volumes (removes all data)
docker compose down -vcd workers/main
# Run tests
npm run test
# Run with coverage
npm run coverage
# Run linting
npm run eslint
# Launch weekly report workflow manually
npm run launchThis repository contains a Docker Compose orchestration for two main systems:
- n8n (Port 5678): Visual workflow automation tool for business processes
- Temporal Server (Port 7233): Workflow orchestration engine for reliable task execution
- Temporal UI (Port 8080): Web interface for monitoring workflows
- PostgreSQL (Port 5432): Primary database for Temporal state
- OpenSearch (Port 9200): Search engine for Temporal visibility features
The project follows a modular Temporal worker structure:
- workers/main/: Primary Temporal worker package containing:
workflows/: Workflow definitions (e.g.,weeklyFinancialReports)activities/: Activity implementations for data processingservices/: Repository pattern implementations for external integrationsconfigs/: Environment validation using Zod schemas
- FinApp Repository: MongoDB integration for employee/project data
- QBO Repository: QuickBooks Online API integration for financial data
- Redmine: Project management system integration
- Slack: Notification delivery system
- Target Unit System: Custom business logic for financial calculations
- Workflows orchestrate complex business processes
- Activities handle individual tasks (API calls, data processing)
- Repositories abstract external system integrations
- Services provide business logic and data transformation
- Results are delivered via Slack notifications
Copy .env.example to .env and configure:
- Database credentials for PostgreSQL/MongoDB
- API tokens for Slack, QuickBooks, Redmine
- Service hostnames and ports
- OAuth2 settings for production
- Vitest: Test runner with coverage reporting
- @temporalio/testing: Temporal workflow testing utilities
- Tests are co-located with source files (*.test.ts)
- Coverage reports generated in
coverage/directory
Follow the guidelines from https://github.com/kettanaito/naming-cheatsheet:
prefix? + action (A) + high context (HC) + low context? (LC)
Action Verbs:
get: Access data immediately (e.g.,getTargetUnits,getEffectiveRevenue)fetch: Retrieve data asynchronously (e.g.,fetchFinancialAppData,fetchQboData)send: Transmit data (e.g.,sendReportToSlack)create: Instantiate new objects (e.g.,createConnection,createWorker)validate: Check data integrity (e.g.,validateEnv)handle: Manage callbacks/actions (e.g.,handleRunError)calculate: Compute values (e.g.,calculateMarginalityData)
Boolean Prefixes:
is: Characteristic (e.g.,isValidGroupName)has: Possession (e.g.,hasRequiredFields)should: Conditional (e.g.,shouldProcessData)
Variable Names:
- Use descriptive, unabbreviated names
- Singular for single values, plural for collections
- Context-specific (e.g.,
targetUnits,finData,qboData)
workers/main/vitest.config.ts: Test configuration with coverage settingsworkers/main/tsconfig.json: TypeScript configuration including shared utilitiesworkers/main/eslint.config.mjs: Linting rules- Environment validation in
workers/main/src/configs/