5.5 KiB
📷 EXIF Photo Blog
https://github.com/sambecker/exif-photo-blog/assets/169298/4253ea54-558a-4358-8834-89943cfbafb4
Demo App
Features
- Photo upload with EXIF extraction
- Organize photos by tag and camera model
- Infinite scroll
- Built-in auth
- Light/dark mode
- Automatic OG image generation
- Support for Fujifilm simulations
Installation
1. Deploy to Vercel
- Click Deploy
- Add required storage (Vercel Postgres + Vercel Blob)
- Add environment variables
NEXT_PUBLIC_SITE_TITLE(e.g., My Photos)NEXT_PUBLIC_SITE_DOMAIN(e.g., photos.domain.com)NEXT_PUBLIC_SITE_DESCRIPTION(optional—mainly used for OG meta)
2. Setup Auth
- Generate auth secret
- Add to environment variables:
AUTH_SECRET
- Add admin user to environment variables:
ADMIN_EMAILADMIN_PASSWORD
3. Upload your first photo
- Visit
/admin - Click "Choose File"
- Title your photo
- Click "Create"
4. Develop locally
- Clone code
- Run
pnpm ito install dependencies - Set environment variable
AUTH_URLlocally (not in production) tohttp://localhost:3000/api/url(this is a temporary limitation ofnext-authv5.0) - Run
vc devto start dev server, and utilize Vercel-stored environment variables
5. Add Analytics (optional)
- Open project on Vercel
- Click "Analytics" tab
- Follow "Enable Web Analytics" instructions (
@vercel/analyticsis already part of your project)
6. Optional configuration
NEXT_PUBLIC_PRO_MODE = 1enables higher quality image storageNEXT_PUBLIC_PUBLIC_API = 1enables public API available at/apiNEXT_PUBLIC_OG_TEXT_ALIGNMENT = BOTTOMkeeps OG image text bottom aligned (default is top)NEXT_PUBLIC_HIDE_REPO_LINK = 1removes footer link to repoNEXT_PUBLIC_HIDE_FILM_SIMULATIONS = 1prevents Fujifilm simulations showing up in/gridsidebar
Setup alternate storage
AWS S3
- Create bucket with "ACLs enabled," and "Block all public access" turned off
- Setup CORS:
[{ "AllowedHeaders": ["*"], "AllowedMethods": [ "GET", "PUT" ], "AllowedOrigins": [ "http://localhost:*", "https://{VERCEL_PROJECT_NAME}*.vercel.app" "{PRODUCTION_DOMAIN}", ], "ExposeHeaders": [] }] - Store configuration
- Bucket name:
NEXT_PUBLIC_S3_BUCKET - Bucket region:
NEXT_PUBLIC_S3_REGION
- Bucket name:
- Setup CORS:
- Create IAM policy for client uploads (JSON editor recommended)
- Action:
s3:PutObject,s3:PutObjectACL - Resource:
arn:aws:s3:::{BUCKET_NAME}/upload-*
- Action:
- Create IAM policy for admin actions (JSON editor recommended)
- Action:
s3:PutObject,s3:PutObjectACL,s3:GetObject,s3:ListBucket,s3:DeleteObject - Resource:
arn:aws:s3:::{BUCKET_NAME},arn:aws:s3:::{BUCKET_NAME}/*
- Action:
- Create IAM user for upload policy (by choosing "Attach policies directly"), create access key under "Security credentials," choose "Application running outside AWS," and store credentials
NEXT_PUBLIC_S3_UPLOAD_ACCESS_KEYNEXT_PUBLIC_S3_UPLOAD_SECRET_ACCESS_KEY
- Create IAM user, for admin policy (by choosing "Attach policies directly"), , create access key under "Security credentials," choose "Application running outside AWS," and store credentials (ensure admin environment variables are not prefixed with
NEXT_PUBLIC)S3_ADMIN_ACCESS_KEYS3_ADMIN_SECRET_ACCESS_KEY
FAQ
Q: My images/content have fallen out of sync with my database and/or my production site no longer matches local development. What do I do?
A: Navigate to /admin/configuration and click "Clear Cache" button.
Q: I'm seeing server-side runtime errors when loading a page after updating my fork. What do I do?
A: Navigate to /admin/configuration and click "Clear Cache" button. If this doesn't help, open an issue.
Q: Why aren't my Fujifilm simulations importing alongside EXIF data?
A: Fujifilm simulation data is stored in vendor-specific Makernote binaries embedded in EXIF data. Under certain circumstances an intermediary may strip out this data for a variety of reasons. For instance, there is a known issue on iOS where editing an image, e.g., cropping it, causes Makernote data loss. If your simulation data appears to be missing, try importing the original file as it was stored by the camera. Additionally, if you can confirm the simulation mode on camera, you can then edit the photo record and manually select it.