Skip to content

AmandaApollo/earthquake-finder

 
 

Repository files navigation

earthquake-finder

A web application to search and visualize recent earthquakes on an interactive map.
Users can search by coordinates or place name, view earthquake details, and see contextual location information.

This application was primarily generated using v0 and intended to be used as a demo application, not production ready.

Features

  • Search for earthquakes by coordinates or place name
  • Interactive map using Leaflet
  • Earthquake data from USGS Earthquake API
  • Reverse geocoding with Nominatim
  • Earthquake markers sized and colored by magnitude
  • Popup details for each earthquake, including location, magnitude, time, depth, and tsunami alerts

Getting Started

Prerequisites

  • Node.js (18+ recommended)
  • npm or pnpm

Installation

  1. Clone the repository:

  2. Install dependencies:

    npm install # or pnpm install
  3. (Optional) Install Leaflet types for TypeScript - this will resolve errors on Leaflet, but the application will run and work without it:

    npm install --save-dev @types/leaflet

Running the App

npm run dev # or pnpm dev

Open http://localhost:3000 in your browser.

Project Structure

  • /components/earthquake-map.tsx — React component for the interactive Leaflet map
  • /app/actions.ts — Server actions for fetching and enriching earthquake data
  • /components/earthquake-search.ts — (Type definitions and search logic)

API Usage

  • USGS Earthquake API: Fetches earthquake data based on coordinates and radius.
  • Nominatim: Used for reverse geocoding (getting place names from coordinates).

Notes

  • The app uses a custom User-Agent for Nominatim requests as required by their usage policy.
  • To avoid rate limiting, a small delay is added before each reverse geocoding request.

License

MIT


Made with ❤️ using React, TypeScript, and Leaflet.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published