An open API service indexing awesome lists of open source software.

https://github.com/eraydmrcoglu/turkey-earthquake-tracker

Full-Stack Real-Time Turkey Earthquake Tracker App Created with Next.js and NestJS
https://github.com/eraydmrcoglu/turkey-earthquake-tracker

afad axios earthquake-tracker nestjs nextjs react react-svg shadcn-ui tailwindcss tanstack-table turkiye-deprem

Last synced: 2 months ago
JSON representation

Full-Stack Real-Time Turkey Earthquake Tracker App Created with Next.js and NestJS

Awesome Lists containing this project

README

          

# 🌍 Turkey Earthquake Tracker


Home Page

A full-stack web application that visualizes **real-time earthquake data across Turkey** on an interactive SVG map. The **backend (NestJS)** fetches and processes earthquake data from official sources such as **Kandilli Observatory** or **AFAD**, while the **frontend (Next.js)** displays it dynamically with responsive UI, hover tooltips, and clean visual design.

---

## ✨ Features

- πŸ—ΊοΈ Interactive map with color-coded earthquake locations
- πŸ“Š Displays magnitude, date, and time of recent earthquakes
- πŸ” Real-time API data updates
- πŸ’¬ Smooth hover tooltips with scrollable details
- 🎨 Fully responsive TailwindCSS design
- 🧩 Modular full-stack architecture (Next.js + NestJS)

---

## 🧠 Tech Stack

### 🎨 Frontend
- **Next.js 15** – React-based frontend framework
- **TypeScript** – Type-safe development
- **TailwindCSS** – Utility-first CSS framework
- **ReactSVG** – Interactive SVG rendering
- **Axios / Fetch** – For API communication

### βš™οΈ Backend
- **NestJS** – Scalable Node.js backend framework
- **TypeScript** – Strongly typed backend logic
- **Axios** – Fetches live earthquake data
- **Cron Jobs** – Periodic data updates
- **Express Adapter** – REST API endpoints

---

## βš™οΈ Installation & Setup

### 🧱 Backend (NestJS)
```bash
cd backend
npm install
npm run start:dev
```
- Runs on β†’ http://localhost:3000
- API endpoint β†’ /api/depremler

## πŸ’» Frontend (Next.js)
```bash
cd frontend
npm install
npm run dev
```
- Runs on β†’ http://localhost:3001
- Automatically connects to backend via the getDepremler() API call

## πŸ”— API Endpoints

| Endpoint | Method | Description |
|------------------------|--------|------------------------------------|
| /api/depremler | GET | Returns all recent earthquakes |
| /api/depremler/:city | GET | Returns earthquakes for a city |
| /health | GET | Health check endpoint |

## πŸ“„ Example Response
```bash
[
{
"yer": "Balikesir - Sindirgi",
"tarih": "2025-11-09",
"saat": "10:24:58",
"buyukluk": 2.9
},
{
"yer": "Manisa - Akhisar",
"tarih": "2025-11-09",
"saat": "10:15:12",
"buyukluk": 1.8
},
{
"yer": "Izmir - Seferihisar",
"tarih": "2025-11-09",
"saat": "09:48:05",
"buyukluk": 3.2
}
]
```

## 🧰 Developer Notes
- πŸ—ΊοΈ Turkey map SVG β†’ frontend/public/assets/turkey-map.svg
- πŸ” Data fetching logic β†’ frontend/src/api/api.ts
- πŸ’¬ Tooltip + hover events β†’ DepremHaritasi.tsx
- 🎨 Styling β†’ TailwindCSS for all components
- 🧠 Backend services β†’ deprem.service.ts

## πŸš€ Future Improvements
- ⚑ Real-time WebSocket support
- πŸ”” Push notifications for major earthquakes
- πŸ“± Mobile optimization
- πŸ“ Epicenter markers with zoom support