Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Data Centers Are Eating The World 🌍

An open-source, automated mapping project that makes the invisible infrastructure powering our digital lives visibleβ€”starting with Kenya, expanding globally.

Project Status License Data License

🎯 What is This?

An interactive, real-time mapping platform that:

  • Makes Infrastructure Visible - Interactive maps showing every data center
  • Tracks Growth Over Time - Timeline showing infrastructure expansion
  • Reveals Impact - Visualize power consumption and economic investment
  • Stays Current - Automated scrapers pull data from multiple sources with high-precision Google Geocoding
  • Frictionless Submissions - Google Places Autocomplete enables public submitters to easily suggest data center facilities

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Python 3.9+
  • PostgreSQL 14+ with PostGIS extension

Installation

# Clone the repository
git clone [your-repo-url]
cd data_centers_mapping

# Install all dependencies
npm run install:all

# Install Python dependencies
cd scraper && pip install -r requirements.txt

Setup Database

# Create PostgreSQL database with PostGIS
createdb datacenter_map
psql datacenter_map -c "CREATE EXTENSION postgis;"

# Run migrations
npm run db:setup
npm run db:migrate

Configuration

Create .env files in backend/, frontend/, and scraper/:

backend/.env (see backend/.env.example)

DATABASE_URL=postgresql://localhost:5432/datacenter_map
PORT=3001
NODE_ENV=development
JWT_SECRET=your-32plus-char-random-secret
# Optional Google admin sign-in (same OAuth Client ID as frontend VITE_GOOGLE_CLIENT_ID):
# GOOGLE_CLIENT_ID=...
# ADMIN_GOOGLE_EMAILS=you@gmail.com
# FRONTEND_ORIGIN=http://localhost:5173

frontend/.env

VITE_API_URL=http://localhost:3001
VITE_MAPBOX_TOKEN=your_mapbox_token_here
# Unified Google Maps Platform API Key (used for Places Autocomplete):
GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
# Same OAuth Client ID as backend GOOGLE_CLIENT_ID if using Google admin sign-in:
# VITE_GOOGLE_CLIENT_ID=...

scraper/.env

DATABASE_URL=postgresql://localhost:5432/datacenter_map
# Unified Google Maps Platform API Key (used for Geocoding & Places Text Search):
GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here

Google Cloud Setup: Enable Places API, Geocoding API, and Maps JavaScript API on your Google Cloud Project. A single GOOGLE_MAPS_API_KEY cuts across both frontend and scraper pipelines.

Run the Application

# Start both frontend and backend
npm run dev

# Or start separately:
npm run dev:frontend  # Frontend at http://localhost:5173
npm run dev:backend   # Backend at http://localhost:3001

Run Data Scrapers

npm run scrape

News Monitor πŸŽ‰

Automatically monitors news sources for data center announcements and flags them for manual review:

cd scraper
python news_monitor.py

Or integrate into main scraper:

python main.py --include-news  # Run news monitor + normal scraping
python main.py --news-only      # Only check news (no DB updates)

πŸ—ΊοΈ Google Maps Platform (GMP) Integration

Google Maps Platform is integrated across the system:

  1. Public Facility Suggestions (frontend/src/pages/SuggestFacility.tsx)

    • Integrated Google Places Autocomplete widget.
    • Typing a facility name or commercial building auto-populates Address, City, Country, Latitude, and Longitude, removing decimal coordinate typing friction for public submitters.
  2. Scraper Data Pipeline (scraper/processors/geocoder.py)

    • Replaced raw Nominatim queries with Google Geocoding API & Google Places Text Search REST API.
    • Accurately resolves named commercial data center facilities across African cities where standard open geocoders fall back to city centroids.
  3. Persistent Disk Caching (scraper/data/geocoding_cache.json)

    • All resolved geocoding results are cached to a persistent JSON disk cache across scraper executions.
    • Prevents redundant API calls, saves quota, and speeds up pipeline runs.
  4. Graceful Fallback Mode

    • If no Google API key is configured, the frontend gracefully preserves standard manual input fields, and the scraper automatically falls back to Nominatim.

πŸ—οΈ Project Structure

data_centers_mapping/
β”œβ”€β”€ frontend/          # React + TypeScript UI
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/   # UI components (Mapbox, ProtectedRoute, Navbar, etc.)
β”‚   β”‚   β”œβ”€β”€ pages/        # Page components (Map, SuggestFacility, AdminDashboard, Login)
β”‚   β”‚   β”œβ”€β”€ hooks/        # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ services/     # API integration services
β”‚   β”‚   └── types/        # TypeScript type definitions
β”‚   └── public/
β”œβ”€β”€ backend/           # Node.js/Express API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/       # Express API routes
β”‚   β”‚   β”œβ”€β”€ controllers/  # Ingestion & Admin controllers
β”‚   β”‚   β”œβ”€β”€ models/       # Database access models
β”‚   β”‚   β”œβ”€β”€ middleware/   # Auth & error handling middleware
β”‚   β”‚   └── utils/        # Utility modules
β”‚   └── db/
β”‚       └── migrations/   # PostgreSQL database schema & migrations
β”œβ”€β”€ scraper/           # Python web scrapers & geocoding pipeline
β”‚   β”œβ”€β”€ scrapers/         # Source scrapers (datacentermap, datacenterscom, manual_data)
β”‚   β”œβ”€β”€ processors/       # Geocoder (GMP + Nominatim fallback), Deduplicator
β”‚   β”œβ”€β”€ db/               # Scraper PostgreSQL database connection & sync
β”‚   └── data/             # Curated datasets & persistent geocoding cache (geocoding_cache.json)
└── docs/              # Architectural, setup, deployment, and API guides

πŸ› οΈ Tech Stack

Frontend

  • React 18 + TypeScript
  • Vite - Fast build tool
  • Google Maps Platform - Places Autocomplete API
  • Mapbox GL JS - Interactive vector maps & spatial layers
  • D3.js - Data visualizations & analytics
  • Tailwind CSS - Styling & responsive UI
  • React Query - Data fetching & caching state

Backend

  • Node.js + Express
  • PostgreSQL + PostGIS - Geospatial database
  • pg (node-postgres) - Database client
  • Node-cron - Scheduled background tasks

Data Pipeline

  • Python 3.9+
  • Google Maps Geocoding & Places Text Search API - High-precision facility location resolution
  • Persistent JSON Disk Cache - Zero-redundancy geocoding cache
  • Geopy / Nominatim - Geocoding fallback
  • BeautifulSoup4 & Selenium - Dynamic scraping
  • FuzzyWuzzy - Record deduplication

πŸ“Š Features

Live Features

  • βœ… Interactive map with data center locations & clustering
  • βœ… Filter by status, capacity, ownership type
  • βœ… Public facility suggestion form with Google Places Autocomplete
  • βœ… Detail panel for each facility
  • βœ… Automated scrapers with persistent Google Geocoding
  • βœ… News monitor for infrastructure announcements
  • βœ… Export data (JSON, CSV, GeoJSON)
  • βœ… Admin dashboard for reviewing & approving public/scraper suggestions

Planned Features

  • Timeline slider (2010-2025)
  • Layer system (power grid, fiber, submarine cables)
  • Impact calculator
  • Public API endpoints
  • Automated email alerts on ingestion

🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

πŸ“„ License

  • Code: MIT License
  • Data: CC BY 4.0 (attribution required)

πŸ‘¨β€πŸ’» Author & Attribution

Created by: Victor Jotham Ashioya

How to Attribute This Project

If you use this project or its data, please provide attribution:

For Code (MIT License):

Data Centers Mapping Platform by Victor Jotham Ashioya
https://github.com/ashioyajotham/data_centers_mapping

For Data (CC BY 4.0):

Data sourced from "Data Centers Are Eating The World" by Victor Jotham Ashioya
Licensed under CC BY 4.0
https://github.com/ashioyajotham/data_centers_mapping

πŸ™ Acknowledgments

Inspired by:

About

This idea is mostly how supercomputers (AI data centers) are coming up fast so it is an attempt to map them like Semi-Analysis does

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages