Vercel/README.md
2023-10-31 11:58:07 -05:00

3.0 KiB

📷 EXIF Photo Blog

https://github.com/sambecker/exif-photo-blog/assets/169298/4253ea54-558a-4358-8834-89943cfbafb4

Deploy with Vercel

Demo App

https://photos.sambecker.com

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 film simulations
OG Image Preview

Installation

1. Deploy to Vercel

  1. Click Deploy
  2. Add required storage (Vercel Postgres + Vercel Blob)
  3. 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

  1. Generate auth secret
  2. Add to environment variables:
  • AUTH_SECRET
  1. Add admin user to environment variables:
  • ADMIN_EMAIL
  • ADMIN_PASSWORD

3. Upload your first photo

  1. Visit /admin
  2. Click "Choose File"
  3. Title your photo
  4. Click "Create"

4. Develop locally

  1. Clone code
  2. Run pnpm i to install dependencies
  3. Set environment variable AUTH_URL locally (not in production) to http://localhost:3000/api/url (this is a temporary limitation of next-auth v5.0)
  4. Run vc dev to start dev server, and utilize Vercel-stored environment variables

5. Add Analytics (optional)

  1. Open project on Vercel
  2. Click "Analytics" tab
  3. Follow "Enable Web Analytics" instructions (@vercel/analytics is already part of your project)

6. Optional configuration

  • Set NEXT_PUBLIC_HIDE_REPO_LINK = 1 to remove footer link to repo
  • Set NEXT_PUBLIC_PRO_MODE = 1 to enable higher quality image storage
  • Set NEXT_PUBLIC_PUBLIC_API = 1 to enable a public API available at /api
  • Set NEXT_PUBLIC_OG_TEXT_ALIGNMENT = BOTTOM to keep OG image text bottom aligned (default is top)

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.