# Time Safari Development — Workflow and Processes

> **Agent role**: Reference this file for development workflow details when
  working with TimeSafari development processes.

## Development Workflow

### Build Commands

```bash

# Web (development)

npm run build:web

# Mobile

npm run build:capacitor
npm run build:native

# Desktop

npm run build:electron
npm run build:electron:appimage
npm run build:electron:deb
npm run build:electron:dmg

```

### Testing Commands

```bash

# Web E2E

npm run test:web

# Mobile

npm run test:mobile
npm run test:android
npm run test:ios

# Type checking

npm run type-check
npm run lint-fix

```

## Development Principles

### Code Organization

- **Platform Services**: Abstract platform-specific code behind interfaces

- **Service Factory**: Use `PlatformServiceFactory` for platform selection

- **Type Safety**: Strict TypeScript, no `any` types, use type guards

- **Modern Architecture**: Use current platform service patterns

### Architecture Patterns

- **Dependency Injection**: Services injected via mixins and factory pattern

- **Interface Segregation**: Small, focused interfaces over large ones

- **Composition over Inheritance**: Prefer mixins and composition

- **Single Responsibility**: Each component/service has one clear purpose

### Testing Strategy

- **E2E**: Playwright for critical user journeys

- **Unit**: Jest with F.I.R.S.T. principles

- **Platform Coverage**: Web + Capacitor (Pixel 5) in CI

- **Quality Assurance**: Comprehensive testing and validation

## Current Development Focus

### Active Development

- **Feature Development**: Build new functionality using modern platform

  services

- **Performance Optimization**: Improve app performance and user experience

- **Platform Enhancement**: Leverage platform-specific capabilities

- **Code Quality**: Maintain high standards and best practices

### Development Metrics

- **Code Quality**: High standards maintained across all platforms

- **Performance**: Optimized for all target devices

- **Testing**: Comprehensive coverage maintained

- **User Experience**: Focus on intuitive, accessible interfaces

## Development Environment

### Required Tools

- **Node.js**: LTS version with npm

- **Git**: Version control with proper branching strategy

- **IDE**: VS Code with recommended extensions

- **Platform Tools**: Android Studio, Xcode (for mobile development)

### Environment Setup

1. **Clone Repository**: `git clone <repository-url>`

2. **Install Dependencies**: `npm install`

3. **Environment Variables**: Copy `.env.example` to `.env.local`

4. **Platform Setup**: Follow platform-specific setup guides

### Quality Assurance

- **Linting**: ESLint with TypeScript rules

- **Formatting**: Prettier for consistent code style

- **Type Checking**: TypeScript strict mode enabled

- **Testing**: Comprehensive test coverage requirements

---

**See also**:

- `.cursor/rules/app/timesafari.mdc` for core application context

- `.cursor/rules/app/timesafari_platforms.mdc` for platform-specific details

**Status**: Active development workflow
**Priority**: High
**Estimated Effort**: Ongoing reference
**Dependencies**: timesafari.mdc, timesafari_platforms.mdc
**Stakeholders**: Development team, DevOps team

## Model Implementation Checklist

### Before TimeSafari Development

- [ ] **Environment Setup**: Verify development environment is ready
- [ ] **Platform Tools**: Ensure platform-specific tools are available
- [ ] **Dependencies**: Check all required dependencies are installed
- [ ] **Environment Variables**: Configure local environment variables

### During TimeSafari Development

- [ ] **Platform Services**: Use modern platform service patterns
- [ ] **Code Quality**: Follow ESLint and TypeScript strict rules
- [ ] **Testing**: Implement comprehensive testing strategy
- [ ] **Performance**: Optimize for all target platforms

### After TimeSafari Development

- [ ] **Quality Checks**: Run linting, formatting, and type checking
- [ ] **Testing**: Execute comprehensive tests across platforms
- [ ] **Performance Validation**: Verify performance meets requirements
- [ ] **Documentation**: Update development documentation
