This is an implementation of the Frontend Mentor "IP Address Tracker" challenge. The app looks up IP addresses and domains, shows key details (IP, location, timezone, ISP), and renders the location on a Leaflet map.
- Responsive layout (mobile & desktop)
- Lookup by IP address or domain
- Automatically shows the user's IP on initial load
- Interactive map powered by Leaflet
- HTML, CSS, JavaScript (ES modules)
- Leaflet for maps
- IP Geolocation API: IPify (geo.ipify.org)
- Clone the repo and open the project folder.
- Install dependencies (optional; Leaflet is included via npm):
npm install- Serve the project locally (recommended) to avoid CORS issues. From the project root you can use a simple static server, for example:
# Python 3
python -m http.server 8080
# or using Node (if you have `http-server`)
npx http-server -p 8080- Open http://localhost:8080 in your browser.
Alternatively, you can open index.html directly in the browser, but using a local server is recommended.
This project uses the IP Geolocation API from IPify. The code in js/api.js currently includes an example API key. To use your own key:
- Sign up for a free account at https://geo.ipify.org/ and get your API key.
- Replace the
apiKeyvalue used injs/api.jswith your key. For example, change the URL template to:
const base = `https://geo.ipify.org/api/v2/country,city?apiKey=YOUR_API_KEY`;Note: Because this is a client-side app, do not commit your real API key to a public repo. Use a placeholder in the repo and set the real key locally or via a build step.
index.html— main markup and links to styles and JS modulesstyles.css— global stylesjs/api.js— functions that call the IPify API (replace the apiKey here)main.js— app bootstrap and UI interactionsmap.js— map initialization and marker handling (Leaflet)ui.js— DOM updates for IP, location, timezone, and ISPutils.js— helper functions
design/,assets/— images and design previews
Open js/main.js to follow app flow: it wires the form, calls fetchIPData(), updates the UI, and moves the map.
- On load the app attempts to show the user's current IP and location (if accessible).
- Enter an IP address or domain in the search field and submit.
- Results display above the map and the map recenters to the returned location.
I deploy the static site to GitHub Pages. If deploying publicly, remove or rotate any real API key used in the repository and configure the key securely. The live demo: https://scamara100.github.io/ip-address-tracker-master/
- If you see CORS or network errors, serve the project from a local static server (see Quick start).
- If the map fails to show tiles, ensure your internet connection allows Leaflet tile fetching; check console for tile URL errors.
This project is built from a Frontend Mentor challenge. See the original challenge for design assets and guidelines.