Skip to content

Harshtr8/klimate

Repository files navigation

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Weather App Project This Weather App is a modern, feature-rich web application built using React, TypeScript, and a host of cutting-edge technologies. It leverages the OpenWeather API to fetch real-time weather data and provides an intuitive and visually appealing user interface with Shadcn UI, Tailwind CSS, and Recharts.

Key Features Real-Time Weather Data: Powered by the OpenWeather API. Interactive Graphs: Use Recharts to visualize weather trends. Advanced State Management: Efficient data fetching and caching with TanStack Query. Modern UI Components: Built with Shadcn UI and styled using Tailwind CSS. Type Safety: Implemented in TypeScript for better maintainability and fewer bugs. Responsive Design: Works seamlessly across devices. Tech Stack React: Frontend framework for building user interfaces. TypeScript: Strongly-typed JavaScript for safer code. Tailwind CSS: Utility-first CSS framework for fast UI styling. TanStack Query: Powerful data fetching and state management library. Recharts: Library for building charts and data visualizations. Shadcn UI: Modern, accessible UI components. OpenWeather API: Provides weather data. Getting Started Prerequisites Ensure you have the following installed:

Node.js (v14 or later) npm or yarn OpenWeather API Key (Sign up at OpenWeather to get your API key) Installation Clone the repository:

bash Copy code git clone https://github.com/yourusername/weather-app.git cd weather-app Install dependencies:

bash Copy code npm install

or

yarn install Create a .env file in the root directory and add your OpenWeather API key:

env Copy code REACT_APP_WEATHER_API_KEY=your_api_key_here Start the development server:

bash Copy code npm start

or

yarn start Open your browser and go to http://localhost:3000.

Build for Production To create a production build, run:

bash Copy code npm run build

or

yarn build Project Structure plaintext Copy code ├── src │ ├── components # Reusable UI components │ ├── hooks # Custom hooks for API calls and data fetching │ ├── pages # Application pages │ ├── services # API service logic │ ├── types # TypeScript interfaces and types │ ├── App.tsx # Main app component │ └── index.tsx # Entry point ├── public # Public assets ├── .env # Environment variables └── README.md # Project documentation Features Overview

  1. Current Weather Displays real-time temperature, humidity, and weather conditions.
  2. Forecast Provides a 5-day forecast with interactive charts.
  3. Search Functionality Search for weather information by city name.
  4. Responsive Design Optimized for both mobile and desktop users.
  5. Data Visualization Recharts are used for rendering temperature and humidity trends in an interactive graph.
  6. Dark Mode Fully supports dark mode for better user experience. How It Works The app fetches weather data from the OpenWeather API using TanStack Query for caching and managing asynchronous data. Weather data is displayed in an interactive, responsive UI designed with Shadcn components and styled using Tailwind CSS. Recharts provide dynamic and visually appealing graphs for weather trends. Future Enhancements Add user authentication to save favorite locations. Implement geolocation for automatic weather data based on user location. Enhance error handling and offline support. Contributing Contributions are welcome! If you'd like to contribute, please follow these steps:

Fork the repository. Create a new branch (git checkout -b feature/your-feature). Commit your changes (git commit -m 'Add some feature'). Push to the branch (git push origin feature/your-feature). Open a Pull Request. License This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments OpenWeather API React TypeScript Tailwind CSS TanStack Query Recharts Shadcn UI