Skip to content

[FEAT] Integrate Unsplash and Upload (minio) for images - #15

Merged
martian56 merged 3 commits into
mainfrom
12-integrate-unsplash-and-upload-minio-for-images
Mar 8, 2026
Merged

[FEAT] Integrate Unsplash and Upload (minio) for images#15
martian56 merged 3 commits into
mainfrom
12-integrate-unsplash-and-upload-minio-for-images

Conversation

@martian56

Copy link
Copy Markdown
Member

This pull request introduces several new features and enhancements related to user profile, project, and workspace image handling, as well as new API endpoints for file uploads, Unsplash image search, and user favorite projects. It also integrates MinIO for file storage and updates relevant data models and handlers to support these capabilities.

File Uploads and Image Handling

  • Added a new UploadHandler with endpoints to upload images to MinIO and serve files, supporting avatars, cover images, and logos. The MinIO client is now initialized optionally and injected into the router and handlers. (api/internal/handler/upload.go, api/cmd/api/main.go, api/internal/minio/minio.go, api/internal/router/router.go) [1] [2] [3] [4] [5]
  • Extended user (User), project (Project), and workspace models and update handlers to support avatar, cover_image, and logo fields, allowing users and projects to have associated images. (api/internal/model/user.go, api/internal/model/project.go, api/internal/handler/auth.go, api/internal/handler/project.go, api/internal/handler/workspace.go) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

API and Integration Enhancements

  • Added a new handler and endpoint to proxy Unsplash image search, allowing the frontend to search for Unsplash images using a configured API key. (api/internal/handler/instance.go)

User Favorites Feature

  • Introduced a new FavoriteHandler and supporting store/service to allow users to list, add, and remove favorite projects via API endpoints. (api/internal/handler/favorite.go, api/internal/router/router.go) [1] [2] [3]

Supporting Changes

  • Updated MinIO client with helper methods for uploading and retrieving objects, simplifying file operations. (api/internal/minio/minio.go)
  • Updated imports and configuration throughout the codebase to support new dependencies and injected services. (api/internal/router/router.go, api/internal/handler/project.go, api/internal/handler/instance.go) [1] [2] [3]

These changes collectively provide a robust foundation for handling user and project images, file uploads, and favorites management in the application.

Closes #12

@martian56 martian56 added this to the Deadline milestone Mar 8, 2026
@martian56 martian56 self-assigned this Mar 8, 2026
Copilot AI review requested due to automatic review settings March 8, 2026 18:54
@martian56 martian56 added enhancement New feature or request API UI labels Mar 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-to-end image capabilities (upload to MinIO + serving), Unsplash search proxying, and a “favorite projects” feature across the API and UI to support avatars, cover images, workspace logos, and project icon/cover customization.

Changes:

  • Introduces authenticated file upload + file serving endpoints backed by an optional MinIO client.
  • Adds Unsplash search proxy endpoint and UI modal for selecting cover images (Unsplash or upload).
  • Implements user favorite projects API + UI wiring (sidebar + project list).

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
ui/src/types/index.ts Extends User type with coverImageUrl.
ui/src/services/workspaceService.ts Allows updating workspace logo from the UI.
ui/src/services/uploadService.ts Adds UI image upload helper calling /api/upload.
ui/src/services/projectService.ts Extends project update payload with cover/icon fields.
ui/src/services/instanceService.ts Adds Unsplash proxy client method + result typing.
ui/src/services/favoriteService.ts Adds UI client for favorites list/add/remove endpoints.
ui/src/pages/SettingsPage.tsx Integrates cover/avatar/logo upload + project cover/icon modals.
ui/src/pages/ProjectsListPage.tsx Adds favorites UI (star toggle) and cover/icon display on cards.
ui/src/lib/utils.ts Adds getImageUrl helper to resolve relative API image paths.
ui/src/contexts/AuthContext.tsx Maps cover_image from API into UI User.
ui/src/components/layout/Sidebar.tsx Displays workspace logo + user avatar via getImageUrl; filters favorites section by favorite IDs.
ui/src/components/UploadImageModal.tsx New modal for selecting and uploading an image.
ui/src/components/ProjectIconModal.tsx New modal + renderer for choosing emoji or icon/color.
ui/src/components/CoverImageModal.tsx New modal for Unsplash search + upload-based cover selection.
ui/src/api/types.ts Extends API types for workspace logo, project cover/icon fields, and user cover image/avatar updates.
api/internal/store/user_favorite.go Adds persistence operations for favorited projects.
api/internal/service/workspace.go Allows updating workspace logo in service layer.
api/internal/service/project.go Allows updating project cover image + emoji/icon_prop in service layer.
api/internal/router/router.go Wires new upload, Unsplash search, and favorites endpoints; injects optional MinIO client.
api/internal/model/user.go Adds cover_image field mapping on the User model.
api/internal/model/project.go Adds cover_image field mapping on the Project model.
api/internal/minio/minio.go Adds convenience helpers for put/get object in the configured bucket.
api/internal/handler/workspace.go Accepts logo in workspace update endpoint.
api/internal/handler/upload.go New upload + file-serving handler using MinIO.
api/internal/handler/project.go Accepts project cover/icon updates and maps into service update call.
api/internal/handler/instance.go Adds authenticated Unsplash search proxy endpoint.
api/internal/handler/favorite.go Adds list/add/remove favorite project endpoints.
api/internal/handler/auth.go Allows updating avatar/cover image on /users/me/ and returns cover_image in response.
api/cmd/api/main.go Initializes MinIO optionally and injects it into the router.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui/src/services/uploadService.ts Outdated
Comment thread ui/src/lib/utils.ts Outdated
Comment thread api/internal/handler/favorite.go Outdated
Comment thread api/internal/handler/upload.go Outdated
Comment thread ui/src/components/CoverImageModal.tsx Outdated
Comment thread ui/src/components/ProjectIconModal.tsx
Comment thread api/internal/store/user_favorite.go Outdated
Comment thread api/internal/handler/upload.go Outdated
Comment thread ui/src/pages/ProjectsListPage.tsx Outdated
Comment thread ui/src/components/UploadImageModal.tsx Outdated
Comment thread ui/src/pages/CyclesPage.tsx Dismissed
@martian56
martian56 merged commit 5e80322 into main Mar 8, 2026
3 checks passed
@martian56
martian56 deleted the 12-integrate-unsplash-and-upload-minio-for-images branch May 2, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate Unsplash and Upload (minio) for images

2 participants