Skip to content

sachintha88/Weather-App

Repository files navigation

Taipei

Weather App

Overview

The Weather App is a responsive web application built using modern web technologies. It provides users with real-time weather information, including temperature, precipitation, and other weather-related data. The app is designed to be user-friendly and visually appealing, leveraging various libraries and frameworks to enhance the user experience.

APIs Used

Technologies Used

Frontend

  • React: A JavaScript library for building user interfaces.
  • TypeScript: A typed superset of JavaScript that compiles to plain JavaScript.
  • Vite: A build tool that provides a fast development environment.
  • Styled-Components: A library for styling React components using tagged template literals.
  • Ant Design (AntD): A comprehensive UI component library for React.
  • Zustand: A small, fast, and scalable state management solution.
  • React Hook Form / Zod: A library for managing form state and validation.
  • React Query: A library for fetching, caching, and updating asynchronous data in React.
  • ECharts: A powerful charting and visualization library.

Testing

  • Jest: A delightful JavaScript testing framework.
  • React Testing Library: A library for testing React components.
  • @testing-library/jest-dom: Custom jest matchers to test the state of the DOM.

Build and Development Tools

  • Babel: A JavaScript compiler.
  • ESLint: A tool for identifying and fixing problems in JavaScript code.
  • Prettier: An opinionated code formatter.
  • Vite: A build tool that provides a fast development environment.

Features

  • Real-time Weather Data: Fetches and displays current weather data for a specified city.
  • Responsive Design: Optimized for various screen sizes, ensuring a seamless experience on both desktop and mobile devices.
  • Interactive Charts: Visualizes weather data using interactive charts.
  • Theming: Supports theming using styled-components and context API.
  • Form Validation: Utilizes React Hook Form for managing form state and validation.

Responsiveness

The app is designed to be fully responsive, ensuring a seamless experience across various devices and screen sizes. This is achieved using:

  • CSS Flexbox and Grid: For flexible and adaptive layouts.
  • Media Queries: To apply different styles based on screen size.
  • Styled-Components: For dynamic styling based on props and screen size.

Performance

Performance is a key consideration in the development of this app. The following techniques are used to ensure optimal performance:

  • Code Splitting: Using dynamic imports to load components only when needed.
  • Lazy Loading: Deferring the loading of non-critical resources.
  • Caching: Utilizing React Query for efficient data fetching and caching.
  • Optimized Builds: Using Vite for fast builds and optimized production bundles.

Areas for Improvement

Testing

  • Increase Test Coverage: Add more unit and integration tests to cover all components and functionalities.
  • End-to-End Testing: Implement end-to-end tests using tools like Cypress to ensure the app works as expected in a real-world scenario.
  • JEST -> RTL: migrate from JEST to react-testing-library

UI Enhancements

  • More Use of AntD: Leverage more components from Ant Design to enhance the UI and provide a consistent look and feel.
  • Custom Themes: Implement custom themes to allow users to switch between different visual styles.

Advanced Features

  • Use of LLMs (Large Language Models): Integrate AI-powered features such as natural language processing for weather queries and predictions.
  • Advanced Analytics: Provide more detailed weather analytics and visualizations using advanced charting libraries.

Getting Started

Prerequisites

  • Node.js: Ensure you have Node.js installed on your machine.
  • npm: Ensure you have npm installed (comes with Node.js).

Installation

  1. Clone the repository:

git clone https://github.com/your-username/weather-app.git

cd weather-app

  1. Install dependencies:

npm install

  1. Create a .env file in the root directory and add your API keys:

VITE_GEO_API_KEY=your_geo_api_key (Geo Location API: https://getgeoapi.com/)

VITE_WEATHER_API_KEY=your_weather_api_key (Open Weather API: https://openweathermap.org/api)

Running the App

  1. Start the development server:

npm run dev

  1. Open your browser and navigate to http://localhost:3000.

Running Tests

  1. Run the test suite:

npm test

Contributing

Contributions are welcome! Please read the contributing guidelines for more information.

License

This project is licensed under the MIT License. See the LICENSE file for details.


This README provides a comprehensive overview of the Weather App, including the technologies used, features, project structure, responsiveness, performance, and areas for improvement. It also includes instructions for getting started, running the app, and running tests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published