Photo Location Finder is a full-stack web application built with Next.js, React, and FastAPI that helps you pinpoint the exact geographical location where a photo was taken.
Upload a photo, and the app extracts GPS coordinates (latitude and longitude) embedded in the imageβs EXIF metadata. Instantly visualize the location on Google Maps and explore your captured memories in a new way.
- π Extract GPS data (latitude & longitude) from photos
- π§ Automatic conversion from DMS to decimal coordinates
- πΊοΈ Google Maps link to visualize photo locations
- π» Fast and efficient API built with FastAPI
- β‘ Modern frontend with Next.js and React
- π CORS-enabled secure backend communication
Frontend:
- βοΈ React
- πΈοΈ Next.js
Backend:
- β‘ FastAPI
- π Python
Frontend:
axios: ^1.10.0
framer-motion: ^12.23.12
gsap: ^3.13.0
lucide-react: ^0.539.0
next: 15.4.1
react: 19.1.0
react-dom: 19.1.0
Backend:
fastapi: ^0.115.0
uvicorn: ^0.30.0
piexif: ^1.1.3
- Development:
npm run dev - Build:
npm run build - Start:
npm run start - Lint:
npm run lint
-
Run Server:
uvicorn backend.main:app --reload
By default, the FastAPI backend runs on http://localhost:8000
.
βββ LICENSE
βββ backend
β βββ main.py # FastAPI backend for GPS extraction
β βββ requirements.txt
βββ frontend
βββ app
β βββ components
β β βββ ImageUploader.jsx
β β βββ LocationResult.jsx
β βββ globals.css
β βββ layout.js
β βββ page.js
βββ jsconfig.json
βββ next.config.mjs
βββ package.json
βββ postcss.config.mjs
βββ public
βββ file.svg
βββ globe.svg
βββ next.svg
βββ vercel.svg
βββ window.svg
The backend is a FastAPI service that handles photo uploads and extracts GPS EXIF metadata.
-
Validates image file type (
.jpg,.jpeg) -
Enforces a 5MB file size limit
-
Extracts and converts GPS EXIF tags (latitude/longitude)
-
Returns:
latitudelongitude- A direct Google Maps link
POST /upload β Upload image and extract GPS data
{
"latitude": 40.748817,
"longitude": -73.985428,
"map_link": "https://www.google.com/maps?q=40.748817,-73.985428"
}400: Invalid file type or corrupted image404: No GPS data found in EXIF413: File too large
-
Navigate to the backend folder
cd backend -
Create and activate a virtual environment
python -m venv venv source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows
-
Install dependencies
pip install fastapi uvicorn piexif
-
Run FastAPI server
uvicorn main:app --reload
-
Navigate to the frontend folder
cd frontend -
Install dependencies
npm install
-
Run development server
npm run dev
-
Access frontend: π http://localhost:3000
Make sure CORS in main.py allows your frontend origin:
allow_origins=["http://localhost:3000"]When deploying, replace it with your production domain.
Contributions are welcome!
-
Fork the repository
-
Clone your fork
git clone https://github.com/khatriharsh08/photo-location-finder.git
-
Create a feature branch
git checkout -b feature/your-feature
-
Commit your changes
git commit -m "Add some feature" -
Push to your branch
git push origin feature/your-feature
-
Open a Pull Request
This project is licensed under the MIT License.

