This is my own version of the now dead Pocket service. Only I can store things in my backpocket - all can peruse, though. Uses a modified Next.js image gallery that fetches images from Unsplash API.
-
Get an Unsplash API key from Unsplash Developers
-
Create a
.env.localfile and add your API key:
UNSPLASH_ACCESS_KEY=your_access_key_here- Install dependencies:
pnpm install- Run the development server:
pnpm run devThe app caches Unsplash images for 24 hours to avoid hitting API rate limits. The cache is stored locally in .unsplash-cache.json.
To force fresh images from Unsplash:
# Option 1: Delete the cache file
rm .unsplash-cache.json
# Option 2: Use the utility function (if you add it to a script)
node -e "require('./utils/unsplashCache').clearUnsplashCache()"The cache will automatically refresh after 24 hours or when you rebuild the app.
Made with โค๏ธ while wearing a pair of pants with pockets ๐