An interactive Next.js application featuring a 3D Earth model for selecting coordinates, fetching high-resolution Sentinel-2 satellite imagery, and generating realistic 3D terrain scenes that can be explored in a street view-like interface.
- Interactive 3D Earth Model: Click anywhere on a photorealistic Earth to select coordinates
- Sentinel-2 Satellite Imagery: Fetch the latest high-resolution satellite images from ESA's Copernicus program
- 3D Terrain Generation: Convert satellite imagery into explorable 3D terrain with height maps
- Real-time 3D Scene Viewer: Explore generated 3D landscapes with camera controls
- Responsive Design: Works across desktop and mobile devices
- Framework: Next.js 14 with TypeScript
- 3D Graphics: Three.js with React Three Fiber
- Styling: Tailwind CSS
- Satellite Data: Sentinel Hub API (Sentinel-2 imagery)
- UI Components: Lucide React icons
- Node.js 18+ installed
- A Sentinel Hub account for satellite imagery (optional - fallback images provided)
- Install dependencies:
npm install- Configure environment variables (optional):
Create a
.env.localfile with your Sentinel Hub credentials:
NEXT_PUBLIC_SENTINEL_INSTANCE_ID=your_instance_id_here
NEXT_PUBLIC_SENTINEL_CLIENT_ID=your_client_id_here
NEXT_PUBLIC_SENTINEL_CLIENT_SECRET=your_client_secret_here- Start the development server:
npm run dev- Open http://localhost:3000 in your browser
- Select Location: Click anywhere on the 3D Earth model to select coordinates
- Get Satellite Image: Click "Get Satellite Image" to fetch Sentinel-2 imagery for the selected location
- Generate 3D Scene: Click "Generate 3D Scene" to create a 3D terrain from the satellite data
- Explore: Use mouse controls to navigate the 3D scene:
- Left click + drag: Rotate camera
- Right click + drag: Pan view
- Mouse wheel: Zoom in/out
POST /api/satellite- Fetch Sentinel-2 satellite imagery for coordinatesPOST /api/generate-scene- Generate 3D scene data from satellite imageryGET /api/placeholder-earth-texture- Fallback Earth texture generation
To use real Sentinel-2 satellite imagery:
- Create an account at Sentinel Hub
- Create a new configuration instance
- Get your Instance ID, Client ID, and Client Secret
- Add them to your
.env.localfile
Without these credentials, the app will use procedurally generated placeholder imagery.
src/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main application page
├── components/ # React components
│ ├── EarthModel.tsx # 3D Earth component
│ ├── CoordinateDisplay.tsx # Coordinate controls
│ ├── SatelliteImageViewer.tsx # Satellite image display
│ └── Scene3DViewer.tsx # 3D terrain viewer
├── lib/ # Utilities and services
│ ├── constants.ts # App constants
│ ├── sentinel.ts # Sentinel Hub API client
│ └── sceneGenerator.ts # 3D scene generation
└── types/ # TypeScript type definitions
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
- React Three Fiber: Declarative Three.js in React
- @react-three/drei: Useful helpers for R3F
- Tailwind CSS: Utility-first CSS framework
- TypeScript: Type safety and better development experience
This project is licensed under the MIT License.
- Sentinel Hub for satellite imagery API
- ESA Copernicus for Sentinel-2 data
- Three.js for 3D graphics
- React Three Fiber for React integration