A modern, responsive weather application built with SvelteKit, TypeScript, and Tailwind CSS. Get current weather conditions and 7-day forecasts for cities worldwide.
src/
โโโ lib/
โ โโโ components/ # Reusable UI components
โ โ โโโ ui/ # Base UI components (buttons, dialogs, etc.)
โ โ โโโ Header.svelte
โ โ โโโ SearchInput.svelte
โ โ โโโ CurrentWeather.svelte
โ โ โโโ ForecastWeather.svelte
โ โ โโโ WeatherCard.svelte
โ โ โโโ WeatherLocation.svelte
โ โโโ services/ # API services
โ โ โโโ weather.ts
โ โ โโโ geocoding.ts
โ โโโ stores/ # Svelte stores for state management
โ โโโ types/ # TypeScript type definitions
โ โโโ utils/ # Utility functions
โโโ routes/ # SvelteKit routes
โโโ static/ # Static assets (fonts, images, icons)
โโโ backgrounds/ # Weather background images
โโโ weather/ # Weather condition icons
Clone the repository
git clone https://github.com/yourusername/weather-app-svelte.git
cd weather-app-svelte
Install dependencies
npm install
Start development server
npm run dev
Open your browser
Navigate to http://localhost:5173
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run test # Run unit tests
npm run test:watch # Run tests in watch mode
npm run check # Type check with svelte-check
This app uses the free Open-Meteo APIs:
The project includes comprehensive unit tests:
npm run test # Run all tests
npm run test src/lib/services # Test specific directory
npm run test weather.test.ts # Test specific file
Test coverage includes:
npm run build
The built app will be in the build/ directory, ready for deployment to any static hosting provider.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License.