| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A modern, responsive weather application built with Next.js 16, React 19, TypeScript, and Tailwind CSS.
npm installCreate a .env.local file in the project root:
OPENWEATHER_API_KEY=your_api_key_hereGetting an API Key:
npm run devOpen http://localhost:3000 in your browser.
npm run build
npm start├── app/ │ ├── globals.css # Global styles │ ├── layout.tsx # Root layout with fonts │ └── page.tsx # Main weather page ├── components/ │ ├── empty-state.tsx # Empty state UI │ ├── error-message.tsx # Error display │ ├── forecast-grid.tsx # 5-day forecast cards │ ├── search-bar.tsx # Search with geolocation │ ├── weather-card.tsx # Current weather display │ └── weather-icon.tsx # Weather icon component ├── lib/ │ ├── api.ts # OpenWeather API functions │ ├── utils.ts # Utility functions │ └── weather-service.ts # Data processing layer ├── types/ │ └── weather.ts # TypeScript interfaces ├── env.example # Environment variable template ├── next.config.ts # Next.js configuration ├── tailwind.config.ts # Tailwind configuration └── package.json # Dependencies
// Get weather by city name
getWeatherByCity(city: string): Promise<CurrentWeatherResponse>
// Get weather by coordinates
getWeatherByCoords(lat: number, lon: number): Promise<CurrentWeatherResponse>
// Get 5-day forecast by city
getForecastByCity(city: string): Promise<ForecastResponse>
// Get 5-day forecast by coordinates
getForecastByCoords(lat: number, lon: number): Promise<ForecastResponse>
// Geocode city name to coordinates
geocodeCity(city: string): Promise<GeocodingResult[]>// Fetch and process weather data
fetchWeatherByCity(city: string): Promise<{ current, forecast }>
fetchWeatherByCoords(lat: number, lon: number): Promise<{ current, forecast }>| Variable | Description | Required |
|---|---|---|
| OPENWEATHER_API_KEY | OpenWeatherMap API key | Yes |
MIT License - feel free to use for personal or commercial projects.
| Back | FazBrowse Home | New Git URL |