- Application Entry (
src/app.ts,src/tui-app.ts) - Bootstrap and orchestration - UI Layer (
src/ui/) - Terminal interface with Blessed.js - Services (
src/services/) - API integration and data transformation - Types (
src/types/) - TypeScript interfaces and definitions - Utilities (
src/utils/) - Cross-cutting concerns (config, validation, formatting)
ScreenManager: Terminal lifecycle and compatibility managementEventManager: Central coordinator for user interactions and API calls- Components: Header, Menu, WeatherDisplay, LocationInput, StatusBar
ApiClient: HTTP client with error handling and authenticationWeatherService: Weather data operations and API response transformation
config.ts: Environment variable management (WEATHER_API_KEY)validator.ts: Input validation and sanitizationformatter.ts: Temperature and date formattinglogger.ts: Structured logging with levels
- blessed: Terminal UI framework
- axios: HTTP client for weather API
- dotenv: Environment configuration
- pkg: Binary packaging for distribution
- Layered error translation (API → Service → UI)
- User-friendly error messages
- Graceful degradation and cleanup
npm run dev # Development with ts-node
npm run build # TypeScript compilation
npm run build:pkg # Multi-platform binaries- Environment variable API key storage
- Input validation and sanitization
- HTTPS-only communication with 10s timeouts
- Facade: WeatherService simplifies API operations
- Observer: Event-driven architecture via EventManager
- Factory: Static component creation methods
- Strategy: Configurable formatting and API endpoints