Start Time: 09.06.25 09:00 am
Submission Deadline: 12.06.25
A React-based dashboard widget that displays and analyzes weather data across multiple cities, demonstrating advanced frontend development skills.

- Framework: React 19 with Vite
- State Management: Context API + useReducer
- Styling: CSS Modules with custom transitions
- Visualization: Pure SVG charts
- Testing: Jest + React Testing Library
- API: OpenWeatherMap with mock service
β
Data Integration
β
Complete UI Components
β
Advanced State Management
β
Custom Utility Functions
β
Responsive Design
β
Comprehensive Testing
-
Clone repository:
git clone https://github.com/your-username/weather-widget.git cd weather-widget -
Install dependencies:
npm install
-
Configure environment: Create
.envfile:VITE_OWM_API_KEY=your_openweathermap_api_key
-
Run development server:
npm run dev
/
βββ public/ # Static assets
βββ src/
β βββ components/ # All required UI components
β β βββ CitySelector/
β β βββ DataVisualization/
β β βββ ErrorBoundary/
β β βββ ForecastList/
β β βββ SettingsPanel/
β β βββ WeatherDisplay/
β βββ context/ # Theme context
β βββ hooks/ # Custom hooks
β βββ reducers/ # State reducers
β βββ services/ # API services
β βββ utils/ # Utility functions
β βββ App.jsx # Main component
βββ tests/ # Unit tests
βββ docs/ # Documentation
flowchart TD
A[WeatherWidget] --> B[CitySelector]
A --> C[WeatherDisplay]
A --> D[ForecastList]
A --> E[DataVisualization]
A --> F[SettingsPanel]
A --> G[ErrorBoundary]
B --> H[useWeatherData]
C --> H
D --> H
E --> H
F --> I[ThemeContext]
sequenceDiagram
participant User
participant CitySelector
participant useWeatherData
participant OpenWeatherAPI
participant WeatherDisplay
User->>CitySelector: Select City
CitySelector->>useWeatherData: CHANGE_CITY
useWeatherData->>OpenWeatherAPI: Fetch Data
OpenWeatherAPI-->>useWeatherData: Weather Data
useWeatherData->>WeatherDisplay: Update State
WeatherDisplay->>User: Show Weather
Run all tests with:
npm testTest coverage includes:
useWeatherDatahook- Temperature conversion utilities
- Debounce functionality
- Component snapshots
- API call throttling (1 call/5s)
- Search input debounce (300ms)
- Memoized components
- Efficient data transformations
- CSS hardware acceleration for animations
useWeatherData
Handles all weather data operations including:
- API fetching with throttling
- Data transformation
- Error handling
- Unit conversion
ThemeContext
Manages dark/light mode with color palette:
- Light:
#f8f9fa,#212529,#0d6efd - Dark:
#212529,#f8f9fa,#0d6efd
- Fixed 800px width on desktop
- Fluid layout on mobile
- Adaptive component rendering
- Mock API service included for development
- Clear error handling for API failures
- Complete documentation in code comments
- Sample tests provided for all critical paths
- Component architecture decisions
- State management approach
- Performance optimization strategies
- SVG chart implementation rationale
- Responsive design solutions
π€οΈ Developed with attention to detail and modern React patterns βοΈ