Skip to content

Weather CLI - Interactive Terminal-based Weather App with Comprehensive Error Handling#5

Open
Psikuvit wants to merge 6 commits into
MicroClub-USTHB:mainfrom
Psikuvit:web/Psikuvit/WeatherAppCLI
Open

Weather CLI - Interactive Terminal-based Weather App with Comprehensive Error Handling#5
Psikuvit wants to merge 6 commits into
MicroClub-USTHB:mainfrom
Psikuvit:web/Psikuvit/WeatherAppCLI

Conversation

@Psikuvit

Copy link
Copy Markdown

Overview

An interactive command-line weather application that fetches real-time weather data from WeatherAPI.com with robust error handling and clean ES6+ JavaScript architecture.

Key Features

  • Interactive CLI - User-friendly terminal interface with readline
  • Real-time Weather Data - Live weather information from WeatherAPI.com
  • Secure Configuration - Environment variables for API key management
  • Comprehensive Error Handling - Graceful handling of all failure scenarios
  • Modern JavaScript - ES6+ features (async/await, destructuring, modules)
  • Formatted Output - Beautiful terminal display with emojis and structured data

Error Handling Scenarios

Valid City Input

🏗️ Architecture & Technologies

Core Technologies

  • Runtime: Node.js
  • API: WeatherAPI.com
  • Package Manager: npm
  • Environment Management: dotenv

ES6+ Features Utilized

  • Async/await for asynchronous operations
  • Destructuring for clean data extraction
  • Arrow functions for concise syntax
  • Template literals for dynamic strings
  • ES modules (import/export)

Project Structure

- Remove Express server in favor of CLI tool
- Add interactive city input using readline
- Implement comprehensive error handling:
  * Invalid city names
  * Network errors
  * Invalid API keys
  * General API errors
- Use ES6+ features (destructuring, async/await)
- Format weather output with emoji and clean display
- Rename project to weather-cli
- Remove Express dependency (not needed for CLI)
- Keep dotenv for environment variable management
- Update project description and keywords
- Add .gitignore to exclude .env and node_modules
- Add .env.example as template for API key setup
- Add comprehensive README with:
  * Installation instructions
  * Usage examples
  * Error handling scenarios
  * Project structure
  * Technologies used
- Fix data parsing to match weatherapi.com JSON structure
- Update error handling for weatherapi.com error codes
- Correct API documentation comments
- Display weather data properly (temp_c, wind_kph, pressure_mb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant