A Spring Boot backend service for the Since Days To mobile app that aggregates free photos from multiple providers (Unsplash, Pexels, and Pixabay) through a unified REST API.
- Image Aggregation: Fetches and combines search results from Unsplash, Pexels, and Pixabay
- Curated Collections: Provides editor-picked photos from all three sources
- Caching: Built-in Caffeine cache with 24-hour expiration to reduce API calls
- Rate Limiting: Per-IP rate limiting (100 requests/60s) to prevent abuse
- API Key Protection: Secure endpoints with API key authentication
GET /search?query={query}&page={page}&perSource={perSource}&api_key={key}- Search images across all providersGET /curated?page={page}&api_key={key}- Get curated photos from all sources
The following API keys must be set for the backend to function:
UNSPLASH_API_KEY- Your Unsplash API keyPEXELS_API_KEY- Your Pexels API keyPIXABAY_API_KEY- Your Pixabay API keyAPI_KEY- Custom API key for securing endpoints
# Set environment variables
export UNSPLASH_API_KEY=your_key
export PEXELS_API_KEY=your_key
export PIXABAY_API_KEY=your_key
export API_KEY=your_custom_key
# Run with Gradle
./gradlew bootRun
# Or build and run with Docker
docker build -t sdtbackend .
docker run -p 8880:8880 \
-e UNSPLASH_API_KEY=$UNSPLASH_API_KEY \
-e PEXELS_API_KEY=$PEXELS_API_KEY \
-e PIXABAY_API_KEY=$PIXABAY_API_KEY \
-e API_KEY=$API_KEY \
sdtbackendThe service runs on port 8880 by default.