Skip to content

deadshotofficial/weather-app-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌦️ Weather Forecast App (C++ with TypeScript Integration)

A powerful weather application built using C++ with TypeScript/Node.js integration to fetch real-time weather data from APIs. The application stores data locally for efficient access and provides comprehensive weather forecasting capabilities.

📌 Key Features

  • 🌡️ Multi-scale forecasts (Hourly/Daily/Weekly)
  • 📍 Location-based weather data
  • 📊 Detailed metrics including:
    • Temperature (avg/min/max)
    • Humidity levels
    • Wind speed
    • Precipitation
    • Air Quality Index (AQI)
  • 💾 Local data storage (JSON & TXT formats)
  • 🔄 Location management system
  • 📅 Custom date forecast lookup

📸 Screenshots

Feature Preview
Location Setting Location Setting
Main Menu Main Menu
Daily Forecast Daily Forecast
Alternate Location Alternate Location

🛠️ Technical Implementation

📁 File Structure

src/
  ├── data/
  │   ├── weather.json          # Raw weather data in JSON format
  │   └── weather_data.txt      # Parsed data for C++ usage
  ├── fetchWeather.ts           # TypeScript script to fetch & write weather data
  └── main.cpp                  # Main C++ application
package.json                    # Node.js dependencies
tsconfig.json                   # TypeScript config

🔄 Data Flow

  1. TypeScript Fetcher (fetchWeather.ts):

    • Connects to weather API
    • Saves raw data to weather.json
    • Creates processed weather_data.txt for C++
  2. C++ Application (main.cpp):

    • Reads from weather_data.txt
    • Provides interactive menu system
    • Displays formatted weather data

🚀 Getting Started

Prerequisites

  • Node.js (v14+)
  • C++ compiler (GCC, Clang, or MSVC)
  • TypeScript (installed via npm)

Installation

  1. Clone the repository:

    git clone https://github.com/deadshotofficial/weather-app-cpp.git
    cd weather-app-cpp
  2. Install Node.js dependencies:

    npm install
  3. Fetch initial weather data:

    npx ts-node src/fetchWeather.ts "Delhi, India" weather_data.txt
  4. Compile and run the C++ application: Compile and run main.cpp using your preferred C++ compiler. or

     g++ src/main.cpp -o weather_app
     ./weather_app

🤝 Contributing

Contributions are welcome! Please fork the repository and create a pull request with your improvements.

  • Fork the Project
  • Create your Feature Branch (git checkout -b feature/AmazingFeature)
  • Commit your Changes (git commit -m 'Add some AmazingFeature')
  • Push to the Branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

Feel free to add more features or contribute!

📜 License

Distributed under the MIT License. See LICENSE for more information.

📧 Contact

About

A simple CLI based Weather Application made in C++ for College Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors