https://github.com/manju1807/weatherly-nextjs-weather-app
Weatherly is a comprehensive weather application that provides real-time updates, forecasts, and detailed weather metrics. It's built with modern web technologies to provide a seamless and engaging user experience.
https://github.com/manju1807/weatherly-nextjs-weather-app
advanced-weather-app data-visualization interactive-maps nextjs-14 openweather-api react reactjs real-time-weather redux-toolkit server-side-rendering tailwindcss typescript weather-app weather-app-react weather-application weather-dashboard weather-forecast weather-monitoring
Last synced: about 1 month ago
JSON representation
Weatherly is a comprehensive weather application that provides real-time updates, forecasts, and detailed weather metrics. It's built with modern web technologies to provide a seamless and engaging user experience.
- Host: GitHub
- URL: https://github.com/manju1807/weatherly-nextjs-weather-app
- Owner: manju1807
- Created: 2024-10-15T09:44:32.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-14T05:35:49.000Z (9 months ago)
- Last Synced: 2025-01-14T06:33:36.954Z (9 months ago)
- Topics: advanced-weather-app, data-visualization, interactive-maps, nextjs-14, openweather-api, react, reactjs, real-time-weather, redux-toolkit, server-side-rendering, tailwindcss, typescript, weather-app, weather-app-react, weather-application, weather-dashboard, weather-forecast, weather-monitoring
- Language: TypeScript
- Homepage: https://weatherly18.netlify.app/
- Size: 9.34 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- Support: .github/support.yml
Awesome Lists containing this project
README
# π€οΈ Weatherly - Your Ultimate Weather Companion
**Weatherly** is a comprehensive weather application that provides real-time updates, forecasts, and detailed weather metrics. It's built with modern web technologies to provide a seamless and engaging user experience.
## π Key Features
- π Real-time weather updates and forecasts
- π‘οΈ Detailed weather metrics including temperature, humidity, and wind speed
- π Air quality monitoring and UV index tracking
- π¨ Light/Dark theme support
- π Multi-language support
- π± Responsive design for various devices
- βΏ Accessibility-focused interface
- πΊοΈ Interactive weather maps
## π οΈ Built With
- β‘ **Next.js** - React framework for production
- βοΈ **React** - JavaScript library for building user interfaces
- π **TypeScript** - Typed superset of JavaScript
- π¨ **Tailwind CSS** - Utility-first CSS framework
- π **Radix UI** - Unstyled, accessible components for React
- πΌοΈ **Lucide React** - Beautiful & consistent icon pack
- π **Recharts** - Composable charting library for React
- πΊοΈ **React Leaflet** - Maps integration
- π **next-themes** - Theme management
- π¨ **React Error Boundary** - Error handling
## ποΈ Development Process
The development of Weatherly focused on creating a user-friendly interface with robust functionality:
1. π Implemented core weather tracking features
2. π Integrated OpenWeather API for accurate data
3. π¨ Developed responsive UI with theme support
4. βΏ Implemented comprehensive accessibility features
5. β‘ Optimized performance across all devices
Throughout the development process, I prioritized code quality, accessibility, and user experience.
## πββοΈ Running the Project
To run Weatherly locally, follow these steps:
1. π₯ Clone the repository to your local machine:
```bash
git clone https://github.com/yourusername/Advanced-weather-app-nextjs.git
cd Advanced-weather-app-nextjs
```
2.π¦ Set up environment variables:
Create a `.env.local` file in the root directory with the following format:
```env
NEXT_PUBLIC_OPENWEATHER_API_KEY=your_api_key_here
NEXT_PUBLIC_BASE_URL=http://localhost:3000
```
> Note: You'll need to obtain an API key from [OpenWeather](https://openweathermap.org/api) to use the weather services.
3.π¦ Install dependencies:
```bash
npm install
# or
yarn
```
4.π Run the development server:
```bash
npm run dev
# or
yarn dev
```
5.π Open [http://localhost:3000](http://localhost:3000) in your browser
## π Note
This project uses the OpenWeather API for weather data. Ensure you comply with OpenWeather's terms of service when using their API.
## πΈ Screenshots
- 
- 
- 
---
# π Optimization Highlights
- **Centralized State Management:** Zustand store for all app state, reducing re-renders and improving debugging.
- **Optimized API Layer:** Singleton API class with in-memory caching and request deduplication.
- **Custom Hooks:** Unified hooks for weather and search, with debouncing and request cancellation.
- **LRU Search Caching:** Fast, memory-efficient city search with automatic expiration.
- **Performance Monitoring:** Real-time metrics, memory/network tracking, and Redux DevTools integration.
- **Error Handling:** Comprehensive boundaries and fallback UI.
- **Type Safety & Testing:** Full TypeScript, strict checks, and easy dependency injection for tests.
- **Scalability:** Modular, stateless components, plugin-ready, and optimized for both horizontal and vertical scaling.
### **Performance Metrics (Before β After)**
| Metric | Before | After | Improvement |
| ----------------- | ------ | ----- | ------------- |
| Initial Load Time | 2.8s | 1.2s | 57% faster |
| Search Response | 500ms | 150ms | 70% faster |
| Re-renders | 15/min | 6/min | 60% reduction |
| API Calls | 8/min | 3/min | 62% reduction |
| Memory Usage | 45MB | 28MB | 38% reduction |
# π Workflow Diagram
```mermaid
flowchart TD
A["User Input (Search/Location)"]
B["Zustand Store (State Management)"]
C["Custom Hooks (Debounce, Geolocation, etc.)"]
D["WeatherAPI (Caching, Deduplication)"]
E["OpenWeather API"]
F["Weather Data Processing"]
G["UI Components (Dashboard, Cards, Maps)"]
H["Error Boundaries & Fallbacks"]
A --> B
B --> C
C --> D
D --> E
E --> D
D --> F
F --> B
B --> G
G --> H
```
# π Folder Structure
```plaintext
src/
βββ app/ # Next.js app entry, layout, and pages
βββ components/ # UI components (cards, charts, navbar, etc.)
β βββ views/ # Dashboard, weather cards, map, etc.
βββ hooks/ # Custom hooks (weather, search, geolocation, debounce)
βββ lib/ # Core logic (api, store, performance, utils)
βββ config/ # App/site configuration
βββ constants/ # Constant values (default coordinates, etc.)
βββ types/ # TypeScript types and interfaces
βββ public/ # Static assets (icons, images, manifest)
```
# ποΈ System Design
## High-Level Design
- **UI Layer:** React components (dashboard, cards, maps) for displaying weather data.
- **State Layer:** Zustand store for all app state (weather, UI, search, etc.).
- **API Layer:** Singleton WeatherAPI with caching and deduplication.
- **Hooks Layer:** Custom hooks for optimized data fetching, search, and geolocation.
- **Performance Layer:** Real-time monitoring and metrics.
- **Error Handling:** Error boundaries and fallback UI.
## Low-Level Data Flow
1. **User Input:** User searches for a city or allows geolocation.
2. **State Update:** Zustand store updates coordinates/search state.
3. **Data Fetch:** Custom hooks trigger WeatherAPI fetch with caching and deduplication.
4. **API Response:** Data is cached and stored in Zustand.
5. **UI Render:** Components read from Zustand and render updated weather data.
6. **Error Handling:** Any errors are caught by boundaries and shown in the UI.
7. **Performance Monitoring:** All key actions are measured and logged.
---
Created with β€οΈ by Manjunath R
π€οΈ Weather data provided by OpenWeather API