Multi-API mashup to discover city weather + country info + geolocation suggestions. Demonstrates async orchestration & UI state management.
- Live geolocation (auto-load on start if permitted)
- Debounced search suggestions
- Weather conditions & icon
- Country metadata (from REST Countries)
- Local time display
- Empty / loading / not-found states
geo-explorer/
├── index.html
├── assets/
│ ├── css/style.css
│ └── js/app.js
└── README.md
- HTML / Tailwind (via CDN in index) + custom CSS
- Vanilla JavaScript (ES modules style, but single file)
- External APIs: WeatherAPI, Geoapify Autocomplete, REST Countries
- Browser Geolocation API
git clone https://github.com/nuwandev/Internet-Technologies-Module-iCET.git
cd Internet-Technologies-Module-iCET/projects/geo-explorer
python -m http.server 8080Navigate in browser.
- Open page
- Allow location (optional) to auto-load
- Type a city name
- Pick a suggestion
- Read weather + country details
- UI state toggled with utility DOM class adds/removes
- Debounce wrapper around input handler
- Sequential fetch chain (weather → country data)
- Suggestion rendering separate from main info rendering
- No persistence; all ephemeral
- APIs:
GET weatherapi.com/v1/current.json?key=...&q=<query>GET api.geoapify.com/v1/geocode/autocomplete?text=<text>&...GET restcountries.com/v3.1/name/<country>
- Geolocation:
navigator.geolocation.getCurrentPosition
None.
Manual: test slow network, invalid city, permission denied geolocation.
Static hosting (ensure API keys secured — current keys appear hard-coded).
- Keys should move to serverless endpoint for production
- No caching; repeated queries always refetch
- Mobile scrolling for suggestions may need refinement
MIT
- Multi-API coordination
- Debounce implementation
- Geolocation usage
- UI state management (empty/loading/not-found)
- Async error handling patterns