Skip to content

feat: Add Unsplash stock photo integration#55

Open
cominop wants to merge 1 commit into
brightbeanxyz:mainfrom
cominop:feature/unsplash-integration
Open

feat: Add Unsplash stock photo integration#55
cominop wants to merge 1 commit into
brightbeanxyz:mainfrom
cominop:feature/unsplash-integration

Conversation

@cominop

@cominop cominop commented Jun 4, 2026

Copy link
Copy Markdown

Summary

Adds a self-contained Unsplash stock photo integration to BrightBean Studio, allowing users to search and import photos directly from the composer.

What's included

  • apps/unsplash/ — new Django app with:
    • Unsplash API client with error handling and required attribution
    • Search endpoint (GET /api/v1/media/unsplash/search/)
    • Import endpoint (POST /api/v1/media/unsplash/import/)
    • Folder management endpoints for organizing imported media
  • Frontend modal (Alpine.js) — search Unsplash and import with one click from the composer toolbar
  • MediaAsset.external_id field — tracks stock photo provenance (e.g., Unsplash photo ID)
  • Workspace.integration_settings JSON field — for per-workspace integration config

Dependencies

  • Adds djangorestframework to requirements. The plugin uses DRF for its REST views. Happy to rewrite using Django Ninja if you'd prefer consistency — just let me know.

Configuration

Requires UNSPLASH_ACCESS_KEY in .env (free Developer tier is sufficient). Without it, the integration gracefully degrades — the modal renders empty and API endpoints return clear errors.

Testing

  • Manual: composer → "Search Unsplash" button → search → import → media library
  • No regressions: no existing files or flows modified beyond the minimal wiring in settings/urls/templates

Screenshots

The integration adds a "Search Unsplash" button next to "Media Library" in the composer toolbar. Clicking it opens a modal with search, pagination, and one-click import with attribution.

- Add apps/unsplash Django app with search, import, and folder management
- Unsplash API client with error handling and attribution
- Frontend modal (Alpine.js) for photo search/import in composer
- MediaAsset external_id field for tracking stock photo provenance
- Workspace integration_settings JSON field for per-workspace config
- DRF dependency added for Unsplash REST endpoints
- CSP allows Unsplash CDN images via existing https: img-src directive
@cominop cominop requested a review from JanSchm as a code owner June 4, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant