A self-hosted photo gallery with admin dashboard for uploading, processing, and serving images
This project allows an admin user to upload photos, automatically processes them into multiple sizes, stores metadata (including EXIF), and serves them publicly via a gallery API with a beautiful frontend
High-level flow:
- Frontend (Next.js) sends upload requests
- The EXIF is extracted on the client
- The Image is then resized to
1440pxon the longest side and covert toWebP
- Backend (Go + Gin) processes each image:
- Validates file type
- Resize image to thumbnail version
- Uploads images to R2
- Stores metadata and R2 Public URL in database
- Public API serves image metadata and URLs
- Backend: Hosted on an older personal laptop exposed via a Cloudflare Tunnel (~200 Mbps connection)
- Frontend: Deployed on Vercel
Uploads were evaluated using 20 batches of 15 images each (300 images total), with individual image sizes ranging from 8 MB to 16 MB
The system achieved an average upload time of 0.914 seconds per image under these conditions
Despite operating on constrained hardware and handling large image payloads, the system consistently maintained sub-second average upload times per image
Environment Variables Both frontend and backend require environment variables. Examples of each can be found at:
backend/.env.examplefrontend/.env.example
git clone https://github.com/notblankz/shutterdev.git
cd shutterdevcd backend
cp .env.example .envFill in .env with your own values.
Run the backend:
go run ./cmd/apiBackend runs on: http://localhost:8080
cd ../frontend
cp .env.example .env.local
npm install
npm run devFrontend runs on: http://localhost:3000
This project is fully self-hostable, similar to the demo deployment at images.aahansharma.dev has been hosted
- The backend is running on an Old System with a cloudflare tunnel connected to it with a domain
- The frontend can be hosted on Vercel's free tier with good enough performance
- Cloudflare's R2 can be used as the Object Storage as it provides 1 Million Requests and 10GB of data every month
This project is open-source and available under the MIT License