A photo gallery application that displays photos with location information on an interactive map.
- 🖼️ Responsive photo gallery with masonry layout
- 🗺️ Interactive map showing photo locations
- 📷 Detailed photo metadata (camera settings, location, date)
- 🔍 Full-size photo viewer
- 📱 Mobile-friendly design
- Install dependencies:
pnpm install- Create a
.env.localfile with your configuration:
# Storage base URL for loading project JSON files
STORAGE_BASE=https://your-storage-base-url.com
# Optional: Mapbox access token for map functionality
NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=your_mapbox_token_here- Run the development server:
pnpm devThe app loads project data from a remote storage location. Access a project using the path:
http://localhost:3000/p/project-name
The root path / redirects to /p/default by default.
STORAGE_BASE: The base URL where your project JSON files are hosted (e.g.,https://cdn.example.com)NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN: (Optional) Your Mapbox access token for the map feature
dbgen is a tool for generating photo databases. It extracts EXIF metadata from photos (camera information, GPS location, etc.), generates WebP images and previews, and creates JSON database files.
- Python 3.10 or higher
- uv (for dependency management)
Navigate to the dbgen directory and install dependencies:
cd dbgen
uv syncBasic usage:
uv run python main.py <image_directory> <project_name>Example:
# Process images in dbgen/data/t directory and generate a project named "2025-travel"
uv run python main.py data/2025-travel 2025-travelOptional arguments:
-f, --filter: Specify file extension filter pattern (default:.+\.(png|jpe?g|tiff?|webp|heic|heif))
# Process only JPG and JPEG files
uv run python main.py -f ".*\.(jpg|jpeg)$" data/2025-travel 2025-travelAfter running, the following files will be generated in the current directory:
<project_name>.json: JSON database file containing all photo metadata<project_name>/: Directory containing processed image files<photo_id>.webp: Converted original image (WebP format)<photo_id>_preview.webp: Preview image (~100KB)
dbgen extracts the following information from photos:
- Metadata: Camera model, lens model, focal length, aperture, ISO, shutter speed
- Location: GPS coordinates (latitude/longitude) and reverse geocoded location name
- Date Taken: Original capture time from EXIF data
- Image Properties: Aspect ratio and other attributes
Processing workflow:
- Scan all image files in the specified directory
- Read EXIF data from each image
- Generate WebP format original images and previews
- Generate base64-encoded thumbnails (embedded in JSON)
- Merge with existing database (if it exists)
- Save JSON database file
After processing, you can manually edit the generated <project_name>.json file to add:
- Photo titles (
title) - Photo captions (
caption) - Tags (
tags)
The database file is in JSON format, with all photos sorted by capture time.
This project can be easily deployed to Vercel, the platform created by the Next.js team.
- Install the Vercel CLI globally:
npm i -g vercel- Login to Vercel:
vercel login- Deploy to production:
vercel --prodFollow the prompts to link your project to an existing Vercel project or create a new one.
-
Push your code to a GitHub repository
-
Import your repository on Vercel:
- Click "Add New Project"
- Import your GitHub repository
- Vercel will automatically detect Next.js and configure the build settings
-
Configure environment variables:
- Go to your project settings on Vercel
- Navigate to the "Environment Variables" section
- Add the following variables:
STORAGE_BASE: The base URL where your project JSON files are hostedNEXT_PUBLIC_MAPBOX_ACCESS_TOKEN: (Optional) Your Mapbox access token
-
Deploy:
- Vercel will automatically deploy on every push to your main branch
- You can also trigger manual deployments from the Vercel dashboard
Make sure to set these environment variables in your Vercel project settings:
STORAGE_BASE: Required - The base URL where your project JSON files are hosted (e.g.,https://cdn.example.com)NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN: Optional - Your Mapbox access token for map functionality
Vercel will automatically detect Next.js and use the following build settings:
- Build Command:
pnpm build(ornpm run build) - Output Directory:
.next - Install Command:
pnpm install(ornpm install)
If you're using pnpm, make sure to create a .npmrc file in your project root (if not already present) to ensure Vercel uses pnpm:
package-manager=pnpm
After deployment, you can add a custom domain in your Vercel project settings under the "Domains" section.