# Project Context - Star Kitten

## Current Development State

### Project Maturity

- **Phase**: Active Development
- **Version**: 0.0.0 (pre-release)
- **Status**: Core framework established, basic functionality implemented
- **Last Major Update**: Memory bank initialization (January 2025)

### Current Work Focus

- **Primary**: EVE Online Discord bot and web interface development
- **Secondary**: Framework stabilization and documentation
- **Future**: Star Citizen integration planning

### Recent Changes

- Memory bank system initialized with comprehensive documentation
- Core architecture established across four packages
- Basic EVE Online integration functional
- Discord command system with auto-discovery implemented
- Web interface with EVE SSO authentication working

## Active Features

### Discord Bot (`eve-bot`)

- **Status**: Basic functionality working
- **Commands**:
  - Market appraisal command (partial implementation)
- **Authentication**: Global client setup with Dysnomia
- **Deployment**: Environment-based configuration ready

### Web Interface (`eve-web`)

- **Status**: Basic dashboard working
- **Authentication**: EVE SSO OAuth flow implemented
- **Components**:
  - Skill queue display with progress tracking
  - Wallet balance with daily change calculation
- **Framework**: Brisa SSR with Tailwind CSS + DaisyUI

### Core Packages

- **@star-kitten/discord**: Command auto-discovery and handling
- **@star-kitten/eve**: ESI API integration, database models, third-party APIs
- **@star-kitten/util**: Streaming JSON queries, text processing, job scheduling

## Technical Debt & Known Issues

### Architecture Decisions Pending

- **Web Framework Migration**: Planned switch from Brisa to Elysia + Ripple SPA
- **Package Versioning**: All packages at 0.0.0, versioning strategy needed
- **Testing Coverage**: Current coverage unknown, target is 80%

### Implementation Gaps

- **Command System**: [`handle-commands.ts`](packages/discord/src/commands/handle-commands.ts) references global commands object not used in current pattern
- **Appraisal Command**: Modal submission handling incomplete
- **Mining Fleet Module**: Database schema exists but no implementation
- **API Error Handling**: Needs standardization across packages

### Database Schema

- **Current Tables**: users, characters, resumeCommands, miningFleets, miningFleetParticipants
- **Migration Status**: Drizzle Kit configured but migration history unclear
- **Data Location**: SQLite database at configurable path

## Development Environment

### Setup Requirements

- **Runtime**: Bun (JavaScript runtime and package manager)
- **Language**: TypeScript with strict type checking
- **Database**: SQLite with Drizzle ORM
- **Development**: VS Code with format-on-save configuration

### Build System

- **Package Manager**: Bun workspaces
- **Build Tool**: tsdown for TypeScript compilation
- **Scripts**: Unified commands across packages (build, dev, test)

### External Dependencies

- **EVE Online**: ESI API access requires client credentials
- **Janice API**: Market appraisal service requires API key
- **Discord**: Bot token required for Discord API access

## Next Steps Priority

### Immediate (Current Sprint)

1. Complete appraisal command implementation
2. Add comprehensive error handling to ESI integration
3. Implement basic test coverage for core functionality
4. Document API authentication setup process

### Short Term (Next Month)

1. Implement mining fleet management functionality
2. Add more Discord commands (character lookup, skill planning)
3. Expand web interface with more character statistics
4. Establish proper versioning and release process

### Medium Term (Next Quarter)

1. Migrate web framework to Elysia + Ripple SPA
2. Add support for corporation and alliance management
3. Implement data synchronization and caching strategies
4. Create documentation for third-party developers

### Long Term (Next Year)

1. Star Citizen integration architecture
2. Multi-game framework abstraction
3. Plugin system for community extensions
4. Performance optimization and scaling

## Key Stakeholders

### Internal Development

- **Primary Developer**: j-b-3 (project owner and main developer)
- **Target Users**: EVE Online corporations and alliances
- **Future Contributors**: Open source community (planned)

### External Dependencies

- **CCP Games**: EVE Online ESI API provider
- **Discord**: Platform and API provider
- **Community**: EVE Online player community feedback

## Risk Assessment

### Technical Risks

- **Framework Migration**: Brisa to Elysia migration complexity
- **API Rate Limits**: EVE ESI and third-party API limitations
- **Database Performance**: SQLite scalability for large datasets
- **Token Management**: OAuth token refresh reliability

### Project Risks

- **Single Developer**: No backup maintainer currently
- **Community Adoption**: Uncertain uptake by EVE Online communities
- **Game API Changes**: Dependency on external game APIs
- **Competition**: Existing EVE Online bot solutions

## Success Metrics

### Current Measurements

- **Code Quality**: Type safety across all packages
- **Architecture**: Modular design with clear separation
- **Documentation**: Comprehensive memory bank established
- **Functionality**: Basic bot and web interface working

### Target Metrics

- **Test Coverage**: 80% across major functionality
- **Performance**: <2 second Discord command response times
- **Reliability**: 99%+ uptime for deployed services
- **Adoption**: Usage by multiple EVE Online communities
